summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/llvm
diff options
context:
space:
mode:
authorVedran Miletić <[email protected]>2016-11-14 12:17:42 +0100
committerTom Stellard <[email protected]>2016-11-14 15:50:29 +0000
commit8e430ff8b060b4e8e922bae24b3c57837da6ea77 (patch)
treec17978e52aeea7727560441c0f1a109e099499b8 /src/gallium/state_trackers/clover/llvm
parentc8a51fa75d2642d71ac23a04f37f570613ac9a87 (diff)
clover: adapt to new error API since LLVM r286752
Tested-by: Dieter Nützel <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/llvm')
-rw-r--r--src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
index 8e89a49a9c0..5dcc4f8a48c 100644
--- a/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
+++ b/src/gallium/state_trackers/clover/llvm/codegen/bitcode.cpp
@@ -98,8 +98,14 @@ clover::llvm::parse_module_library(const module &m, ::llvm::LLVMContext &ctx,
std::string &r_log) {
auto mod = ::llvm::parseBitcodeFile(::llvm::MemoryBufferRef(
as_string(m.secs[0].data), " "), ctx);
- if (!mod)
- fail(r_log, error(CL_INVALID_PROGRAM), mod.getError().message());
+
+ if (::llvm::Error err = mod.takeError()) {
+ std::string msg;
+ ::llvm::handleAllErrors(std::move(err), [&](::llvm::ErrorInfoBase &EIB) {
+ msg = EIB.message();
+ fail(r_log, error(CL_INVALID_PROGRAM), msg.c_str());
+ });
+ }
return std::unique_ptr<::llvm::Module>(std::move(*mod));
}