llvm-project/flang/lib
Jean Perier 92d27b969a [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
2021-03-16 10:27:45 +01:00
..
Common [flang] Use the Flang cmake-functions to add targets. 2020-04-16 15:51:30 +01:00
Decimal [flang] Readability improvement in binary->decimal conversion 2020-10-01 15:49:27 -07:00
Evaluate [flang] Ensure pointer function results are acceptable variables 2021-03-12 16:04:36 -08:00
Frontend [flang][driver] Add -fdebug-module-writer option 2021-03-11 08:04:37 -05:00
FrontendTool [flang][driver] Add `-fdebug-dump-parsing-log` 2021-03-10 12:09:16 +00:00
Lower [flang][fir] Upstream the pre-FIR tree changes. 2021-03-10 07:45:58 -08:00
Optimizer [mlir][StorageUniquer] Properly call the destructor on non-trivially destructible storage instances 2021-03-11 11:35:32 -08:00
Parser [flang] Save AllocateObject and PointerObject analyzed expression 2021-03-16 10:27:45 +01:00
Semantics [flang] Save AllocateObject and PointerObject analyzed expression 2021-03-16 10:27:45 +01:00
CMakeLists.txt [flang] Remove `LINK_WITH_FIR` cmake switch 2021-02-11 22:52:13 +05:30