[dev.regabi] cmd/compile: implement doChildren for nodes

Put each node in charge of its DoChildren implementation.
This removes a generic use of Left, Right, and so on
in func DoChildren, heading toward removing those even from
being used in package ir.

Passes buildall w/ toolstash -cmp.

Change-Id: Ibdf56f36801217cf24549e063da0078c1820a56b
Reviewed-on: https://go-review.googlesource.com/c/go/+/275375
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-12-03 21:02:19 -05:00
parent 18f2df7e81
commit 4725c3ffd1
8 changed files with 419 additions and 67 deletions

View file

@ -30,6 +30,8 @@ type Node interface {
// For making copies. For Copy and SepCopy.
copy() Node
doChildren(func(Node) error) error
// Abstract graph structure, for generic traversals.
Op() Op
SetOp(x Op)