]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: cleanup for concrete types - sinit
authorRuss Cox <rsc@golang.org>
Thu, 10 Dec 2020 23:47:09 +0000 (18:47 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 18 Dec 2020 17:52:51 +0000 (17:52 +0000)
commit4e8f1e139f5c69a1d596a54b035d6fc4fb08b94d
treebc222d8798f298f3caeea50da8d7904bb5960f5b
parent27aba226518fd126f6dd3413298c919a1eeb9040
[dev.regabi] cmd/compile: cleanup for concrete types - sinit

An automated rewrite will add concrete type assertions after
a test of n.Op(), when n can be safely type-asserted
(meaning, n is not reassigned a different type, n is not reassigned
and then used outside the scope of the type assertion,
and so on).

This sequence of CLs handles the code that the automated
rewrite does not: adding specific types to function arguments,
adjusting code not to call n.Left() etc when n may have multiple
representations, and so on.

This CL focuses on sinit.go.

Passes buildall w/ toolstash -cmp.

Change-Id: I3e9458e69a7a9b3f2fe139382bf961bc4473cc42
Reviewed-on: https://go-review.googlesource.com/c/go/+/277928
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>
src/cmd/compile/internal/gc/iexport.go
src/cmd/compile/internal/gc/initorder.go
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/ir/node_gen.go