[PATCH] D91281: [CUDA][HIP] Diagnose reference of host variable
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 10:14:57 PST 2020
yaxunl marked an inline comment as done.
yaxunl added inline comments.
================
Comment at: clang/lib/Sema/SemaExpr.cpp:357
+ if (LangOpts.CUDAIsDevice) {
+ auto *FD = dyn_cast_or_null<FunctionDecl>(CurContext);
----------------
tra wrote:
> This could use a comment why we only check `D->H` references.
Just added a comment:
Reference of device global variables in host functions is
allowed through shadow variables therefore it is not diagnosed.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91281/new/
https://reviews.llvm.org/D91281
More information about the cfe-commits
mailing list