[clang] [OpenMP][Clang] Parsing support for num_teams lower bound (PR #180608)
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 13 05:33:13 PST 2026
================
@@ -5080,6 +5080,54 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind,
Diag(Tok, diag::err_modifier_expected_colon) << "fallback";
}
}
+ } // Handle num_teams clause with optional lower-bound:upper-bound syntax
+ if (Kind == OMPC_num_teams && !Tok.is(tok::r_paren) &&
+ !Tok.is(tok::annot_pragma_openmp_end)) {
+ // Look ahead to detect top-level colon
+ TentativeParsingAction TPA(*this);
+ bool HasColon = false;
+ int Depth = 0;
+
+ while (!Tok.is(tok::r_paren) && !Tok.is(tok::annot_pragma_openmp_end)) {
+ if (Tok.isOneOf(tok::l_paren, tok::l_square))
----------------
alexey-bataev wrote:
Shall tok::l_square be allowed? Also, add tests with multi-level parens (matching and non-matching)
https://github.com/llvm/llvm-project/pull/180608
More information about the cfe-commits
mailing list