mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: reduce garbage from autolabel
Follow-up to CL 26661 Change-Id: I67c58d17313094675cf0f30ce50d486818ae0dcb Reviewed-on: https://go-review.googlesource.com/27113 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
77e68ea78a
commit
fe27291c00
3 changed files with 10 additions and 5 deletions
|
|
@ -358,7 +358,7 @@ func casebody(sw *Node, typeswvar *Node) {
|
|||
n.Op = OCASE
|
||||
needvar := n.List.Len() != 1 || n.List.First().Op == OLITERAL
|
||||
|
||||
jmp := Nod(OGOTO, autolabel("s"), nil)
|
||||
jmp := Nod(OGOTO, autolabel(".s"), nil)
|
||||
if n.List.Len() == 0 {
|
||||
if def != nil {
|
||||
Yyerror("more than one default case")
|
||||
|
|
@ -577,7 +577,7 @@ func (s *typeSwitch) walk(sw *Node) {
|
|||
i.Nbody.Set1(typenil)
|
||||
} else {
|
||||
// Jump to default case.
|
||||
lbl := autolabel("s")
|
||||
lbl := autolabel(".s")
|
||||
i.Nbody.Set1(Nod(OGOTO, lbl, nil))
|
||||
// Wrap default case with label.
|
||||
blk := Nod(OBLOCK, nil, nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue