]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: update ir/fmt for concrete types
authorRuss Cox <rsc@golang.org>
Fri, 11 Dec 2020 01:55:10 +0000 (20:55 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 17 Dec 2020 03:50:03 +0000 (03:50 +0000)
commit4dfc7333f4ebe67e0aa7f429ce73c9d58a2fc309
treed3c76b40649a9f0c4cb865c0e75da2843e42750a
parenta997543292df533f5951cd8fda39692a44077151
[dev.regabi] cmd/compile: update ir/fmt for concrete types

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 handles package fmt. There are various type assertions
but also some rewriting to lean more heavily on reflection.

Passes buildall w/ toolstash -cmp.

Change-Id: I503467468b42ace11bff2ba014b03cfa345e6d03
Reviewed-on: https://go-review.googlesource.com/c/go/+/277915
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ir/fmt.go
src/cmd/compile/internal/ir/name.go
test/escape_param.go