This is an archive of the discontinued LLVM Phabricator instance.

[flang] Handle dynamic and remotely scoped non-type-bound UDDTIO subroutines
ClosedPublic

Authored by klausler on Mar 21 2023, 2:59 PM.

Details

Summary

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.

Diff Detail

Event Timeline

klausler created this revision.Mar 21 2023, 2:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 2:59 PM
klausler requested review of this revision.Mar 21 2023, 2:59 PM
vdonaldson accepted this revision.Mar 21 2023, 7:04 PM
This revision is now accepted and ready to land.Mar 21 2023, 7:04 PM