[all-commits] [llvm/llvm-project] af0921: [Flang] Add partial support for lowering procedure...

Daniel Chen via All-commits all-commits at lists.llvm.org
Thu Nov 23 04:44:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: af09219edd87db860d1fc5a33dd49ecd31291699
      https://github.com/llvm/llvm-project/commit/af09219edd87db860d1fc5a33dd49ecd31291699
  Author: Daniel Chen <cdchen at ca.ibm.com>
  Date:   2023-11-23 (Thu, 23 Nov 2023)

  Changed paths:
    M flang/include/flang/Lower/BoxAnalyzer.h
    M flang/include/flang/Lower/CallInterface.h
    M flang/include/flang/Lower/ConvertProcedureDesignator.h
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/include/flang/Optimizer/Builder/HLFIRTools.h
    M flang/include/flang/Optimizer/HLFIR/HLFIRDialect.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/CallInterface.cpp
    M flang/lib/Lower/ConvertCall.cpp
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/ConvertExprToHLFIR.cpp
    M flang/lib/Lower/ConvertProcedureDesignator.cpp
    M flang/lib/Lower/ConvertType.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    A flang/test/Lower/HLFIR/procedure-pointer.f90

  Log Message:
  -----------
  [Flang] Add partial support for lowering procedure pointer assignment. (#70461)

**Scope of the PR:**
1. Lowering global and local procedure pointer declaration statement
with explicit or implicit interface. The explicit interface can be from
an interface block, a module procedure or an internal procedure.
2. Lowering procedure pointer assignment, where the target procedure
could be external, module or internal procedures.
3. Lowering reference to procedure pointers so that it works end to end.

**PR notes:**
1. The first commit of the PR does not include testing. I would like to
collect some comments first, which may alter the output. Once I confirm
the implementation, I will add some testing as a follow up commit to
this PR.
2. No special handling of the host-associated entities when an internal
procedure is the target of a procedure pointer assignment in this PR.

**Implementation notes:**
1. The implementation is using the HLFIR path.
2. Flang currently uses `getUntypedBoxProcType` to get the
`fir::BoxProcType` for `ProcedureDesignator` when getting the address of
a procedure in order to pass it as an actual argument. This PR inherits
the same design decision for procedure pointer as the `fir::StoreOp`
requires the same memory type.

Note: this commit is actually resubmitting the original commit from
PR #70461 that was reverted. See PR #73221.




More information about the All-commits mailing list