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

via flang-commits flang-commits at lists.llvm.org
Mon Nov 13 02:17:44 PST 2023


================
@@ -50,5 +55,11 @@ hlfir::EntityWithAttributes convertProcedureDesignatorToHLFIR(
     const Fortran::evaluate::ProcedureDesignator &proc,
     Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx);
 
+/// Generate initialization for procedure pointer to procedure target.
+mlir::Value
+convertProcedureDesignatorToAddress(Fortran::lower::AbstractConverter &,
+                                    mlir::Location, mlir::Type boxType,
+                                    Fortran::lower::StatementContext &stmtCtx,
+                                    const Fortran::semantics::Symbol *sym);
----------------
jeanPerier wrote:

Few nits:
- If the symbol cannot be null in here, better a reference.
- Initializers cannot handle cleanups (hlfir.destroy...), so the StatementContext can be local to the function instead of being an argument.
- I would call this `convertProcedureDesignatorInitialTarget` to avoid people reading the comment too fast thinking this is OK to call this outside of the global initialization context.

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


More information about the flang-commits mailing list