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:
parent
f09887cdce
commit
38a61ff41f
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user