]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: untangle ir.Dump printing
authorRuss Cox <rsc@golang.org>
Sat, 5 Dec 2020 05:02:46 +0000 (00:02 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 7 Dec 2020 20:40:41 +0000 (20:40 +0000)
commit8ce2605c5b4bc64432e1711a1273f91eee3a41fc
treed2d40cf7274bc493b3c0093f635dcc602a277acb
parent158c9dd131db86a381535a902b54bc7f610a8c97
[dev.regabi] cmd/compile: untangle ir.Dump printing

The Node printing code is tangled up due to the multiple printing modes.
Split out the Dump mode into its own code, which clarifies it considerably.
We are going to have to change the code for the new Node representations,
so it is nice to have it in an understandable form first.

The output of Dump is unchanged except for the removal of spurious
mid-Dump blank lines that have been printed for a while but don't
really make sense and appear to be a bug.

The %+v verb on Op prints the name ("ADD" not "+"), matching
%+v on Node and %+v on Nodes to get Dump and DumpList formats.

Passes buildall w/ toolstash -cmp.

Change-Id: I07f0f245859f1f785e10bdd671855ca43c51b545
Reviewed-on: https://go-review.googlesource.com/c/go/+/275774
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/fmtmap_test.go
src/cmd/compile/internal/ir/fmt.go