cmd/compile: introduce gc.Node.copy method
When making a shallow copy of a node, various methods were used, including calling nod(OXXX, nil, nil) and then overwriting it, or "n1 := *n" and then using &n1. Add a copy method instead, simplifying all of those and making them consistent. Passes toolstash -cmp on std cmd. Change-Id: I3f3fc88bad708edc712bf6d87214cda4ddc43b01 Reviewed-on: https://go-review.googlesource.com/72710 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Showing
Please register or sign in to comment