]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: move gc.treecopy to ir.DeepCopy
authorRuss Cox <rsc@golang.org>
Sun, 29 Nov 2020 14:38:52 +0000 (09:38 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 30 Nov 2020 18:34:07 +0000 (18:34 +0000)
commitd40869fcedb208b0bcf7e7d828db12f210a17dc6
treee7ad82d42dc864458cf041ec5a268105c6fa2bdf
parentf0001e8867be0004a8bc13eaea8b59653a5d141e
[dev.regabi] cmd/compile: move gc.treecopy to ir.DeepCopy

This is a general operation on IR nodes, so it belongs in ir.
The copied implementation is adapted to support the
extension pattern, allowing nodes to implement their
own DeepCopy implementations if needed.

This is the first step toward higher-level operations instead
of Left, Right, etc. It will allow the new type syntax nodes
to be properly immutable and opt out of those fine-grained methods.

Passes buildall w/ toolstash -cmp.

Change-Id: Ibd64061e01daf14aebc6586cb2eb2b12057ca85a
Reviewed-on: https://go-review.googlesource.com/c/go/+/274102
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/gc/order.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/ir/copy.go [new file with mode: 0644]
src/cmd/compile/internal/ir/node.go