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) {
r0 := uint32(0)
for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N
if n.Needzero == 0 {
if !n.Needzero {
continue
}
if n.Class != gc.PAUTO {
......
......@@ -32,7 +32,7 @@ func defframe(ptxt *obj.Prog) {
// iterate through declarations - they are sorted in decreasing xoffset order.
for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N
if n.Needzero == 0 {
if !n.Needzero {
continue
}
if n.Class != gc.PAUTO {
......
......@@ -30,7 +30,7 @@ func defframe(ptxt *obj.Prog) {
ax := uint32(0)
for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N
if n.Needzero == 0 {
if !n.Needzero {
continue
}
if n.Class != gc.PAUTO {
......
......@@ -32,7 +32,7 @@ func defframe(ptxt *obj.Prog) {
// iterate through declarations - they are sorted in decreasing xoffset order.
for l := gc.Curfn.Dcl; l != nil; l = l.Next {
n = l.N
if n.Needzero == 0 {
if !n.Needzero {
continue
}
if n.Class != gc.PAUTO {
......
......@@ -174,7 +174,7 @@ type Node struct {
Reslice uint8
Likely int8
Hasbreak uint8
Needzero uint8
Needzero bool
Needctxt bool
Esc uint
Funcdepth int
......
......@@ -211,8 +211,8 @@ func cmpstackvar(a *Node, b *Node) int {
return bp - ap
}
ap = int(a.Needzero)
bp = int(b.Needzero)
ap = bool2int(a.Needzero)
bp = bool2int(b.Needzero)
if ap != bp {
return bp - ap
}
......
......@@ -1255,8 +1255,8 @@ func livenessepilogue(lv *Liveness) {
}
bvset(all, pos) // silence future warnings in this block
n = lv.vars[pos]
if n.Needzero == 0 {
n.Needzero = 1
if !n.Needzero {
n.Needzero = true
if debuglive >= 1 {
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