Mercurial > projects > ldc
comparison gen/todebug.cpp @ 1529:ad7f2f1862d6
Adjust LDC to work with the LLVMContext LLVM changes.
This means we now require a fairly new LLVM revision. I use 75234.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 10 Jul 2009 21:30:02 +0200 |
parents | a7a9e461512a |
children | 8ca25bd765a3 |
comparison
equal
deleted
inserted
replaced
1528:15f1707721fa | 1529:ad7f2f1862d6 |
---|---|
36 static LLGlobalVariable* emitDwarfGlobalDecl(const LLStructType* type, const char* name, bool linkonce=false) | 36 static LLGlobalVariable* emitDwarfGlobalDecl(const LLStructType* type, const char* name, bool linkonce=false) |
37 { | 37 { |
38 LLGlobalValue::LinkageTypes linkage = linkonce | 38 LLGlobalValue::LinkageTypes linkage = linkonce |
39 ? DEBUGINFO_LINKONCE_LINKAGE_TYPE | 39 ? DEBUGINFO_LINKONCE_LINKAGE_TYPE |
40 : LLGlobalValue::InternalLinkage; | 40 : LLGlobalValue::InternalLinkage; |
41 LLGlobalVariable* gv = new LLGlobalVariable(type, true, linkage, NULL, name, gIR->module); | 41 LLGlobalVariable* gv = new LLGlobalVariable(*gIR->module, type, true, linkage, NULL, name); |
42 gv->setSection("llvm.metadata"); | 42 gv->setSection("llvm.metadata"); |
43 return gv; | 43 return gv; |
44 } | 44 } |
45 | 45 |
46 ////////////////////////////////////////////////////////////////////////////////////////////////// | 46 ////////////////////////////////////////////////////////////////////////////////////////////////// |
254 std::vector<LLConstant*> elems(2); | 254 std::vector<LLConstant*> elems(2); |
255 elems[0] = DBG_CAST(len); | 255 elems[0] = DBG_CAST(len); |
256 elems[1] = DBG_CAST(ptr); | 256 elems[1] = DBG_CAST(ptr); |
257 | 257 |
258 LLConstant* ca = LLConstantArray::get(at, elems); | 258 LLConstant* ca = LLConstantArray::get(at, elems); |
259 members = new LLGlobalVariable(ca->getType(), true, LLGlobalValue::InternalLinkage, ca, ".array", gIR->module); | 259 members = new LLGlobalVariable(*gIR->module, ca->getType(), true, LLGlobalValue::InternalLinkage, ca, ".array"); |
260 members->setSection("llvm.metadata"); | 260 members->setSection("llvm.metadata"); |
261 | 261 |
262 name = DtoConstStringPtr(t->toChars(), "llvm.metadata"); | 262 name = DtoConstStringPtr(t->toChars(), "llvm.metadata"); |
263 } | 263 } |
264 | 264 |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 const LLArrayType* at = LLArrayType::get(DBG_TYPE, elems.size()); | 331 const LLArrayType* at = LLArrayType::get(DBG_TYPE, elems.size()); |
332 LLConstant* ca = LLConstantArray::get(at, elems); | 332 LLConstant* ca = LLConstantArray::get(at, elems); |
333 members = new LLGlobalVariable(ca->getType(), true, LLGlobalValue::InternalLinkage, ca, ".array", gIR->module); | 333 members = new LLGlobalVariable(*gIR->module, ca->getType(), true, LLGlobalValue::InternalLinkage, ca, ".array"); |
334 members->setSection("llvm.metadata"); | 334 members->setSection("llvm.metadata"); |
335 } | 335 } |
336 | 336 |
337 // unsupported composite type | 337 // unsupported composite type |
338 else | 338 else |