[flang][NFC] addSymbol/lookupSymbol clean-up
authorJean Perier <jperier@nvidia.com>
Tue, 7 Feb 2023 08:22:47 +0000 (09:22 +0100)
committerJean Perier <jperier@nvidia.com>
Tue, 7 Feb 2023 08:23:09 +0000 (09:23 +0100)
commitab9c4e9fff272dd88c92a2d2f3a2e5c66e07e6e2
tree42216a7518adfdfa7798fc4ce74a63d8dd1df895
parentdda01632db12d3b11d8e2e21d73d438626cb0436
[flang][NFC] addSymbol/lookupSymbol clean-up

HLFIR requires mapping symbol to a single mlir::Value (produced
by a fir::FortranVariableOpInterface), while the current lowering
maps the value to a fir::ExtdendedValue.

So far, the HLFIR symbol query was a special one. Hence, all the code
directly using symMap.lookupSymbol and symMap.addSymbol did not work
with the lowering to HLFIR.

Refactor the code so that symbol lookup and add symbol go through
the converter in a centralize place that handles the HLFIR case
(translate fir::FortranVariableOpInterface to fir::ExtdendedValue
in lookups, and generate hlfir.declare when adding symbols).

In the refactoring, fir::FortranVariableOpInterface is added as
a symbolBox variant to avoid special casing all lookups (shallowLookup...).

Remove some unused SymbolBox member function instead of updating
them.

Differential Revision: https://reviews.llvm.org/D143395
flang/include/flang/Lower/AbstractConverter.h
flang/include/flang/Lower/ConvertVariable.h
flang/include/flang/Lower/SymbolMap.h
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/ConvertCall.cpp
flang/lib/Lower/ConvertExpr.cpp
flang/lib/Lower/ConvertVariable.cpp
flang/lib/Lower/HostAssociations.cpp
flang/lib/Lower/SymbolMap.cpp
flang/test/Lower/c-interoperability-c-pointer.f90
flang/test/Lower/call.f90