[flang-commits] [flang] [Flang] Add partial support for lowering procedure pointer assignment. (PR #70461)

via flang-commits flang-commits at lists.llvm.org
Thu Nov 16 05:29:37 PST 2023


================
@@ -98,6 +99,12 @@ hlfir::EntityWithAttributes Fortran::lower::convertProcedureDesignatorToHLFIR(
     mlir::Location loc, Fortran::lower::AbstractConverter &converter,
     const Fortran::evaluate::ProcedureDesignator &proc,
     Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) {
+  const auto *sym = proc.GetSymbol();
+  if (sym)
----------------
jeanPerier wrote:

Can you also add a TODO for the sym case if `sym.GetUltimate().attrs().test(Fortran::semantics::Attr::INTRINSIC)`?

I had never stumble on that case, but semantics actually uses Symbols for Procedure pointers initial values that are unrestricted intrinsics.

e.g:
```
module m
  intrinsic :: cos
  procedure(cos), pointer :: p => cos
end module
```

Tries to init p with `cos_` instead of the compiler generated unrestricted intrinsic.

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


More information about the flang-commits mailing list