[all-commits] [llvm/llvm-project] ab9c4e: [flang][NFC] addSymbol/lookupSymbol clean-up

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Feb 7 00:25:38 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab9c4e9fff272dd88c92a2d2f3a2e5c66e07e6e2
      https://github.com/llvm/llvm-project/commit/ab9c4e9fff272dd88c92a2d2f3a2e5c66e07e6e2
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-02-07 (Tue, 07 Feb 2023)

  Changed paths:
    M flang/include/flang/Lower/AbstractConverter.h
    M flang/include/flang/Lower/ConvertVariable.h
    M flang/include/flang/Lower/SymbolMap.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Lower/HostAssociations.cpp
    M flang/lib/Lower/SymbolMap.cpp
    M flang/test/Lower/c-interoperability-c-pointer.f90
    M flang/test/Lower/call.f90

  Log Message:
  -----------
  [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




More information about the All-commits mailing list