[Libclc-dev] [PATCH 1/2] Fix build with LLVM 3.3

Niels Ole Salscheider niels_ole at salscheider-online.de
Mon Feb 25 07:23:05 PST 2013


---
 configure.py               | 3 ++-
 utils/prepare-builtins.cpp | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.py b/configure.py
index d861c24..840d430 100755
--- a/configure.py
+++ b/configure.py
@@ -62,7 +62,8 @@ def llvm_config(args):
 
 llvm_bindir = llvm_config(['--bindir'])
 llvm_core_libs = llvm_config(['--ldflags', '--libs', 'core', 'bitreader', 'bitwriter'])
-llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'
+llvm_version = llvm_config(['--version'])
+llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti' + ' -DHAVE_LLVM=0x0' + llvm_version.replace('.', '0').replace('svn', '')
 
 llvm_clang = os.path.join(llvm_bindir, 'clang')
 llvm_link = os.path.join(llvm_bindir, 'llvm-link')
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index ae7731b..ac4624f 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -1,9 +1,16 @@
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/Bitcode/ReaderWriter.h"
+#if HAVE_LLVM < 0x0303
 #include "llvm/Function.h"
 #include "llvm/GlobalVariable.h"
 #include "llvm/LLVMContext.h"
 #include "llvm/Module.h"
+#else
+#include "llvm/IR/Function.h"
+#include "llvm/IR/GlobalVariable.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
+#endif
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MemoryBuffer.h"
-- 
1.8.1.3





More information about the Libclc-dev mailing list