comparison gen/runtime.cpp @ 1521:982eb70e83b2

Fix build for LLVM >= r74640 Some LLVM objects now take a 'Context' to make multi-threaded apps easier. Since we're not multi-threaded it's safe to use llvm::getGlobalContext() which gives us the same behavior as we had before.
author Benjamin Kramer <benny.kra@gmail.com>
date Fri, 03 Jul 2009 17:24:35 +0200
parents 09734fb929c0
children b265fb6ce15b
comparison
equal deleted inserted replaced
1520:1a93c3da09ef 1521:982eb70e83b2
1 #include "gen/llvm.h" 1 #include "gen/llvm.h"
2 #include "gen/llvm-version.h"
3 #if LLVM_REV >= 74640
4 #include "llvm/LLVMContext.h"
5 #endif
2 #include "llvm/Module.h" 6 #include "llvm/Module.h"
3 #include "llvm/Attributes.h" 7 #include "llvm/Attributes.h"
4 #include "llvm/Bitcode/ReaderWriter.h" 8 #include "llvm/Bitcode/ReaderWriter.h"
5 #include "llvm/Support/MemoryBuffer.h" 9 #include "llvm/Support/MemoryBuffer.h"
6 #include "llvm/Support/CommandLine.h" 10 #include "llvm/Support/CommandLine.h"
147 } 151 }
148 152
149 static void LLVM_D_BuildRuntimeModule() 153 static void LLVM_D_BuildRuntimeModule()
150 { 154 {
151 Logger::println("building module"); 155 Logger::println("building module");
156 #if LLVM_REV >= 74640
157 M = new llvm::Module("ldc internal runtime", llvm::getGlobalContext());
158 #else
152 M = new llvm::Module("ldc internal runtime"); 159 M = new llvm::Module("ldc internal runtime");
160 #endif
153 161
154 Logger::println("building basic types"); 162 Logger::println("building basic types");
155 const LLType* voidTy = LLType::VoidTy; 163 const LLType* voidTy = LLType::VoidTy;
156 const LLType* boolTy = LLType::Int1Ty; 164 const LLType* boolTy = LLType::Int1Ty;
157 const LLType* byteTy = LLType::Int8Ty; 165 const LLType* byteTy = LLType::Int8Ty;