[PATCH] D89909: [SYCL] Implement SYCL address space attributes handling

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 1 07:50:47 PST 2021


bader added a subscriber: aaron.ballman.
bader added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9996
+  if (CGM.isTypeConstant(D->getType(), false)) {
+    if (auto ConstAS = CGM.getTarget().getConstantAddressSpace())
+      return ConstAS.getValue();
----------------
@aaron.ballman, suggests we call out `auto` here.

I took this code from [[ https://github.com/intel/llvm/blob/sycl/clang/lib/CodeGen/TargetInfo.cpp#L9089-L9091 | AMDGPUTargetCodeGenInfo::getGlobalVarAddressSpace]]. 

I also found a few other places where `getConstantAddressSpace` is called and authors use `auto`: [[ https://github.com/llvm/llvm-project/blob/bb9eb198298099742c823dce11c5edacc9c48d4e/clang/lib/CodeGen/CodeGenModule.cpp#L4053 | CodeGenModule::getStringLiteralAddressSpace ]] [[ https://github.com/llvm/llvm-project/blob/bb9eb198298099742c823dce11c5edacc9c48d4e/clang/lib/CodeGen/CodeGenModule.cpp#L4071 | castStringLiteralToDefaultAddressSpace ]] and [[ https://github.com/llvm/llvm-project/blob/55488bd3cd1a468941e26ad4cf94f2bad887fc02/clang/lib/CodeGen/CGExpr.cpp#L405 | createReferenceTemporary ]]. 

@rjmccall, should I update all these instances? I can create an NFC patch for changes outside of this patch and push it before this change to the style consistent across the code base.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89909/new/

https://reviews.llvm.org/D89909



More information about the cfe-commits mailing list