[flang-commits] [flang] [flang][hlfir] Alias analysis for host associated accesses. (PR #65919)

via flang-commits flang-commits at lists.llvm.org
Mon Sep 11 00:53:46 PDT 2023


================
@@ -73,13 +73,11 @@ static void bindCapturedSymbol(const Fortran::semantics::Symbol &sym,
                                fir::ExtendedValue val,
                                Fortran::lower::AbstractConverter &converter,
                                Fortran::lower::SymMap &symMap) {
-  if (converter.getLoweringOptions().getLowerToHighLevelFIR()) {
-    // TODO: add an indication that this is a host variable in the declare to
-    // allow alias analysis to detect this case.
+  converter.addHostAssocSymbol(&sym);
+  if (converter.getLoweringOptions().getLowerToHighLevelFIR())
     Fortran::lower::genDeclareSymbol(converter, symMap, sym, val);
----------------
jeanPerier wrote:

Have you consider adding and passing a boolean flag to genDeclareSymbol instead of using a denseset state in the bridge?
Maybe this could be a `fir::FortranVariableFlagsEnum extraFlags = fir::FortranVariableFlagsEnum::None` argument to be more generic.

https://github.com/llvm/llvm-project/pull/65919


More information about the flang-commits mailing list