cmd/{5,6,8,9}g, cmd/internal/gc: use bools for is* and okfor*
No functional changes.
This diff was generated as follows:
* Manually edit cmd/internal/gc/go.go to update types and group variables.
* Manually edit initialization in cmd/internal/gc/align.go--localized s/1/true.
* Manually fix the handling of sign in cmd/internal/gc/walk.go in func bounded (near line 4000).
* Manually update go.y and regenerate y.go.
* Run gofmt -r many times to do the rest, using https://gist.github.com/josharian/0f61dbb2dff81f938e70.
toolstash -cmp on the stdlib comes back green.
Change-Id: I19766ed551714e51b325133e7138818d117b3a9a
Reviewed-on: https://go-review.googlesource.com/6530
Reviewed-by: Russ Cox <rsc@golang.org>
diff --git a/src/cmd/8g/ggen.go b/src/cmd/8g/ggen.go
index 7aba85e..27938c7 100644
--- a/src/cmd/8g/ggen.go
+++ b/src/cmd/8g/ggen.go
@@ -446,7 +446,7 @@
*/
func cgen_aret(n *gc.Node, res *gc.Node) {
t := n.Left.Type
- if gc.Isptr[t.Etype] != 0 {
+ if gc.Isptr[t.Etype] {
t = t.Type
}
@@ -518,7 +518,7 @@
t0 := t
check := 0
- if gc.Issigned[t.Etype] != 0 {
+ if gc.Issigned[t.Etype] {
check = 1
if gc.Isconst(nl, gc.CTINT) && gc.Mpgetfix(nl.Val.U.Xval) != -1<<uint64(t.Width*8-1) {
check = 0
@@ -528,7 +528,7 @@
}
if t.Width < 4 {
- if gc.Issigned[t.Etype] != 0 {
+ if gc.Issigned[t.Etype] {
t = gc.Types[gc.TINT32]
} else {
t = gc.Types[gc.TUINT32]
@@ -602,7 +602,7 @@
gc.Patch(p1, gc.Pc)
}
- if gc.Issigned[t.Etype] == 0 {
+ if !gc.Issigned[t.Etype] {
var nz gc.Node
gc.Nodconst(&nz, t, 0)
gmove(&nz, dx)
@@ -658,7 +658,7 @@
}
var t *gc.Type
- if gc.Issigned[nl.Type.Etype] != 0 {
+ if gc.Issigned[nl.Type.Etype] {
t = gc.Types[gc.TINT32]
} else {
t = gc.Types[gc.TUINT32]
@@ -776,7 +776,7 @@
p1 = gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT32]), nil, +1)
}
- if op == gc.ORSH && gc.Issigned[nl.Type.Etype] != 0 {
+ if op == gc.ORSH && gc.Issigned[nl.Type.Etype] {
gins(a, ncon(uint32(w)-1), &n2)
} else {
gmove(ncon(0), &n2)
@@ -807,7 +807,7 @@
// copy from byte to full registers
t := gc.Types[gc.TUINT32]
- if gc.Issigned[nl.Type.Etype] != 0 {
+ if gc.Issigned[nl.Type.Etype] {
t = gc.Types[gc.TINT32]
}