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

Daniel Chen via All-commits all-commits at lists.llvm.org
Wed Nov 22 08:51:25 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e07fec10ac208c2868a24c5c0be88e45778b297e
      https://github.com/llvm/llvm-project/commit/e07fec10ac208c2868a24c5c0be88e45778b297e
  Author: Daniel Chen <cdchen at ca.ibm.com>
  Date:   2023-11-22 (Wed, 22 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.




More information about the All-commits mailing list