JonChesterfield added inline comments.

================
Comment at: clang/lib/AST/ASTContext.cpp:10068
+        isa<VarDecl>(D) && cast<VarDecl>(D)->isFileVarDecl() &&
+        cast<VarDecl>(D)->getStorageClass() == SC_Static) {
+      return GVA_StrongExternal;
----------------
yaxunl wrote:
> rjmccall wrote:
> > Are you sure this doesn't apply to e.g. local statics?  Can't you have 
> > kernel lambdas, or am I confusing HIP with another language?
> function-scope static var in a device function is only visible to the device 
> function. Host code cannot access it, therefore no need to externalize it.
This doesn't sound right. An inline function can return a pointer to a function 
scope static variable, e.g. to implement a singleton in a header file.  I think 
host code can then access said variable.


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

https://reviews.llvm.org/D80858



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to