[flang-commits] [PATCH] D146571: [flang] Handle dynamic and remotely scoped non-type-bound UDDTIO subroutines

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Mar 21 14:59:44 PDT 2023


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added subscribers: sunshaoce, jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

The present I/O infrastructure for user-defined derived type I/O
subroutines works fine for type-bound I/O generic bindings.  It also works
for explicit INTERFACE blocks and GENERIC statements that define
UDDIO subroutines in the same scope as the definition of the derived type,
so long as the specific procedures in those bindings are module procedures
or external procedures.

For non-type-bound UDDTIO specific procedures that are dummy procedures,   
thunks of inner procedures, or procedure pointers, or that are defined with
interfaces or GENERIC outside the scope of the definition of the derived
type, a new runtime I/O API is needed so that lowering can generate  
a call that supplies the appropriate procedure as well as the defined
type instance.

This patch specifies and implements this new runtime API and provides 
utility routines for lowering to use to determine whether it should be
called for any particular OutputItem or InputItem in the parse tree.


https://reviews.llvm.org/D146571

Files:
  flang/include/flang/Runtime/io-api.h
  flang/include/flang/Semantics/tools.h
  flang/lib/Semantics/check-declarations.cpp
  flang/lib/Semantics/tools.cpp
  flang/runtime/io-api.cpp
  flang/runtime/type-info.h
  flang/test/Semantics/generic05.F90
  flang/test/Semantics/io11.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146571.507136.patch
Type: text/x-patch
Size: 18515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230321/f6af5246/attachment-0001.bin>


More information about the flang-commits mailing list