[Mesa-dev] [PATCH] clover: Fix build against clang SVN >= r301442
Mike Lothian
mike at fireburn.co.uk
Thu Apr 27 06:13:23 UTC 2017
Tested-and-reviewed-by: Mike Lothian <mike at fireburn.co.uk>
On Thu, 27 Apr 2017 at 04:33 Michel Dänzer <michel at daenzer.net> wrote:
> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170427/8eb4f313/attachment.html>
More information about the mesa-dev
mailing list