llvm/flang/lib
Tim Keith 89840b5087 [flang] Support unparse with symbol annotations.
When `-fdebug-dump-symbols` is supplied with `-funparse`, include symbol
information in comments in the Fortran output. This will be used for
testing to verify that correct symbols are defined and references in
the right place.

In `UnparseWithSymbols()`, walk the parse tree and collect symbol
definitions and references, organized by statement. When a symbol is
defined across several statement it is associated with the first.
The definition of implicitly defined symbols is associated with the
first reference.

To write out the symbol information, a new optional argument is added to
`Unparse()`: it is a function that is called immediately before each
statement is unparsed. We pass in a function that prints out the symbol
information collected for that statement.

Add `Symbol::GetType()` to make it easier to write the symbol types
and add `Symbol::SetType()` for uniformity.

Original-commit: flang-compiler/f18@2e827de4ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/112
Tree-same-pre-rewrite: false
2018-06-26 15:01:42 -07:00
..
common [flang] clean up for push 2018-06-22 14:59:28 -07:00
evaluate [flang] Incorporate suggestions from code review. 2018-06-22 16:44:23 -07:00
parser [flang] Support unparse with symbol annotations. 2018-06-26 15:01:42 -07:00
semantics [flang] Support unparse with symbol annotations. 2018-06-26 15:01:42 -07:00
CMakeLists.txt [flang] Rearrange some facilities into a new lib/common. 2018-06-18 11:05:17 -07:00