[flang] Add `std::string ExpressionBase::AsFortran()`
authorTim Keith <tkeith@nvidia.com>
Wed, 15 Jan 2020 01:31:25 +0000 (17:31 -0800)
committerTim Keith <tkeith@nvidia.com>
Wed, 22 Jan 2020 21:50:02 +0000 (13:50 -0800)
commit8ad8bfb2a8abf914e4b0a0dd1c4f46b00c8f98a2
tree2558da9c7353dfd9fa76939239d56feb4a593a36
parent44e14338558413c105b25d475ff2836ae08d3af1
[flang] Add `std::string ExpressionBase::AsFortran()`

This is easier to use when including an expression in an error message
and also useful when debugging for dumping expressions.

Fix up several places that no longer need to use a temporary
std::stringstream.

Also change some references to `operator<<` in `formatting.cc` and
`symbol.cc` that became ambiguous with this change.

Original-commit: flang-compiler/f18@25dc49b6e9cf5bce61d6d655ab242609cbd28e13
Reviewed-on: https://github.com/flang-compiler/f18/pull/944
Tree-same-pre-rewrite: false
flang/lib/evaluate/characteristics.cc
flang/lib/evaluate/expression.h
flang/lib/evaluate/fold-implementation.h
flang/lib/evaluate/formatting.cc
flang/lib/semantics/check-call.cc
flang/lib/semantics/symbol.cc
flang/lib/semantics/type.cc
flang/test/evaluate/expression.cc