arsenm added inline comments.

================
Comment at: include/clang/Basic/TargetInfo.h:1157
+  /// language address space.
+  virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const {
+    return getLangASFromTargetAS(AS);
----------------
yaxunl wrote:
> 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).
This is necessary to insert the correct addrspacecast, otherwise the builtins 
CUDA test asserts. getLangASFromTargetAS returns the user specified addrspace


https://reviews.llvm.org/D47154



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to