[all-commits] [llvm/llvm-project] 641ede: [flang] Improve initializer semantics, esp. for co...
Peter Klausler via All-commits
all-commits at lists.llvm.org
Mon Dec 7 14:41:05 PST 2020
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 641ede93efd664cc2e1d1788b195a80b50b36f66
https://github.com/llvm/llvm-project/commit/641ede93efd664cc2e1d1788b195a80b50b36f66
Author: peter klausler <pklausler at nvidia.com>
Date: 2020-12-07 (Mon, 07 Dec 2020)
Changed paths:
M flang/docs/Semantics.md
M flang/include/flang/Common/reference-counted.h
M flang/include/flang/Evaluate/characteristics.h
M flang/include/flang/Evaluate/check-expression.h
M flang/include/flang/Evaluate/common.h
M flang/include/flang/Evaluate/shape.h
M flang/include/flang/Evaluate/tools.h
M flang/include/flang/Evaluate/type.h
M flang/include/flang/Parser/message.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/characteristics.cpp
M flang/lib/Evaluate/check-expression.cpp
M flang/lib/Evaluate/fold-implementation.h
M flang/lib/Evaluate/fold-logical.cpp
M flang/lib/Evaluate/fold.cpp
M flang/lib/Evaluate/intrinsics.cpp
M flang/lib/Evaluate/shape.cpp
M flang/lib/Evaluate/tools.cpp
M flang/lib/Evaluate/type.cpp
M flang/lib/Parser/message.cpp
M flang/lib/Parser/parse-tree.cpp
M flang/lib/Semantics/check-call.cpp
M flang/lib/Semantics/check-declarations.cpp
M flang/lib/Semantics/check-declarations.h
M flang/lib/Semantics/check-do-forall.cpp
M flang/lib/Semantics/data-to-inits.cpp
M flang/lib/Semantics/expression.cpp
M flang/lib/Semantics/pointer-assignment.cpp
M flang/lib/Semantics/resolve-names.cpp
M flang/lib/Semantics/tools.cpp
M flang/lib/Semantics/type.cpp
M flang/test/Semantics/array-constr-values.f90
M flang/test/Semantics/data04.f90
M flang/test/Semantics/init01.f90
M flang/test/Semantics/resolve37.f90
M flang/test/Semantics/resolve44.f90
M flang/test/Semantics/resolve58.f90
M flang/test/Semantics/resolve69.f90
M flang/test/Semantics/structconst02.f90
M flang/tools/f18/f18.cpp
Log Message:
-----------
[flang] Improve initializer semantics, esp. for component default values
This patch plugs many holes in static initializer semantics, improves error
messages for default initial values and other component properties in
parameterized derived type instantiations, and cleans up several small
issues noticed during development. We now do proper scalar expansion,
folding, and type, rank, and shape conformance checking for component
default initializers in derived types and PDT instantiations.
The initial values of named constants are now guaranteed to have been folded
when installed in the symbol table, and are no longer folded or
scalar-expanded at each use in expression folding. Semantics documentation
was extended with information about the various kinds of initializations
in Fortran and when each of them are processed in the compiler.
Some necessary concomitant changes have bulked this patch out a bit:
* contextual messages attachments, which are now produced for parameterized
derived type instantiations so that the user can figure out which
instance caused a problem with a component, have been added as part
of ContextualMessages, and their implementation was debugged
* several APIs in evaluate::characteristics was changed so that a FoldingContext
is passed as an argument rather than just its intrinsic procedure table;
this affected client call sites in many files
* new tools in Evaluate/check-expression.cpp to determine when an Expr
actually is a single constant value and to validate a non-pointer
variable initializer or object component default value
* shape conformance checking has additional arguments that control
whether scalar expansion is allowed
* several now-unused functions and data members noticed and removed
* several crashes and bogus errors exposed by testing this new code
were fixed
* a -fdebug-stack-trace option to enable LLVM's stack tracing on
a crash, which might be useful in the future
TL;DR: Initialization processing does more and takes place at the right
times for all of the various kinds of things that can be initialized.
Differential Review: https://reviews.llvm.org/D92783
More information about the All-commits
mailing list