compiler: add src information to AST dumps (part 1 of 2).

Programming / Compilers / GCC - ian [138bc75d-0d04-0410-961f-82ee72b054a4] - 27 September 2016 15:49 UTC

When emitting AST dumps, tag the end of selected statements with with source file and line number information where available. Example:

tmp.76832448 = 0 // p.go:6

Requires a corresponding change in gcc/go as well as this change to gofrontend.

Reviewed-on: https://go-review.googlesource.com/29856

- go-linemap.cc (Gcc_linemap::to_string): New method.

a2195a2 compiler: add src information to AST dumps (part 1 of 2).
gcc/go/ChangeLog | 4 +++
gcc/go/go-linemap.cc | 28 ++++++++++++++++
gcc/go/gofrontend/MERGE | 2 +-
gcc/go/gofrontend/go-linemap.h | 15 ++++++++-
gcc/go/gofrontend/statements.cc | 67 ++++++++++++++++++++++++---------------
5 files changed, 88 insertions(+), 28 deletions(-)

Upstream: gcc.gnu.org


  • Share