Commit 38a61ff4 authored by Dave Cheney's avatar Dave Cheney

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

Node.Needzero only has two values and acts as a bool, so make it a bool.

Change-Id: Ica46e5ebafbe478017ea52ce6bb335f404059677
Reviewed-on: https://go-review.googlesource.com/6800Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent f09887cd
...@@ -30,7 +30,7 @@ func defframe(ptxt *obj.Prog) { ...@@ -30,7 +30,7 @@ func defframe(ptxt *obj.Prog) {
r0 := uint32(0) r0 := uint32(0)
for l := gc.Curfn.Dcl; l != nil; l = l.Next { for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N n = l.N
if n.Needzero == 0 { if !n.Needzero {
continue continue
} }
if n.Class != gc.PAUTO { if n.Class != gc.PAUTO {
......
...@@ -32,7 +32,7 @@ func defframe(ptxt *obj.Prog) { ...@@ -32,7 +32,7 @@ func defframe(ptxt *obj.Prog) {
// iterate through declarations - they are sorted in decreasing xoffset order. // iterate through declarations - they are sorted in decreasing xoffset order.
for l := gc.Curfn.Dcl; l != nil; l = l.Next { for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N n = l.N
if n.Needzero == 0 { if !n.Needzero {
continue continue
} }
if n.Class != gc.PAUTO { if n.Class != gc.PAUTO {
......
...@@ -30,7 +30,7 @@ func defframe(ptxt *obj.Prog) { ...@@ -30,7 +30,7 @@ func defframe(ptxt *obj.Prog) {
ax := uint32(0) ax := uint32(0)
for l := gc.Curfn.Dcl; l != nil; l = l.Next { for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N n = l.N
if n.Needzero == 0 { if !n.Needzero {
continue continue
} }
if n.Class != gc.PAUTO { if n.Class != gc.PAUTO {
......
...@@ -32,7 +32,7 @@ func defframe(ptxt *obj.Prog) { ...@@ -32,7 +32,7 @@ func defframe(ptxt *obj.Prog) {
// iterate through declarations - they are sorted in decreasing xoffset order. // iterate through declarations - they are sorted in decreasing xoffset order.
for l := gc.Curfn.Dcl; l != nil; l = l.Next { for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N n = l.N
if n.Needzero == 0 { if !n.Needzero {
continue continue
} }
if n.Class != gc.PAUTO { if n.Class != gc.PAUTO {
......
...@@ -174,7 +174,7 @@ type Node struct { ...@@ -174,7 +174,7 @@ type Node struct {
Reslice uint8 Reslice uint8
Likely int8 Likely int8
Hasbreak uint8 Hasbreak uint8
Needzero uint8 Needzero bool
Needctxt bool Needctxt bool
Esc uint Esc uint
Funcdepth int Funcdepth int
......
...@@ -211,8 +211,8 @@ func cmpstackvar(a *Node, b *Node) int { ...@@ -211,8 +211,8 @@ func cmpstackvar(a *Node, b *Node) int {
return bp - ap return bp - ap
} }
ap = int(a.Needzero) ap = bool2int(a.Needzero)
bp = int(b.Needzero) bp = bool2int(b.Needzero)
if ap != bp { if ap != bp {
return bp - ap return bp - ap
} }
......
...@@ -1255,8 +1255,8 @@ func livenessepilogue(lv *Liveness) { ...@@ -1255,8 +1255,8 @@ func livenessepilogue(lv *Liveness) {
} }
bvset(all, pos) // silence future warnings in this block bvset(all, pos) // silence future warnings in this block
n = lv.vars[pos] n = lv.vars[pos]
if n.Needzero == 0 { if !n.Needzero {
n.Needzero = 1 n.Needzero = true
if debuglive >= 1 { if debuglive >= 1 {
Warnl(int(p.Lineno), "%v: %v is ambiguously live", Nconv(Curfn.Nname, 0), Nconv(n, obj.FmtLong)) Warnl(int(p.Lineno), "%v: %v is ambiguously live", Nconv(Curfn.Nname, 0), Nconv(n, obj.FmtLong))
} }
......
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