Commit 5bf428ef authored by Dave Cheney's avatar Dave Cheney

cmd/internal/gc: make Node.Hasbreak a bool

Node.Hasbreak was treated like a bool, so declare it as bool.

Change-Id: Ied238356dce4da896834bd1412cc21ea56d35e1d
Reviewed-on: https://go-review.googlesource.com/6807Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 4a174ee4
...@@ -55,7 +55,7 @@ type Node struct { ...@@ -55,7 +55,7 @@ type Node struct {
Wrapper uint8 // is method wrapper (for func) Wrapper uint8 // is method wrapper (for func)
Reslice uint8 // this is a reslice x = x[0:y] or x = append(x, ...) Reslice uint8 // this is a reslice x = x[0:y] or x = append(x, ...)
Likely int8 // likeliness of if statement Likely int8 // likeliness of if statement
Hasbreak uint8 // has break statement Hasbreak bool // has break statement
Needzero bool // if it contains pointers, needs to be zeroed on function entry Needzero bool // if it contains pointers, needs to be zeroed on function entry
Needctxt bool // function uses context register (has closure variables) Needctxt bool // function uses context register (has closure variables)
Esc uint // EscXXX Esc uint // EscXXX
......
...@@ -3954,12 +3954,12 @@ func markbreak(n *Node, implicit *Node) { ...@@ -3954,12 +3954,12 @@ func markbreak(n *Node, implicit *Node) {
case OBREAK: case OBREAK:
if n.Left == nil { if n.Left == nil {
if implicit != nil { if implicit != nil {
implicit.Hasbreak = 1 implicit.Hasbreak = true
} }
} else { } else {
lab := n.Left.Sym.Label lab := n.Left.Sym.Label
if lab != nil { if lab != nil {
lab.Def.Hasbreak = 1 lab.Def.Hasbreak = true
} }
} }
...@@ -4053,7 +4053,7 @@ func isterminating(l *NodeList, top int) bool { ...@@ -4053,7 +4053,7 @@ func isterminating(l *NodeList, top int) bool {
if n.Ntest != nil { if n.Ntest != nil {
return false return false
} }
if n.Hasbreak != 0 { if n.Hasbreak {
return false return false
} }
return true return true
...@@ -4064,7 +4064,7 @@ func isterminating(l *NodeList, top int) bool { ...@@ -4064,7 +4064,7 @@ func isterminating(l *NodeList, top int) bool {
case OSWITCH, case OSWITCH,
OTYPESW, OTYPESW,
OSELECT: OSELECT:
if n.Hasbreak != 0 { if n.Hasbreak {
return false return false
} }
def := 0 def := 0
......
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