[all-commits] [llvm/llvm-project] c14cf9: [flang] Implement semantics for DEC STRUCTURE/RECORD

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Jan 13 13:17:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c14cf92b5a1cb13a33786291604c24a42e51b8eb
      https://github.com/llvm/llvm-project/commit/c14cf92b5a1cb13a33786291604c24a42e51b8eb
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-01-13 (Thu, 13 Jan 2022)

  Changed paths:
    M flang/docs/Extensions.md
    M flang/include/flang/Common/unwrap.h
    M flang/include/flang/Parser/dump-parse-tree.h
    M flang/include/flang/Parser/parse-tree.h
    M flang/include/flang/Parser/tools.h
    M flang/include/flang/Parser/user-state.h
    M flang/include/flang/Semantics/expression.h
    M flang/include/flang/Semantics/semantics.h
    M flang/include/flang/Semantics/symbol.h
    M flang/lib/Evaluate/fold-designator.cpp
    M flang/lib/Parser/Fortran-parsers.cpp
    M flang/lib/Parser/unparse.cpp
    M flang/lib/Parser/user-state.cpp
    M flang/lib/Semantics/check-data.cpp
    M flang/lib/Semantics/check-data.h
    M flang/lib/Semantics/data-to-inits.cpp
    M flang/lib/Semantics/data-to-inits.h
    M flang/lib/Semantics/mod-file.cpp
    M flang/lib/Semantics/mod-file.h
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/runtime-type-info.cpp
    M flang/lib/Semantics/semantics.cpp
    M flang/lib/Semantics/type.cpp
    A flang/test/Semantics/modfile42.f90
    A flang/test/Semantics/struct01.f90
    M flang/test/Semantics/symbol15.f90

  Log Message:
  -----------
  [flang] Implement semantics for DEC STRUCTURE/RECORD

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.

Differential Revision: https://reviews.llvm.org/D117151




More information about the All-commits mailing list