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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 13:51:12 PDT 2020


tra accepted this revision.
tra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/AST/ASTContext.cpp:11196
   return !getLangOpts().GPURelocatableDeviceCode &&
-         (D->hasAttr<CUDADeviceAttr>() || D->hasAttr<CUDAConstantAttr>()) &&
+         (D->hasAttr<CUDADeviceAttr>() ||
+          (D->hasAttr<CUDAConstantAttr>() &&
----------------
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. 


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

https://reviews.llvm.org/D85686



More information about the cfe-commits mailing list