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

via flang-commits flang-commits at lists.llvm.org
Wed Nov 8 10:30:23 PST 2023


================
@@ -3224,8 +3224,13 @@ class FirConverter : public Fortran::lower::AbstractConverter {
       mlir::Location loc, const Fortran::evaluate::Assignment &assign,
       const Fortran::evaluate::Assignment::BoundsSpec &lbExprs) {
     Fortran::lower::StatementContext stmtCtx;
-    if (Fortran::evaluate::IsProcedure(assign.rhs))
-      TODO(loc, "procedure pointer assignment");
+
+    if (Fortran::evaluate::IsProcedure(assign.rhs)) {
+      auto lhs{fir::getBase(genExprAddr(assign.lhs, stmtCtx, &loc))};
+      auto rhs{fir::getBase(genExprAddr(assign.rhs, stmtCtx, &loc))};
----------------
jeanPerier wrote:

Thanks for the update! No one is working on this TODO (quite frankly, I thought it would not be hit, it skipped my mind that functions returning procedure pointers are not implemented as evaluate::Function<T>). I suggest rephrasing it to "lowering function references that return procedure pointers" and not try to implement it in this PR.

I think you have enough content for a first patch and that functions returning procedure pointers can be dealt in another patch. The main thing now is to ensure that it is covering everything case for the code path where the TODO have been removed, and if not, to add more narrow TODOs for the leftover.

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


More information about the flang-commits mailing list