[flang] Distinguish between unanalyzed and error expressions
authorTim Keith <tkeith@nvidia.com>
Sat, 20 Apr 2019 00:14:50 +0000 (17:14 -0700)
committerTim Keith <tkeith@nvidia.com>
Sat, 20 Apr 2019 00:14:50 +0000 (17:14 -0700)
commit510671c8c1d1d93c39fab0edd3e1f8c14af4711d
tree1bdef9055829e2126f9bacb0bda53346633475f8
parentba60bd6c1cb933c08d5c35e0df9334fd6ace359d
[flang] Distinguish between unanalyzed and error expressions

When an Expr or Variable is analyzed, always fill in a GenericExprWrapper
for it. That now holds the result of expression analysis which is
std::nullopt when there is an error.

After the ExprChecker pass has finished, the typedExpr data member of
Variables and top-level Exprs should be filled in. Assert that is the
case when we access them.

Original-commit: flang-compiler/f18@192a4e08554b105c48fcd65e6f8ed4860e64f544
Reviewed-on: https://github.com/flang-compiler/f18/pull/424
Tree-same-pre-rewrite: false
flang/lib/FIR/afforestation.cc
flang/lib/evaluate/expression.h
flang/lib/semantics/expression.cc
flang/lib/semantics/tools.h