1
0
mirror of https://github.com/golang/go synced 2024-11-19 10:44:47 -07:00

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/6800
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Dave Cheney 2015-03-05 07:11:40 +11:00
parent f09887cdce
commit 38a61ff41f
7 changed files with 9 additions and 9 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -174,7 +174,7 @@ type Node struct {
Reslice uint8
Likely int8
Hasbreak uint8
Needzero uint8
Needzero bool
Needctxt bool
Esc uint
Funcdepth int

View File

@ -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
}

View File

@ -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))
}