[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-02-02 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:7247-7250 + // CUDA/HIP: Function-scope static variables in device or global functions + // have implicit device or constant attribute. Function-scope static variables + // in host device functions have implic

[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 320644. yaxunl marked 6 inline comments as done. yaxunl added a comment. Revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95560/new/ https://reviews.llvm.org/D95560 Files: clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/C

[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:101 +// does that. +class CUDAStaticDeviceVarEmitter +: public StmtVisitor { tra wrote: > Nit. "This class does that" could be dropped. I'd

[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-01-27 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. > A static variable in device and global functions is supposed to have > implicit device attribute. Currently it does not. This causes incorrect > diagnostics about host variables accessed by device functions. Correct diagnostics sevice-side local static vars is a valid conc

[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-01-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Currently static variables are allowed in device, global, and host device functions. A static variable in device and global functions is supposed to have implicit device attribute. Currently it d