Skip to content

Commit d915739

Browse files
author
Jeroen Ketema
committed
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 llvm-svn: 244310
1 parent 8dbe161 commit d915739

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

libclc/configure.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def c_compiler_rule(b, name, description, compiler, flags):
55
b.rule(name, command, description + " $out", depfile="$out.d")
66

77
version_major = 0;
8-
version_minor = 1;
8+
version_minor = 2;
99
version_patch = 0;
1010

1111
from optparse import OptionParser
@@ -66,12 +66,13 @@ def llvm_config(args):
6666
sys.exit(1)
6767

6868
llvm_version = string.split(string.replace(llvm_config(['--version']), 'svn', ''), '.')
69-
if (int(llvm_version[0]) != 3 and int(llvm_version[1]) != 6):
70-
print "libclc requires LLVM 3.6"
71-
sys.exit(1)
72-
69+
llvm_int_version = int(llvm_version[0]) * 100 + int(llvm_version[1]) * 10
7370
llvm_string_version = 'LLVM' + llvm_version[0] + '.' + llvm_version[1]
7471

72+
if llvm_int_version < 370:
73+
print "libclc requires LLVM >= 3.7"
74+
sys.exit(1)
75+
7576
llvm_system_libs = llvm_config(['--system-libs'])
7677
llvm_bindir = llvm_config(['--bindir'])
7778
llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \

libclc/utils/prepare-builtins.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
#include <system_error>
1616

17-
#define LLVM_360 \
18-
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 6)
19-
20-
2117
using namespace llvm;
2218

2319
static cl::opt<std::string>
@@ -43,20 +39,12 @@ int main(int argc, char **argv) {
4339
if (std::error_code ec = BufferOrErr.getError())
4440
ErrorMessage = ec.message();
4541
else {
46-
#if LLVM_360
47-
ErrorOr<Module *>
48-
#else
49-
ErrorOr<std::unique_ptr<Module>>
50-
#endif
51-
ModuleOrErr =
42+
ErrorOr<std::unique_ptr<Module>> ModuleOrErr =
5243
parseBitcodeFile(BufferPtr.get()->getMemBufferRef(), Context);
5344
if (std::error_code ec = ModuleOrErr.getError())
5445
ErrorMessage = ec.message();
55-
#if LLVM_360
56-
M = ModuleOrErr.get();
57-
#else
46+
5847
M = ModuleOrErr.get().release();
59-
#endif
6048
}
6149
}
6250

0 commit comments

Comments
 (0)