[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
Loading
Please sign in to comment