[flang-commits] [flang] [flang][hlfir] Do not emit extra declare for dummy used in BLOCK (PR #69184)

via flang-commits flang-commits at lists.llvm.org
Mon Oct 16 09:27:53 PDT 2023


vdonaldson wrote:

Would it be possible to do this earlier, something like this:

```
+++ b/flang/lib/Lower/PFTBuilder.cpp
@@ -1474,10 +1474,12 @@ private:
   // other symbols.
   int analyze(const semantics::Symbol &sym) {
     auto done = seen.insert(&sym);
     if (!done.second)
       return 0;
+    if (lookupSymbol(sym))
+      return 0; // sym is from a containing scope
     LLVM_DEBUG(llvm::dbgs() << "analyze symbol " << &sym << " in <"
                             << &sym.owner() << ">: " << sym << '\n');
     const bool isProcedurePointerOrDummy =
         semantics::IsProcedurePointer(sym) ||
         (semantics::IsProcedure(sym) && IsDummy(sym));
```



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


More information about the flang-commits mailing list