[Mesa-dev] [PATCH] clover: Fix build against clang SVN >= r301442
Michel Dänzer
michel at daenzer.net
Thu Apr 27 03:32:41 UTC 2017
From: Michel Dänzer <michel.daenzer at amd.com>
Hardcode the OpenCL InputKind in compat::set_lang_defaults.
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
src/gallium/state_trackers/clover/llvm/compat.hpp | 10 ++++++----
src/gallium/state_trackers/clover/llvm/invocation.cpp | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp b/src/gallium/state_trackers/clover/llvm/compat.hpp
index cee51b9dd1..ee8c2a78e4 100644
--- a/src/gallium/state_trackers/clover/llvm/compat.hpp
+++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
@@ -76,14 +76,16 @@ namespace clover {
inline void
set_lang_defaults(clang::CompilerInvocation &inv,
- clang::LangOptions &lopts, clang::InputKind ik,
+ clang::LangOptions &lopts,
const ::llvm::Triple &t,
clang::PreprocessorOptions &ppopts,
clang::LangStandard::Kind std) {
-#if HAVE_LLVM >= 0x0309
- inv.setLangDefaults(lopts, ik, t, ppopts, std);
+#if HAVE_LLVM >= 0x0500
+ inv.setLangDefaults(lopts, clang::InputKind::OpenCL, t, ppopts, std);
+#elif HAVE_LLVM >= 0x0309
+ inv.setLangDefaults(lopts, clang::IK_OpenCL, t, ppopts, std);
#else
- inv.setLangDefaults(lopts, ik, std);
+ inv.setLangDefaults(lopts, clang::IK_OpenCL, std);
#endif
}
diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index deebef5726..64c0ec4c23 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -126,7 +126,7 @@ namespace {
c->getDiagnosticOpts().ShowCarets = false;
compat::set_lang_defaults(c->getInvocation(), c->getLangOpts(),
- clang::IK_OpenCL, ::llvm::Triple(target.triple),
+ ::llvm::Triple(target.triple),
c->getPreprocessorOpts(),
clang::LangStandard::lang_opencl11);
--
2.11.0
More information about the mesa-dev
mailing list