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

Richard Membarth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 13 02:25:49 PST 2018


richardmembarth added a comment.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D54258





More information about the cfe-commits mailing list