[flang-commits] [flang] [flang] Lowering changes for assigning dummy_scope to hlfir.declare. (PR #90989)

via flang-commits flang-commits at lists.llvm.org
Mon May 6 02:02:28 PDT 2024


================
@@ -5375,6 +5400,23 @@ class FirConverter : public Fortran::lower::AbstractConverter {
                                         globalOmpRequiresSymbol);
   }
 
+  /// Record fir.dummy_scope operation for this function.
+  /// It will be used to set dummy_scope operand of the hlfir.declare
+  /// operations.
+  void setDummyArgsScope(mlir::Value val) {
+    assert(!dummyArgsScope && val);
+    dummyArgsScope = val;
+  }
+
+  /// Record the given symbol as a dummy argument of this function.
+  void registerDummySymbol(Fortran::semantics::SymbolRef symRef) {
+    auto *sym = symRef->HasLocalLocality() ? &*symRef : &symRef->GetUltimate();
----------------
jeanPerier wrote:

Are there cases where a dummy symbol is not already the ultimate one at the beginning of the procedure scope?
Do you have an example where this line makes a difference compared to `*sym = &*symRef`. It does not seems incorrect, I just want to understand the rational.

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


More information about the flang-commits mailing list