clover/llvm: Fix build against LLVM/Clang 4.0
authorAaron Watry <awatry@gmail.com>
Thu, 22 Mar 2018 01:21:51 +0000 (20:21 -0500)
committerAaron Watry <awatry@gmail.com>
Thu, 22 Mar 2018 02:03:23 +0000 (21:03 -0500)
The opencl 1.0 langstandard was renamed in 5.0+

v2: Move preprocessor check into compat.hpp

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/llvm/compat.hpp
src/gallium/state_trackers/clover/llvm/invocation.cpp

index 19528a0133f05d73ca2c8ca4481907eaf31ca089..2e070b2eefcfd57d55cb53dfd21a12d5bbae47c9 100644 (file)
@@ -89,8 +89,10 @@ namespace clover {
 
 #if HAVE_LLVM >= 0x0500
          const clang::InputKind ik_opencl = clang::InputKind::OpenCL;
+         const clang::LangStandard::Kind lang_opencl10 = clang::LangStandard::lang_opencl10;
 #else
          const clang::InputKind ik_opencl = clang::IK_OpenCL;
+         const clang::LangStandard::Kind lang_opencl10 = clang::LangStandard::lang_opencl;
 #endif
 
          inline void
index af78c2ae284a6bd3d50dc70dde7e178c87d67cb4..b2c64bc48f872ea2ca54289a66d15e6dec9f1bd7 100644 (file)
@@ -85,7 +85,7 @@ namespace {
     };
 
     const clc_version_lang_std cl_version_lang_stds[] = {
-       { 100, clang::LangStandard::lang_opencl10},
+       { 100, compat::lang_opencl10},
        { 110, clang::LangStandard::lang_opencl11},
        { 120, clang::LangStandard::lang_opencl12},
        { 200, clang::LangStandard::lang_opencl20},