[flang-commits] [PATCH] D143395: [flang][NFC] addSymbol/lookupSymbol clean-up

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Feb 6 06:58:21 PST 2023


jeanPerier created this revision.
jeanPerier added a reviewer: clementval.
jeanPerier added a project: Flang.
Herald added subscribers: bzcheeseman, sunshaoce, mehdi_amini, rriddle, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.
Herald added a subscriber: stephenneuendorffer.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143395

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143395.495112.patch
Type: text/x-patch
Size: 40721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230206/c6f9669e/attachment-0001.bin>


More information about the flang-commits mailing list