comparison gen/toobj.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 c88b16d4a13c
children 61f12f4651b5
comparison
equal deleted inserted replaced
1533:d1652c8fb4f6 1534:8ca25bd765a3
12 12
13 #include "gen/llvm.h" 13 #include "gen/llvm.h"
14 #include "gen/llvm-version.h" 14 #include "gen/llvm-version.h"
15 #include "llvm/Analysis/Verifier.h" 15 #include "llvm/Analysis/Verifier.h"
16 #include "llvm/Bitcode/ReaderWriter.h" 16 #include "llvm/Bitcode/ReaderWriter.h"
17 #include "llvm/LLVMContext.h"
18 #include "llvm/Module.h" 17 #include "llvm/Module.h"
19 #include "llvm/ModuleProvider.h" 18 #include "llvm/ModuleProvider.h"
20 #include "llvm/PassManager.h" 19 #include "llvm/PassManager.h"
21 #include "llvm/LinkAllPasses.h" 20 #include "llvm/LinkAllPasses.h"
22 #include "llvm/System/Program.h" 21 #include "llvm/System/Program.h"
553 LLFunction* ctor = LLFunction::Create(fty, LLGlobalValue::InternalLinkage, fname, gIR->module); 552 LLFunction* ctor = LLFunction::Create(fty, LLGlobalValue::InternalLinkage, fname, gIR->module);
554 553
555 // provide the default initializer 554 // provide the default initializer
556 const LLStructType* modulerefTy = DtoModuleReferenceType(); 555 const LLStructType* modulerefTy = DtoModuleReferenceType();
557 std::vector<LLConstant*> mrefvalues; 556 std::vector<LLConstant*> mrefvalues;
558 mrefvalues.push_back(LLConstant::getNullValue(modulerefTy->getContainedType(0))); 557 mrefvalues.push_back(llvm::getGlobalContext().getNullValue(modulerefTy->getContainedType(0)));
559 mrefvalues.push_back(llvm::ConstantExpr::getBitCast(moduleinfo, modulerefTy->getContainedType(1))); 558 mrefvalues.push_back(llvm::ConstantExpr::getBitCast(moduleinfo, modulerefTy->getContainedType(1)));
560 LLConstant* thismrefinit = LLConstantStruct::get(modulerefTy, mrefvalues); 559 LLConstant* thismrefinit = LLConstantStruct::get(modulerefTy, mrefvalues);
561 560
562 // create the ModuleReference node for this module 561 // create the ModuleReference node for this module
563 std::string thismrefname = "_D"; 562 std::string thismrefname = "_D";