[llvm-branch-commits] [flang] [mlir] [flang][OpenMP][NFC] remove globals with mlir::StateStack (PR #144898)

Sergio Afonso via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jun 19 08:57:13 PDT 2025


================
@@ -2224,10 +2260,13 @@ genSectionsOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
               lower::pft::Evaluation &eval, mlir::Location loc,
               const ConstructQueue &queue,
               ConstructQueue::const_iterator item) {
-  assert(!sectionsStack.empty());
+  const parser::OpenMPSectionsConstruct *sectionsConstruct =
+      getSectionsConstructStackTop(converter);
+  assert(sectionsConstruct);
+
   const auto &sectionBlocks =
-      std::get<parser::OmpSectionBlocks>(sectionsStack.back()->t);
-  sectionsStack.pop_back();
+      std::get<parser::OmpSectionBlocks>(sectionsConstruct->t);
+  converter.getStateStack().stackPop();
----------------
skatrak wrote:

Nit: Wouldn't it be possible to let this call be handled by the same function that pushes the stack frame? We could potentially use `SaveStateStack` then.

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


More information about the llvm-branch-commits mailing list