Skip to content

Commit 0d65856

Browse files
authored
libclc: Remove HAVE_LLVM version macros (#158257)
This doesn't need to pretend to support multiple versions of llvm and these are old anyway.
1 parent 1f49c94 commit 0d65856

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

libclc/utils/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Construct LLVM version define
2-
set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" )
3-
41
# Setup prepare_builtins tools
52
set( LLVM_LINK_COMPONENTS
63
BitReader
@@ -19,6 +16,5 @@ else()
1916
setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target )
2017
endif()
2118

22-
target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
2319
# These were not properly reported in early LLVM and we don't need them
2420
target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )

libclc/utils/prepare-builtins.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#if HAVE_LLVM > 0x0390
109
#include "llvm/Bitcode/BitcodeReader.h"
1110
#include "llvm/Bitcode/BitcodeWriter.h"
12-
#else
13-
#include "llvm/Bitcode/ReaderWriter.h"
14-
#endif
1511

1612
#include "llvm/Config/llvm-config.h"
1713
#include "llvm/IR/Function.h"
@@ -62,12 +58,8 @@ int main(int argc, char **argv) {
6258
std::unique_ptr<MemoryBuffer> &BufferPtr = BufferOrErr.get();
6359
SMDiagnostic Err;
6460
std::unique_ptr<llvm::Module> MPtr =
65-
#if HAVE_LLVM > 0x0390
6661
ExitOnErr(Expected<std::unique_ptr<llvm::Module>>(
6762
parseIR(BufferPtr.get()->getMemBufferRef(), Err, Context)));
68-
#else
69-
parseIR(BufferPtr.get()->getMemBufferRef(), Err, Context);
70-
#endif
7163
M = MPtr.release();
7264
}
7365
}
@@ -106,13 +98,8 @@ int main(int argc, char **argv) {
10698
}
10799

108100
std::error_code EC;
109-
#if HAVE_LLVM >= 0x0600
110101
std::unique_ptr<ToolOutputFile> Out(
111102
new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None));
112-
#else
113-
std::unique_ptr<tool_output_file> Out(
114-
new tool_output_file(OutputFilename, EC, sys::fs::OF_None));
115-
#endif
116103
if (EC) {
117104
errs() << EC.message() << '\n';
118105
exit(1);
@@ -121,11 +108,7 @@ int main(int argc, char **argv) {
121108
if (TextualOut)
122109
M->print(Out->os(), nullptr, true);
123110
else
124-
#if HAVE_LLVM >= 0x0700
125111
WriteBitcodeToFile(*M, Out->os());
126-
#else
127-
WriteBitcodeToFile(M, Out->os());
128-
#endif
129112

130113
// Declare success.
131114
Out->keep();

0 commit comments

Comments
 (0)