tra accepted this revision.
tra added inline comments.
================
Comment at: clang/lib/Sema/SemaExpr.cpp:17145
};
- if (Var && Var->hasGlobalStorage() && !IsEmittedOnDeviceSide(Var)) {
- SemaRef.targetDiag(Loc, diag::err_ref_bad_target)
- << /*host*/ 2 << /*variable*/ 1 << Var << Target;
+ if (Var && Var->hasGlobalStorage()) {
+ if (!IsEmittedOnDeviceSide(Var)) {
----------------
Revisiting my comment from https://reviews.llvm.org/D102237#inline-967732
I think this can be combined with the `if (SemaRef.LangOpts.CUDA)` above.
Unless I'm missing something obvious, what we have now is
```
if (SemaRef.LangOpts.CUDA) {
<vars>
if (Var && Var->hasGlobalStorage()) {
}
}
```
You've mentioned that they can't be combined because of an `else`, but there's
no else in the `if (Var && Var->hasGlobalStorage()) ` as far as I can see, and
`<vars>` could be moved inside it.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102270/new/
https://reviews.llvm.org/D102270
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits