[PATCH] D54258: [Clang] Fix pretty printing of CUDA address spaces

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 13 09:57:26 PST 2018


Anastasia added a comment.

In https://reviews.llvm.org/D54258#1296706, @richardmembarth wrote:

> CUDA maps `__shared__` internally also to `__attribute__((shared))`:
>
>   #define __annotate__(a) \
>           __attribute__((a))
>   #define __location__(a) \
>           __annotate__(a)
>   ...
>   #define __shared__ \
>           __location__(shared)
>
>
> My guess is that Clang does it just the same way and only converts to `LangAS::cuda_shared` for code generation in `GetGlobalVarAddressSpace`:
>  https://clang.llvm.org/doxygen/CodeGenModule_8cpp_source.html#l03305
>  In contrast, OpenCL uses keywords that are mapped directly to `LangAS::opencl_local` etc.


I agree with the change itself... but it's quite annoying that such things can't be tested. :(


Repository:
  rC Clang

https://reviews.llvm.org/D54258





More information about the cfe-commits mailing list