summaryrefslogtreecommitdiff
path: root/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/frontends/clover/llvm/codegen/bitcode.cpp')
-rw-r--r--src/gallium/frontends/clover/llvm/codegen/bitcode.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp b/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp
index 8ea3e57168d..568bdd993f5 100644
--- a/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp
+++ b/src/gallium/frontends/clover/llvm/codegen/bitcode.cpp
@@ -41,15 +41,11 @@
#include <map>
#include <llvm/Config/llvm-config.h>
-#if LLVM_VERSION_MAJOR < 4
-#include <llvm/Bitcode/ReaderWriter.h>
-#else
#include <llvm/Bitcode/BitcodeReader.h>
#include <llvm/Bitcode/BitcodeWriter.h>
-#endif
#include <llvm/Support/raw_ostream.h>
-using clover::module;
+using clover::binary;
using namespace clover::llvm;
namespace {
@@ -70,20 +66,20 @@ clover::llvm::print_module_bitcode(const ::llvm::Module &mod) {
return os.str();
}
-module
+binary
clover::llvm::build_module_library(const ::llvm::Module &mod,
- enum module::section::type section_type) {
- module m;
+ enum binary::section::type section_type) {
+ binary b;
const auto code = emit_code(mod);
- m.secs.emplace_back(0, section_type, code.size(), code);
- return m;
+ b.secs.emplace_back(0, section_type, code.size(), code);
+ return b;
}
std::unique_ptr< ::llvm::Module>
-clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
+clover::llvm::parse_module_library(const binary &b, ::llvm::LLVMContext &ctx,
std::string &r_log) {
auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
- as_string(m.secs[0].data), " "), ctx);
+ as_string(b.secs[0].data), " "), ctx);
if (::llvm::Error err = mod.takeError()) {
::llvm::handleAllErrors(std::move(err), [&](::llvm::ErrorInfoBase &eib) {