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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 12:47:29 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;
----------------
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.



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

https://reviews.llvm.org/D95901



More information about the cfe-commits mailing list