[libclc] r244310 - Require LLVM >=3.7 and bump version to 0.2.0

Jeroen Ketema via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 7 01:31:37 PDT 2015


Author: jketema
Date: Fri Aug  7 03:31:37 2015
New Revision: 244310

URL: http://llvm.org/viewvc/llvm-project?rev=244310&view=rev
Log:
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

Modified:
    libclc/trunk/configure.py
    libclc/trunk/utils/prepare-builtins.cpp

Modified: libclc/trunk/configure.py
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/configure.py?rev=244310&r1=244309&r2=244310&view=diff
==============================================================================
--- libclc/trunk/configure.py (original)
+++ libclc/trunk/configure.py Fri Aug  7 03:31:37 2015
@@ -5,7 +5,7 @@ def c_compiler_rule(b, name, description
   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']) + ' ' + \

Modified: libclc/trunk/utils/prepare-builtins.cpp
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/utils/prepare-builtins.cpp?rev=244310&r1=244309&r2=244310&view=diff
==============================================================================
--- libclc/trunk/utils/prepare-builtins.cpp (original)
+++ libclc/trunk/utils/prepare-builtins.cpp Fri Aug  7 03:31:37 2015
@@ -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
     }
   }
 




More information about the cfe-commits mailing list