[clang] [llvm] Draft/wip/preview of using leaf constructs in clang (PR #84817)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 11 13:13:59 PDT 2024


================
@@ -2966,7 +2972,17 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective(
             getLangOpts().OpenMPIRBuilder)
           AssociatedStmt = Actions.ActOnOpenMPLoopnest(AssociatedStmt.get());
       }
-      AssociatedStmt = Actions.ActOnOpenMPRegionEnd(AssociatedStmt, Clauses);
+      if (!Leaves.empty()) {
+        size_t i = Leaves.size() - 1;
+        AssociatedStmt = Actions.ActOnOpenMPRegionEnd(
+            AssociatedStmt, Clauses, [&](StmtResult S) {
+              return Actions.ActOnOpenMPExecutableDirective(
+                  Leaves[i--], DirName, CancelRegion, Clauses, S.get(),
+                  Loc, EndLoc);
+            });
----------------
alexey-bataev wrote:

Can we somehow avoid callback here?

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


More information about the cfe-commits mailing list