[flang-commits] [flang] [llvm] [Flang][OpenMP] Defer descriptor mapping for assumed dummy argument types (PR #154349)

via flang-commits flang-commits at lists.llvm.org
Fri Aug 22 18:27:24 PDT 2025


================
@@ -75,6 +75,38 @@ class MapInfoFinalizationPass
   ///      |                  |
   std::map<mlir::Operation *, mlir::Value> localBoxAllocas;
 
+  // List of deferrable descriptors to process at the end of
+  // the pass.
+  llvm::SmallVector<mlir::Operation *> deferrableDesc;
+
+  // Check if the declaration operation we have refers to a dummy
+  // function argument.
+  bool isDummyArgument(mlir::Operation *op) {
+    if (auto declareOp = mlir::dyn_cast<hlfir::DeclareOp>(op))
+      if (auto dummyScope = declareOp.getDummyScope())
+        return true;
+    return false;
+  }
+
+  // Relevant for OpenMP < 5.2, where attach semantics and rules don't exist.
+  // As descriptors were an unspoken implementation detail in these versions
+  // there's certain cases where the user (and the compiler implementation)
----------------
agozillon wrote:

I'll try to describe it :-) 

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


More information about the flang-commits mailing list