]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: simplify Op, Node, Nodes printing
authorRuss Cox <rsc@golang.org>
Sat, 5 Dec 2020 19:46:19 +0000 (14:46 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 7 Dec 2020 20:40:46 +0000 (20:40 +0000)
commit3b25f3c1504cdc8f2263d68436df42042251b290
tree1779f0f590457298655509003b38d6a820046486
parent8ce2605c5b4bc64432e1711a1273f91eee3a41fc
[dev.regabi] cmd/compile: simplify Op, Node, Nodes printing

nconvFmt calls base.Fatalf if mode is anything but FErr,
proving that the only formats that matter for nodes are
plain %v, %S, and %L. And the nodes formatter can only get to %v.
(%S and %v are the same; we'll clean that up separately.)

Node and Nodes can therefore ignore mode, and all the mode
code can be removed from those implementations, removing
quite a few layers of abstraction.

Op similarly only runs in one mode and can be simplified.

Passes buildall w/ toolstash -cmp.

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