diff options
author | Jan Vesely <[email protected]> | 2017-09-15 20:34:42 -0400 |
---|---|---|
committer | Jan Vesely <[email protected]> | 2017-09-15 21:39:54 -0400 |
commit | 3115687f9b9830417c408228db2bc679e346bba6 (patch) | |
tree | 9bbcf1d798ee92ce8d5249bedefa95a80b3a15e2 | |
parent | 5ef3c2bcef1a9d82a915615ec21c56abbef47fef (diff) |
clover: Fix build after LLVM r313390
v2: pass llvm context reference instead of a pointer
Signed-off-by: Jan Vesely <[email protected]>
Reviewed-by: Francisco Jerez <[email protected]>
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/compat.hpp | 10 | ||||
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/invocation.cpp | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp b/src/gallium/state_trackers/clover/llvm/compat.hpp index b22ecfa6b2e..23b111d7104 100644 --- a/src/gallium/state_trackers/clover/llvm/compat.hpp +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp @@ -198,6 +198,16 @@ namespace clover { f(mod.getError().message()); #endif } + + template<typename T> void + set_diagnostic_handler(::llvm::LLVMContext &ctx, + T *diagnostic_handler, void *data) { +#if HAVE_LLVM >= 0x0600 + ctx.setDiagnosticHandlerCallBack(diagnostic_handler, data); +#else + ctx.setDiagnosticHandler(diagnostic_handler, data); +#endif + } } } } diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp index 6412377faab..a373df4eac6 100644 --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp @@ -89,7 +89,7 @@ namespace { create_context(std::string &r_log) { init_targets(); std::unique_ptr<LLVMContext> ctx { new LLVMContext }; - ctx->setDiagnosticHandler(diagnostic_handler, &r_log); + compat::set_diagnostic_handler(*ctx, diagnostic_handler, &r_log); return ctx; } |