]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: cleanup for concrete types - subr
authorRuss Cox <rsc@golang.org>
Thu, 10 Dec 2020 23:47:58 +0000 (18:47 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 17 Dec 2020 04:43:40 +0000 (04:43 +0000)
commit5024396563f9f544a3c6413026cf9b302fd83709
tree693ad45439a29998eabadf525e3668efcf394634
parentdd67b13d07e6324c2b6d3330515c1f1e49fe5a9b
[dev.regabi] cmd/compile: cleanup for concrete types - subr

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

Passes buildall w/ toolstash -cmp.

Change-Id: I435082167c91e20a4d490aa5d5945c7454f71d61
Reviewed-on: https://go-review.googlesource.com/c/go/+/277930
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/typecheck.go