[flang] Make GenericAssignmentWrapper more like GenericExprWrapper
authorTim Keith <tkeith@nvidia.com>
Wed, 15 Jan 2020 01:39:29 +0000 (17:39 -0800)
committerTim Keith <tkeith@nvidia.com>
Wed, 22 Jan 2020 21:50:02 +0000 (13:50 -0800)
commit0ac2761f2c9ec1ce189ef9c4849a5edbac235b8a
treee47e3b85a627996ff9c68d4f525acd3aaa5e1684
parent8ad8bfb2a8abf914e4b0a0dd1c4f46b00c8f98a2
[flang] Make GenericAssignmentWrapper more like GenericExprWrapper

Have it wrap an optional Assignment so that we can distinguish between
unanalyzed and analyzed with error.

Change analysis of PointerAssignmentStmt to proceed with bounds even
if the DataRef or Expr has an error. Otherwise any bounds expressions
won't be analyzed in that case.

In GetExpr() and GetAssignment() if we get an internal error due to an
unanalyzed expression, dump the parse tree for the expression so we have
some context for the error. They should only be called after the
expression analysis phase. At that point, every expression and assignment
should be analyzed, though some may have resulted in errors(indicated by
returning `nullptr`).

Original-commit: flang-compiler/f18@3b865d7703f53099cd491ed1aa9b80b46fee9f58
Reviewed-on: https://github.com/flang-compiler/f18/pull/944
Tree-same-pre-rewrite: false
flang/lib/evaluate/expression.h
flang/lib/semantics/expression.cc
flang/lib/semantics/tools.cc
flang/lib/semantics/tools.h
flang/tools/f18/f18.cc