================
@@ -5289,29 +5289,71 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind
DKind,
Diag(Tok, diag::err_modifier_expected_colon) << "fallback";
}
}
- } else if (Kind == OMPC_num_teams) {
- // Handle optional lower-bound modifier for num_teams clause.
- Data.ExtraModifier = OMPC_NUMTEAMS_unknown;
- TentativeParsingAction TPA(*this);
- SourceLocation TLoc = Tok.getLocation();
- ExprResult FirstExpr = ParseAssignmentExpression();
- if (FirstExpr.isInvalid()) {
- SkipUntil(tok::r_paren, tok::annot_pragma_openmp_end, StopBeforeMatch);
- Data.RLoc = Tok.getLocation();
- if (!T.consumeClose())
- Data.RLoc = T.getCloseLocation();
- TPA.Commit();
- return true;
+ } else if (Kind == OMPC_num_teams || Kind == OMPC_thread_limit) {
+ int Mod = 0;
+ // Handle optional dims and lower-bound modifiers for num_teams clause, and
+ // the optional dims modifier for thread_limit clause.
+ Data.ExtraModifierArray[0] = Data.ExtraModifierArray[1] =
+ Kind == OMPC_num_teams ? static_cast<int>(OMPC_NUMTEAMS_unknown)
+ : static_cast<int>(OMPC_THREADLIMIT_unknown);
+
+ // Lower-bound modifier is only accepted in num_teams.
+ bool CanParseLowerBoundModifier = (Kind == OMPC_num_teams);
+ if (!Tok.isAnnotation() && PP.getSpelling(Tok) == "dims" &&
----------------
alexey-bataev wrote:
`Tok.is(tok::identifier) && Tok.getIdentifierInfo()->isStr("dims")`
https://github.com/llvm/llvm-project/pull/206412
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits