diff --git a/libclc/utils/CMakeLists.txt b/libclc/utils/CMakeLists.txt index 6851ae16bda07..a14d133985a64 100644 --- a/libclc/utils/CMakeLists.txt +++ b/libclc/utils/CMakeLists.txt @@ -1,6 +1,3 @@ -# Construct LLVM version define -set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" ) - # Setup prepare_builtins tools set( LLVM_LINK_COMPONENTS BitReader @@ -19,6 +16,5 @@ else() setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target ) endif() -target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) # These were not properly reported in early LLVM and we don't need them target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions ) diff --git a/libclc/utils/prepare-builtins.cpp b/libclc/utils/prepare-builtins.cpp index b10dfccc6d88c..40a5445ef507f 100644 --- a/libclc/utils/prepare-builtins.cpp +++ b/libclc/utils/prepare-builtins.cpp @@ -6,12 +6,8 @@ // //===----------------------------------------------------------------------===// -#if HAVE_LLVM > 0x0390 #include "llvm/Bitcode/BitcodeReader.h" #include "llvm/Bitcode/BitcodeWriter.h" -#else -#include "llvm/Bitcode/ReaderWriter.h" -#endif #include "llvm/Config/llvm-config.h" #include "llvm/IR/Function.h" @@ -62,12 +58,8 @@ int main(int argc, char **argv) { std::unique_ptr &BufferPtr = BufferOrErr.get(); SMDiagnostic Err; std::unique_ptr MPtr = -#if HAVE_LLVM > 0x0390 ExitOnErr(Expected>( parseIR(BufferPtr.get()->getMemBufferRef(), Err, Context))); -#else - parseIR(BufferPtr.get()->getMemBufferRef(), Err, Context); -#endif M = MPtr.release(); } } @@ -106,13 +98,8 @@ int main(int argc, char **argv) { } std::error_code EC; -#if HAVE_LLVM >= 0x0600 std::unique_ptr Out( new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); -#else - std::unique_ptr Out( - new tool_output_file(OutputFilename, EC, sys::fs::OF_None)); -#endif if (EC) { errs() << EC.message() << '\n'; exit(1); @@ -121,11 +108,7 @@ int main(int argc, char **argv) { if (TextualOut) M->print(Out->os(), nullptr, true); else -#if HAVE_LLVM >= 0x0700 WriteBitcodeToFile(*M, Out->os()); -#else - WriteBitcodeToFile(M, Out->os()); -#endif // Declare success. Out->keep();