[flang-commits] [flang] [Flang][OpenMP] Update declare mapper lookup via use-module (PR #163860)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Tue Oct 28 14:18:45 PDT 2025


================
@@ -447,6 +447,13 @@ class FirConverter : public Fortran::lower::AbstractConverter {
       }
     });
 
+    // Ensure imported OpenMP declare mappers are materialized at module
+    // scope before lowering any constructs that may reference them.
+    createBuilderOutsideOfFuncOpAndDo([&]() {
+      Fortran::lower::materializeOpenMPDeclareMappers(
+          *this, bridge.getSemanticsContext());
+    });
+
----------------
kiranchandramohan wrote:

Does the `createBuilderOutsideOfFuncOpAndDo` function above this visit all the top level OpenMP directives? if so is it possible to move this there and just create the Declare Mapper operation while visiting OpenMP directives?

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


More information about the flang-commits mailing list