[clang] [Clang][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 08:18:04 PDT 2024


================
@@ -21703,32 +21703,37 @@ const ValueDecl *SemaOpenMP::getOpenMPDeclareMapperVarName() const {
   return cast<DeclRefExpr>(DSAStack->getDeclareMapperVarRef())->getDecl();
 }
 
-OMPClause *SemaOpenMP::ActOnOpenMPNumTeamsClause(Expr *NumTeams,
+OMPClause *SemaOpenMP::ActOnOpenMPNumTeamsClause(ArrayRef<Expr *> VarList,
                                                  SourceLocation StartLoc,
                                                  SourceLocation LParenLoc,
                                                  SourceLocation EndLoc) {
-  Expr *ValExpr = NumTeams;
-  Stmt *HelperValStmt = nullptr;
-
-  // OpenMP [teams Constrcut, Restrictions]
-  // The num_teams expression must evaluate to a positive integer value.
-  if (!isNonNegativeIntegerValue(ValExpr, SemaRef, OMPC_num_teams,
-                                 /*StrictlyPositive=*/true))
+  if (VarList.empty())
----------------
alexey-bataev wrote:

Here no, you need to add a check in the whole directive processing function (check checkSimdlenSafelenSpecified and some other similar) 

https://github.com/llvm/llvm-project/pull/99732


More information about the cfe-commits mailing list