mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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>
This commit is contained in:
parent
27aba22651
commit
4e8f1e139f
11 changed files with 194 additions and 137 deletions
|
|
@ -733,8 +733,6 @@ func NodAt(pos src.XPos, op Op, nleft, nright Node) Node {
|
|||
return newNameAt(pos, op, nil)
|
||||
case OMAKECHAN, OMAKEMAP, OMAKESLICE, OMAKESLICECOPY:
|
||||
return NewMakeExpr(pos, op, nleft, nright)
|
||||
case OMETHEXPR:
|
||||
return NewMethodExpr(pos, nleft, nright)
|
||||
case ONIL:
|
||||
return NewNilExpr(pos)
|
||||
case OPACK:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue