[Mesa-dev] [PATCH] clover: Fix compiling with LLVM >= r315871

Jan Vesely jan.vesely at rutgers.edu
Mon Oct 16 18:01:34 UTC 2017


On Mon, 2017-10-16 at 18:48 +0200, Vedran Miletić wrote:
> ---
>  src/gallium/state_trackers/clover/llvm/codegen/common.cpp | 5 +++--
>  src/gallium/state_trackers/clover/llvm/compat.hpp         | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> index 075183400a..8bb9e0e47a 100644
> --- a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
> @@ -128,8 +128,9 @@ namespace {
>                 const unsigned address_space =
>                    cast< ::llvm::PointerType>(actual_type)->getAddressSpace();
>  
> -               if (address_space == address_spaces[clang::LangAS::opencl_local
> -                                                   - compat::lang_as_offset]) {
> +               if (address_space == address_spaces[
> +                   static_cast<unsigned>(clang::LangAS::opencl_local) -
> +                   static_cast<unsigned>(compat::lang_as_offset)]) {

I think at this point it'd be nicer to have
compat::address_space_is_local or similar, but I'll let Francisco make
the final call.

Jan

>                    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 f8b56516d5..ef173ea56f 100644
> --- a/src/gallium/state_trackers/clover/llvm/compat.hpp
> +++ b/src/gallium/state_trackers/clover/llvm/compat.hpp
> @@ -70,7 +70,7 @@ namespace clover {
>  #endif
>  
>  #if HAVE_LLVM >= 0x0500
> -         const auto lang_as_offset = 0;
> +         const auto lang_as_offset = clang::LangAS::Default;
>           const clang::InputKind ik_opencl = clang::InputKind::OpenCL;
>  #else
>           const auto lang_as_offset = clang::LangAS::Offset;

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171016/c41aa8cf/attachment.sig>


More information about the mesa-dev mailing list