summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Ketema <j.ketema@imperial.ac.uk>2015-08-07 08:31:37 +0000
committerJeroen Ketema <j.ketema@imperial.ac.uk>2015-08-07 08:31:37 +0000
commitf97d9db40718f2e68b3f0b44200760d8e0d50532 (patch)
tree4f677a816c3b17ecb1664087e8d62d020bfd89b8
parent7958b0202bf5d274dfb6ce3562141957ed21ee8f (diff)
Require LLVM >=3.7 and bump version to 0.2.0
v2: Also remove LLVM 3.6 traces from prepare-builtins.cpp Patch by: EdB git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@244310 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xconfigure.py11
-rw-r--r--utils/prepare-builtins.cpp16
2 files changed, 8 insertions, 19 deletions
diff --git a/configure.py b/configure.py
index 1072ca8..287f87f 100755
--- a/configure.py
+++ b/configure.py
@@ -5,7 +5,7 @@ def c_compiler_rule(b, name, description, compiler, flags):
b.rule(name, command, description + " $out", depfile="$out.d")
version_major = 0;
-version_minor = 1;
+version_minor = 2;
version_patch = 0;
from optparse import OptionParser
@@ -66,12 +66,13 @@ def llvm_config(args):
sys.exit(1)
llvm_version = string.split(string.replace(llvm_config(['--version']), 'svn', ''), '.')
-if (int(llvm_version[0]) != 3 and int(llvm_version[1]) != 6):
- print "libclc requires LLVM 3.6"
- sys.exit(1)
-
+llvm_int_version = int(llvm_version[0]) * 100 + int(llvm_version[1]) * 10
llvm_string_version = 'LLVM' + llvm_version[0] + '.' + llvm_version[1]
+if llvm_int_version < 370:
+ print "libclc requires LLVM >= 3.7"
+ sys.exit(1)
+
llvm_system_libs = llvm_config(['--system-libs'])
llvm_bindir = llvm_config(['--bindir'])
llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
index e439ad1..a7b0db5 100644
--- a/utils/prepare-builtins.cpp
+++ b/utils/prepare-builtins.cpp
@@ -14,10 +14,6 @@
#include <system_error>
-#define LLVM_360 \
- (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6)
-
-
using namespace llvm;
static cl::opt<std::string>
@@ -43,20 +39,12 @@ int main(int argc, char **argv) {
if (std::error_code ec = BufferOrErr.getError())
ErrorMessage = ec.message();
else {
-#if LLVM_360
- ErrorOr<Module *>
-#else
- ErrorOr<std::unique_ptr<Module>>
-#endif
- ModuleOrErr =
+ ErrorOr<std::unique_ptr<Module>> ModuleOrErr =
parseBitcodeFile(BufferPtr.get()->getMemBufferRef(), Context);
if (std::error_code ec = ModuleOrErr.getError())
ErrorMessage = ec.message();
-#if LLVM_360
- M = ModuleOrErr.get();
-#else
+
M = ModuleOrErr.get().release();
-#endif
}
}