diff 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
line wrap: on
line diff
--- a/gen/runtime.cpp	Tue Jun 30 22:07:50 2009 +0200
+++ b/gen/runtime.cpp	Fri Jul 03 17:24:35 2009 +0200
@@ -1,4 +1,8 @@
 #include "gen/llvm.h"
+#include "gen/llvm-version.h"
+#if LLVM_REV >= 74640
+#include "llvm/LLVMContext.h"
+#endif
 #include "llvm/Module.h"
 #include "llvm/Attributes.h"
 #include "llvm/Bitcode/ReaderWriter.h"
@@ -149,7 +153,11 @@
 static void LLVM_D_BuildRuntimeModule()
 {
     Logger::println("building module");
+#if LLVM_REV >= 74640
+    M = new llvm::Module("ldc internal runtime", llvm::getGlobalContext());
+#else
     M = new llvm::Module("ldc internal runtime");
+#endif
 
     Logger::println("building basic types");
     const LLType* voidTy = LLType::VoidTy;