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

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 09:18:53 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())
----------------
shiltian wrote:

So basically we can only check whether those values are valid but in terms of how many values it can allow, now it will have to defer to the `ActOnXXXDirective` function right?

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


More information about the cfe-commits mailing list