This is an archive of the discontinued LLVM Phabricator instance.

[flang] Implement semantics for DEC STRUCTURE/RECORD
ClosedPublic

Authored by klausler on Jan 12 2022, 2:04 PM.

Details

Summary

Implements part of the legacy "DEC structures" feature from
VMS Fortran. STRUCTUREs are processed as if they were derived
types with SEQUENCE. DATA-like object entity initialization
is supported as well (e.g., INTEGER FOO/666/) since it was used
for default component initialization in structures. Anonymous
components (named %FILL) are also supported.

These features, and UNION/MAP, were already being parsed.
An omission in the collection of structure field names in the
case of nested structures with entity declarations was fixed
in the parser.

Structures are supported in modules, but this is mostly for
testing purposes. The names of fields in structures accessed
via USE association cannot appear with dot notation in client
code (at least not yet). DEC structures antedate Fortran 90,
so their actual use in applications should not involve modules.

This patch does not implement UNION/MAP, since that feature
would impose difficulties later in lowering them to MLIR types.
In the meantime, if they appear, semantics will issue a
"not yet implemented" error message.

Diff Detail

Event Timeline

klausler created this revision.Jan 12 2022, 2:04 PM
klausler requested review of this revision.Jan 12 2022, 2:04 PM
PeteSteinfeld accepted this revision.Jan 13 2022, 6:53 AM

All builds, tests, and looks good.

This revision is now accepted and ready to land.Jan 13 2022, 6:53 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2022, 1:17 PM