Commit 8712e186 authored by Dave Cheney's avatar Dave Cheney

cmd/compile/internal/gc: convert Label.Used to bool

Convert Label.Used to a boolean. Also move the field to the
bottom of the struct to avoid padding.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: If09ee92f9d54dce807e7b862cf771005daed810d
Reviewed-on: https://go-review.googlesource.com/14308
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 0388d430
......@@ -729,7 +729,7 @@ func gen(n *Node) {
break
}
lab.Used = 1
lab.Used = true
if lab.Breakpc == nil {
Yyerror("invalid break label %v", n.Left.Sym)
break
......@@ -754,7 +754,7 @@ func gen(n *Node) {
break
}
lab.Used = 1
lab.Used = true
if lab.Continpc == nil {
Yyerror("invalid continue label %v", n.Left.Sym)
break
......@@ -994,7 +994,7 @@ func checklabels() {
continue
}
if lab.Use == nil && lab.Used == 0 {
if lab.Use == nil && !lab.Used {
yyerrorl(int(lab.Def.Lineno), "label %v defined and not used", lab.Sym)
continue
}
......
......@@ -217,7 +217,6 @@ type Type struct {
}
type Label struct {
Used uint8
Sym *Sym
Def *Node
Use []*Node
......@@ -228,6 +227,8 @@ type Label struct {
Labelpc *obj.Prog // pointer to code
Breakpc *obj.Prog // pointer to code
Continpc *obj.Prog // pointer to code
Used bool
}
type InitEntry struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment