[all-commits] [llvm/llvm-project] 92d27b: [flang] Save AllocateObject and PointerObject anal...
jeanPerier via All-commits
all-commits at lists.llvm.org
Tue Mar 16 02:30:07 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 92d27b969ae16bab23d2ccb1be2c350a26739bd0
https://github.com/llvm/llvm-project/commit/92d27b969ae16bab23d2ccb1be2c350a26739bd0
Author: Jean Perier <jperier at nvidia.com>
Date: 2021-03-16 (Tue, 16 Mar 2021)
Changed paths:
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/Semantics/expression.h
M flang/include/flang/Semantics/tools.h
M flang/lib/Parser/unparse.cpp
M flang/lib/Semantics/check-deallocate.cpp
M flang/lib/Semantics/check-nullify.cpp
M flang/lib/Semantics/expression.cpp
M flang/lib/Semantics/tools.cpp
Log Message:
-----------
[flang] Save AllocateObject and PointerObject analyzed expression
`parser::AllocateObject` and `parser::PointerObject` can be represented
as typed expressions once analyzed. This simplifies the work for parse-tree
consumers that work with typed expressions to deal with allocatable and
pointer objects such as lowering.
This change also makes it easier to add typedExpr in the future by
automatically handling nodes that have this member when possible.
Changes:
- Add a `mutable TypedExpr typedExpr` field to `parser::PointerObject` and `parser::AllocateObject`.
- Add a `parser::HasTypedExpr<T>` helper to better share code relating to typedExpr in the parse tree.
- Add hooks in `semantics::ExprChecker` for AllocateObject and PointerObject nodes, and use
ExprOrVariable on it to analyze and set the tyedExpr field during
expression analysis. This required adding overloads for `AssumedTypeDummy`.
- Update check-nullify.cpp and check-deallocate.cpp to not re-analyze the StructureComponent but to
use the typedExpr field instead.
- Update dump/unparse to use HasTypedExpr and use the typedExpr when there is one.
Differential Revision: https://reviews.llvm.org/D98256
More information about the All-commits
mailing list