[flang] optionally lower scalar and explicit shape with fir.declare
authorJean Perier <jperier@nvidia.com>
Thu, 20 Oct 2022 08:30:42 +0000 (10:30 +0200)
committerJean Perier <jperier@nvidia.com>
Thu, 20 Oct 2022 08:31:12 +0000 (10:31 +0200)
commitca0a0bf9638c9705862ef2684aba192376c7d7cb
tree4c4e9f2b32ff2c987f7dcdf4abeb0d3a97321d69
parentc852174a4935debc6d724dd057c4955678e12117
[flang] optionally lower scalar and explicit shape with fir.declare

Lower scalar and explicit shape arrays to fir.declare under the -hlfir option.
Update the SymMap so that it can hold fir::FortranVariableInterface.

The plan is to go towards a SymMap that only contains fir::FortranVariableInterface
once current expression lowering can be replaced. This should make the SymMap lighter
than it is today (SymBox/ExtendedValue are above 256 bytes).

Assumed shape, allocatable and pointer are left TODOs for now. Anything with a
specification expression that is not a constant expression will only be able to
be lowered when the HLFIR expression lowering skeleton is added.

Differential Revision: https://reviews.llvm.org/D136252
flang/include/flang/Lower/SymbolMap.h
flang/include/flang/Optimizer/Builder/FIRBuilder.h
flang/lib/Lower/ConvertVariable.cpp
flang/lib/Lower/SymbolMap.cpp
flang/lib/Optimizer/Builder/FIRBuilder.cpp
flang/test/Lower/HLFIR/convert-variable.f90 [new file with mode: 0644]
flang/test/Lower/HLFIR/expr-addr.f90