]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: cleanup for concrete types - walk
authorRuss Cox <rsc@golang.org>
Thu, 10 Dec 2020 23:45:14 +0000 (18:45 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 18 Dec 2020 17:52:49 +0000 (17:52 +0000)
commit27aba226518fd126f6dd3413298c919a1eeb9040
treef45ca3da66beb569b25c026939841b725ed33110
parent0b9cb63b8df352e2cb34b32452d9645ae621f9a1
[dev.regabi] cmd/compile: cleanup for concrete types - walk

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 walk.go.

Passes buildall w/ toolstash -cmp.

Change-Id: I7aab57e4077cf10da1994625575c5e42ad114a9c
Reviewed-on: https://go-review.googlesource.com/c/go/+/277921
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/alg.go
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/walk.go