[PATCH] D47154: Try to make builtin address space declarations not useless

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 27 09:43:18 PDT 2018


yaxunl added inline comments.


================
Comment at: include/clang/Basic/TargetInfo.h:1157
+  /// language address space.
+  virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const {
+    return getLangASFromTargetAS(AS);
----------------
I think this function is not needed.

Although CUDA/HIP uses address spaces in codegen, but it does not use named address spaces in sema and AST. Named address space is not in the AST types of CUDA/HIP, therefore there is no point of mapping target address space back to language address space for CUDA/HIP.

CUDA/HIP should be just like other address-space-agnostic language and always use getLangASFromTargetAS(AS).


https://reviews.llvm.org/D47154





More information about the cfe-commits mailing list