Skip to content

Commit

Permalink
Merge pull request halide#2750 from halide/srj-llvm
Browse files Browse the repository at this point in the history
Fix API change for trunk LLVM
  • Loading branch information
steven-johnson authored Feb 14, 2018
2 parents b848f79 + 7de2b4f commit 46d8e9e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/LLVM_Output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ std::unique_ptr<llvm::Module> clone_module(const llvm::Module &module_in) {
// Write the module to a buffer.
llvm::SmallVector<char, 16> clone_buffer;
llvm::raw_svector_ostream clone_ostream(clone_buffer);
#if LLVM_VERSION >= 70
WriteBitcodeToFile(module_in, clone_ostream);
#else
WriteBitcodeToFile(&module_in, clone_ostream);
#endif

// Read it back in.
llvm::MemoryBufferRef buffer_ref(llvm::StringRef(clone_buffer.data(), clone_buffer.size()), "clone_buffer");
Expand Down Expand Up @@ -392,7 +396,11 @@ void compile_llvm_module_to_assembly(llvm::Module &module, Internal::LLVMOStream
}

void compile_llvm_module_to_llvm_bitcode(llvm::Module &module, Internal::LLVMOStream& out) {
#if LLVM_VERSION >= 70
WriteBitcodeToFile(module, out);
#else
WriteBitcodeToFile(&module, out);
#endif
}

void compile_llvm_module_to_llvm_assembly(llvm::Module &module, Internal::LLVMOStream& out) {
Expand Down

0 comments on commit 46d8e9e

Please sign in to comment.