Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions libclc/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 0 additions & 17 deletions libclc/utils/prepare-builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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);
Expand All @@ -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();
Expand Down
Loading