[PATCH] D99905: [OPENMP51]Initial parsing/sema for adjust_args clause for 'declare variant'
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 4 12:11:52 PDT 2021
ABataev added inline comments.
================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:1406-1413
+ do {
+ if (parseOMPDeclareVariantAnyClause(Loc, TI, ParentTI, AdjustNothing,
+ AdjustNeedDevicePtr))
+ return;
+ // Skip ',' if any.
+ if (Tok.is(tok::comma))
+ ConsumeToken();
----------------
Maybe turn it into `while {}` form? What if the clause is early terminated?
================
Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:484-491
+ if (Attr.adjustArgsNothing_size()) {
+ for (Expr *E : Attr.adjustArgsNothing()) {
+ ExprResult ER = Subst(E);
+ if (ER.isInvalid())
+ continue;
+ NothingExprs.push_back(ER.get());
+ }
----------------
No need for outer `if`
================
Comment at: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:492-499
+ if (Attr.adjustArgsNeedDevicePtr_size()) {
+ for (Expr *E : Attr.adjustArgsNeedDevicePtr()) {
+ ExprResult ER = Subst(E);
+ if (ER.isInvalid())
+ continue;
+ NeedDevicePtrExprs.push_back(ER.get());
+ }
----------------
No need for outer `if`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99905/new/
https://reviews.llvm.org/D99905
More information about the llvm-commits
mailing list