[clang] [Clang][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 19 19:10:07 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:
@alexey-bataev Is there any approach here to check the existence of other clause of the current directive?
My goal here is, if `ompx_bare` clause exists, `num_teams` clause can accept multiple expressions; otherwise it should only accept one.
https://github.com/llvm/llvm-project/pull/99732
More information about the cfe-commits
mailing list