[dev.regabi] cmd/compile: remove Orig, SetOrig from Node interface

These are only needed for a few opcodes, and we can avoid
wasting storage in every implementation by using the extension
interface pattern with a helper function for access.

Of course, in the current codebase, there is only one Node
implementation (*node) and it has these methods, so there
is no danger of a functional change in this particular CL.

Passes buildall w/ toolstash -cmp.

Change-Id: I440c6c232f1fe7b56b852a00dc530f8f49a6b12d
Reviewed-on: https://go-review.googlesource.com/c/go/+/274089
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-11-28 00:36:44 -05:00
parent 79a3d5ce15
commit 171787efcd
9 changed files with 52 additions and 24 deletions

View file

@ -80,7 +80,7 @@ func tempAt(pos src.XPos, curfn ir.Node, t *types.Type) ir.Node {
dowidth(t)
return n.Orig()
return ir.Orig(n)
}
func temp(t *types.Type) ir.Node {