[flang] Runtime implementation for default derived type formatted I/O
authorpeter klausler <pklausler@nvidia.com>
Thu, 17 Jun 2021 20:13:19 +0000 (13:13 -0700)
committerpeter klausler <pklausler@nvidia.com>
Fri, 18 Jun 2021 17:30:28 +0000 (10:30 -0700)
commit79caf69cc08a72022f968020eab486b698fd4178
treea9780adc5ecf149fdc8f0632b57945f8d38b7ce1
parentf2c009dbcfd11fd1e8941513dcf49fffe43565a1
[flang] Runtime implementation for default derived type formatted I/O

This is *not* user-defined derived type I/O, but rather Fortran's
built-in capabilities for using derived type data in I/O lists
and NAMELIST groups.

This feature depends on having the derived type description tables
that are created by Semantics available, passed through compilation
as initialized static objects to which pointers can be targeted
in the descriptors of I/O list items and NAMELIST groups.

NAMELIST processing now handles component references on input
(e.g., "&GROUP x%component = 123 /").

The C++ perspectives of the derived type information records
were transformed into proper classes when it was necessary to add
member functions to them.

The code in Semantics that generates derived type information
was changed to emit derived type components in component order,
not alphabetic order.

Differential Revision: https://reviews.llvm.org/D104485
13 files changed:
flang/include/flang/Semantics/runtime-type-info.h
flang/lib/Semantics/runtime-type-info.cpp
flang/runtime/CMakeLists.txt
flang/runtime/copy.cpp
flang/runtime/derived.cpp
flang/runtime/descriptor-io.h
flang/runtime/descriptor.cpp
flang/runtime/descriptor.h
flang/runtime/namelist.cpp
flang/runtime/tools.h
flang/runtime/type-info.cpp [new file with mode: 0644]
flang/runtime/type-info.h
flang/test/Semantics/typeinfo01.f90