[all-commits] [llvm/llvm-project] bfcd05: [flang][hlfir] Do not emit extra declare for dummy...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Oct 17 00:12:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bfcd05317d0fbe90474eda13a4dbf33c2cee4130
      https://github.com/llvm/llvm-project/commit/bfcd05317d0fbe90474eda13a4dbf33c2cee4130
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M flang/lib/Lower/Bridge.cpp
    A flang/test/Lower/HLFIR/convert-variable-block.f90

  Log Message:
  -----------
  [flang][hlfir] Do not emit extra declare for dummy used in BLOCK (#69184)

When a variable is used in a specification expression in a scope, it is
added to the list of variables that must be instantiated when lowering
the scope. When lowering a BLOCK, this caused instantiateVar to be
called again on all the host block variables appearing in block variable
specification expressions. This caused an extra declare to be emitted
for dummy inside block (for non dummy, instantiateVar is a no-op if the
symbol is already mapped).

Only call instantiateVar if the symbol is not mapped when lowering BLOCK
variables.




More information about the All-commits mailing list