Mercurial > projects > ldc
comparison gen/todebug.cpp @ 1560:1d5c3354b3c2
getNullValue is in Constant again
Requires LLVM >= r77721
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Fri, 31 Jul 2009 23:01:29 +0200 |
parents | d6e8d5db259f |
children | 755abafbf25d |
comparison
equal
deleted
inserted
replaced
1559:06d5cc873350 | 1560:1d5c3354b3c2 |
---|---|
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 ( gIR->context().getNullValue(DBG_TYPE) ) | 22 #define DBG_NULL ( LLConstant::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] = gIR->context().getNullValue(getDwarfCompositeTypeType()->getContainedType(i)); | 300 initvals[i] = LLConstant::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 |