diff options
author | Michel Dänzer <[email protected]> | 2017-04-12 17:17:34 +0900 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2017-04-13 12:51:24 +0900 |
commit | a981e68c26dc4079a335101da0033185030207f6 (patch) | |
tree | 6d45ea57ea41d4ac8fa24d595eece793695b5166 /src/gallium/state_trackers/clover | |
parent | 46f49d6fdcb9772fcc7ff3e533646b1b44c5adb9 (diff) |
clover: Fix build against clang SVN >= r299965
clang::LangAS::Offset is gone, the behaviour is as if it was 0.
v2: Introduce and use clover::llvm::compat::lang_as_offset (Francisco
Jerez)
Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover')
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/codegen/common.cpp | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/clover/llvm/compat.hpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp index 13ccd591c11..3b0014d8797 100644 --- a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp +++ b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp @@ -129,7 +129,7 @@ namespace { cast<::llvm::PointerType>(actual_type)->getAddressSpace(); if (address_space == address_spaces[clang::LangAS::opencl_local - - clang::LangAS::Offset]) { + - compat::lang_as_offset]) { args.emplace_back(module::argument::local, arg_api_size, target_size, target_align, module::argument::zero_ext); diff --git a/src/gallium/state_trackers/clover/llvm/compat.hpp b/src/gallium/state_trackers/clover/llvm/compat.hpp index 906367b3146..67d2d0fd546 100644 --- a/src/gallium/state_trackers/clover/llvm/compat.hpp +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp @@ -67,6 +67,12 @@ namespace clover { typedef ::llvm::TargetLibraryInfo target_library_info; #endif +#if HAVE_LLVM >= 0x0500 + const auto lang_as_offset = 0; +#else + const auto lang_as_offset = clang::LangAS::Offset; +#endif + inline void set_lang_defaults(clang::CompilerInvocation &inv, clang::LangOptions &lopts, clang::InputKind ik, |