]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: eliminate more SetOrig
authorMatthew Dempsky <mdempsky@google.com>
Thu, 3 Dec 2020 19:56:29 +0000 (11:56 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 4 Dec 2020 01:20:58 +0000 (01:20 +0000)
commit84cb51d7d7a936d56d6287ca075dd578097499a9
tree6fdfed7a30c95f76ff0024760b09e68c441c38e7
parent351bc2f38c4291c01299c2add16f1f5a96e54bb4
[dev.regabi] cmd/compile: eliminate more SetOrig

This CL consolidates and cleans up fmt.go's logic for skipping past
Nodes introduced during typechecking. This allows eliminating SetOrig
on ConvExpr and Name. Also changes ConstExpr.SetOrig to a panic for
good measure.

The only remaining SetOrig uses now are for rewriting multi-value
"f(g())" calls and "return g()" statements, and type-checking
composite literals. It should be possible to eliminate both of those
as well.

Passes buildall w/ toolstash -cmp.

Change-Id: I478aea1a17dfb7a784293b930bf9081637eb2d7a
Reviewed-on: https://go-review.googlesource.com/c/go/+/275179
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/name.go