https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/158257
This doesn't need to pretend to support multiple versions of llvm and these are old anyway. >From 34e55fceed99df44d587d27ab4478e3b8500dd2b Mon Sep 17 00:00:00 2001 From: Matt Arsenault <[email protected]> Date: Fri, 12 Sep 2025 18:45:07 +0900 Subject: [PATCH] libclc: Remove HAVE_LLVM version macros This doesn't need to pretend to support multiple versions of llvm and these are old anyway. --- libclc/utils/CMakeLists.txt | 3 --- libclc/utils/prepare-builtins.cpp | 17 ----------------- 2 files changed, 20 deletions(-) diff --git a/libclc/utils/CMakeLists.txt b/libclc/utils/CMakeLists.txt index 6851ae16bda07..04c5611b2cf5e 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 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<MemoryBuffer> &BufferPtr = BufferOrErr.get(); SMDiagnostic Err; std::unique_ptr<llvm::Module> MPtr = -#if HAVE_LLVM > 0x0390 ExitOnErr(Expected<std::unique_ptr<llvm::Module>>( 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<ToolOutputFile> Out( new ToolOutputFile(OutputFilename, EC, sys::fs::OF_None)); -#else - std::unique_ptr<tool_output_file> 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(); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
