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

Johannes Doerfert via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 4 09:55:48 PDT 2024


================
@@ -11357,8 +11358,13 @@ void OMPClauseReader::VisitOMPAllocateClause(OMPAllocateClause *C) {
 
 void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
   VisitOMPClauseWithPreInit(C);
-  C->setNumTeams(Record.readSubExpr());
   C->setLParenLoc(Record.readSourceLocation());
+  unsigned NumVars = C->varlist_size();
+  SmallVector<Expr *, 16> Vars;
+  Vars.reserve(NumVars);
+  for ([[maybe_unused]] unsigned I : llvm::seq<unsigned>(NumVars))
----------------
jdoerfert wrote:

Does this work:
```
 for (auto _ : llvm::seq<unsigned>(NumVars))
```

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


More information about the cfe-commits mailing list