[flang] Include analyzed exprs in parse tree dump
authorTim Keith <tkeith@nvidia.com>
Wed, 18 Dec 2019 23:36:14 +0000 (15:36 -0800)
committerTim Keith <tkeith@nvidia.com>
Thu, 19 Dec 2019 00:29:08 +0000 (16:29 -0800)
commit37de6803e3e07d8ca352e77a484ed2627906af8b
tree1adc77161491efa743ba58517dd9576e93254201
parent47f6ebda6135602d4bda7653370104847c553593
[flang] Include analyzed exprs in parse tree dump

When dumping the parse tree, if there are analyzed expressions,
assignments, or call statements, include the Fortran form of those
in the dump.

This uses the same `AnalyzedObjectsAsFortran` object that unparsing
does so it applies to the same nodes.

We already do something like this for `Name` nodes as well as some
predefined types, so abstract it into an `AsFortran` function which
returns the Fortran source for a node that is to be included in the
dump.

Original-commit: flang-compiler/f18@823b044d2a009f43fe5ce15755a8ae23f70dfed8
Reviewed-on: https://github.com/flang-compiler/f18/pull/878
Tree-same-pre-rewrite: false
flang/lib/parser/dump-parse-tree.h
flang/tools/f18/f18.cc