libclc: Remove HAVE_LLVM version macros (#158257)

This doesn't need to pretend to support multiple versions of llvm
and these are old anyway.
This commit is contained in:
Matt Arsenault
2025-09-12 19:08:57 +09:00
committed by GitHub
parent 1f49c9494e
commit 0d65856584
2 changed files with 0 additions and 21 deletions

View File

@@ -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 )

View File

@@ -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();