Mercurial > projects > ldc
comparison gen/todebug.cpp @ 1534:8ca25bd765a3
Build fix for the latest LLVMContext changes (LLVM r75445)
This shouldn't break the build with older LLVM revs. We include
LLVMContext.h in gen/llvm.h now to make the transition a little bit
easier.
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Mon, 13 Jul 2009 12:17:58 +0200 |
parents | ad7f2f1862d6 |
children | 61f12f4651b5 |
comparison
equal
deleted
inserted
replaced
1533:d1652c8fb4f6 | 1534:8ca25bd765a3 |
---|---|
17 | 17 |
18 #include "ir/irmodule.h" | 18 #include "ir/irmodule.h" |
19 | 19 |
20 using namespace llvm::dwarf; | 20 using namespace llvm::dwarf; |
21 | 21 |
22 #define DBG_NULL ( LLConstant::getNullValue(DBG_TYPE) ) | 22 #define DBG_NULL ( llvm::getGlobalContext().getNullValue(DBG_TYPE) ) |
23 #define DBG_TYPE ( getPtrToType(llvm::StructType::get(NULL,NULL)) ) | 23 #define DBG_TYPE ( getPtrToType(llvm::StructType::get(NULL,NULL)) ) |
24 #define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) ) | 24 #define DBG_CAST(X) ( llvm::ConstantExpr::getBitCast(X, DBG_TYPE) ) |
25 | 25 |
26 #define DBG_TAG(X) ( llvm::ConstantExpr::getAdd( DtoConstUint( X ), DtoConstUint( llvm::LLVMDebugVersion ) ) ) | 26 #define DBG_TAG(X) ( llvm::ConstantExpr::getAdd( DtoConstUint( X ), DtoConstUint( llvm::LLVMDebugVersion ) ) ) |
27 | 27 |
295 gv = emitDwarfGlobalDecl(getDwarfCompositeTypeType(), "llvm.dbg.compositetype"); | 295 gv = emitDwarfGlobalDecl(getDwarfCompositeTypeType(), "llvm.dbg.compositetype"); |
296 // set bogus initializer to satisfy asserts in DICompositeType constructor | 296 // set bogus initializer to satisfy asserts in DICompositeType constructor |
297 std::vector<LLConstant*> initvals(11); | 297 std::vector<LLConstant*> initvals(11); |
298 initvals[0] = DBG_TAG(DW_TAG_structure_type); | 298 initvals[0] = DBG_TAG(DW_TAG_structure_type); |
299 for (int i = 1; i < initvals.size(); ++i) | 299 for (int i = 1; i < initvals.size(); ++i) |
300 initvals[i] = LLConstant::getNullValue(getDwarfCompositeTypeType()->getContainedType(i)); | 300 initvals[i] = llvm::getGlobalContext().getNullValue(getDwarfCompositeTypeType()->getContainedType(i)); |
301 gv->setInitializer(LLConstantStruct::get(getDwarfCompositeTypeType(), initvals)); | 301 gv->setInitializer(LLConstantStruct::get(getDwarfCompositeTypeType(), initvals)); |
302 ir->diCompositeType = llvm::DICompositeType(gv); | 302 ir->diCompositeType = llvm::DICompositeType(gv); |
303 | 303 |
304 tag = DW_TAG_structure_type; | 304 tag = DW_TAG_structure_type; |
305 | 305 |