[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 13:50:33 PST 2021


tra added inline comments.


================
Comment at: clang/lib/AST/ASTContext.cpp:11437-11443
+  return ((!getLangOpts().GPURelocatableDeviceCode &&
+           ((D->hasAttr<CUDADeviceAttr>() &&
+             !D->getAttr<CUDADeviceAttr>()->isImplicit()) ||
+            (D->hasAttr<CUDAConstantAttr>() &&
+             !D->getAttr<CUDAConstantAttr>()->isImplicit()))) ||
           D->hasAttr<HIPManagedAttr>()) &&
          isa<VarDecl>(D) && cast<VarDecl>(D)->getStorageClass() == SC_Static;
----------------
tra wrote:
> yaxunl wrote:
> > tra wrote:
> > > I can't parse it. :-( Perhaps we can split it.
> > revised
> I still can't read it. way too many nested operands to logical operators...
> 
> I was thinking of extracting parts of the equation into early returns or intermediate variables.
> 
Thank you for refactoring this. Now it's soo much easier to see what's going on.


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

https://reviews.llvm.org/D95901



More information about the cfe-commits mailing list