Passes toolstash -cmp.
Change-Id: I16ec0c11096bf4c020cf41392effeb67436f32ba
Reviewed-on: https://go-review.googlesource.com/26750
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
return false
}
-func isglobal(n *Node) bool {
+func (n *Node) isGlobal() bool {
n = outervalue(n)
-
- switch n.Op {
- case ONAME:
- switch n.Class {
- case PEXTERN:
- return true
- }
- }
-
- return false
+ return n.Op == ONAME && n.Class == PEXTERN
}
// Do we need a write barrier for the assignment l = r?
// No write barrier for storing address of global, which
// is live no matter what.
- if r.Op == OADDR && isglobal(r.Left) {
+ if r.Op == OADDR && r.Left.isGlobal() {
return false
}