[PATCH] D85686: [CUDA][HIP] Do not externalize implicit constant static variable

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 15:37:47 PDT 2020


yaxunl marked an inline comment as done.
yaxunl added inline comments.


================
Comment at: clang/lib/AST/ASTContext.cpp:11196
   return !getLangOpts().GPURelocatableDeviceCode &&
-         (D->hasAttr<CUDADeviceAttr>() || D->hasAttr<CUDAConstantAttr>()) &&
+         (D->hasAttr<CUDADeviceAttr>() ||
+          (D->hasAttr<CUDAConstantAttr>() &&
----------------
tra wrote:
> I'd include `__device__` vars into the `!IsImplicit` check. While we may not implicitly add the attribute now, for consistency sake they should be treated the same. 
will do when committing.


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

https://reviews.llvm.org/D85686



More information about the cfe-commits mailing list