[all-commits] [llvm/llvm-project] d60a02: [flang] Include default component initialization i...
Peter Klausler via All-commits
all-commits at lists.llvm.org
Wed Sep 1 09:40:54 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d60a02201d96ed5311404991186d827869d7ac8b
https://github.com/llvm/llvm-project/commit/d60a02201d96ed5311404991186d827869d7ac8b
Author: peter klausler <pklausler at nvidia.com>
Date: 2021-09-01 (Wed, 01 Sep 2021)
Changed paths:
M flang/include/flang/Evaluate/initial-image.h
M flang/include/flang/Semantics/scope.h
M flang/include/flang/Semantics/symbol.h
M flang/include/flang/Semantics/tools.h
M flang/lib/Evaluate/initial-image.cpp
M flang/lib/Semantics/check-declarations.cpp
M flang/lib/Semantics/compute-offsets.cpp
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/resolve-names.cpp
M flang/lib/Semantics/runtime-type-info.cpp
M flang/lib/Semantics/symbol.cpp
M flang/lib/Semantics/tools.cpp
M flang/lib/Semantics/type.cpp
A flang/test/Semantics/data12.f90
A flang/test/Semantics/data13.f90
M flang/test/Semantics/typeinfo01.f90
Log Message:
-----------
[flang] Include default component initialization in static initializers
The combined initializers constructed from DATA statements and explicit
static initialization in declarations needs to include derived type
component default initializations, overriding those default values
without complaint with values from explicit DATA statement or declaration
initializations when they overlap. This also has to work for objects
with storage association due to EQUIVALENCE. When storage association causes
default component initializations to overlap, emit errors if and only
if the values differ (See Fortran 2018 subclause 19.5.3, esp. paragraph
10).
The f18 front-end has a module that analyzes and converts DATA statements
into equivalent static initializers for objects. For storage-associated
objects, compiler-generated objects are created that overlay the entire
association and fill it with a combined initializer. This "data-to-inits"
module already exists, and this patch is essentially extension and
clean-up of its machinery to complete the job.
Also: emit EQUIVALENCE to module files; mark compiler-created symbols
and *don't* emit those to module files; check non-static EQUIVALENCE
sets for conflicting default component initializations, so lowering
doesn't have to check them or emit diagnostics.
Differential Revision: https://reviews.llvm.org/D109022
More information about the All-commits
mailing list