cmd/5g, etc, cmd/internal/gc, cmd/internal/obj, etc: coalesce bool2int implementations
There were 10 implementations of the trivial bool2int function, 9 of which
were the only thing in their file. Remove all of them in favor of one in
cmd/internal/obj.
Change-Id: I9c51d30716239df51186860b9842a5e9b27264d3
Reviewed-on: https://go-review.googlesource.com/9230
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/cmd/internal/gc/reflect.go b/src/cmd/internal/gc/reflect.go
index 47e24a5..47697be 100644
--- a/src/cmd/internal/gc/reflect.go
+++ b/src/cmd/internal/gc/reflect.go
@@ -678,7 +678,7 @@
ret = true
}
- t.Haspointers = 1 + uint8(bool2int(ret))
+ t.Haspointers = 1 + uint8(obj.Bool2int(ret))
return ret
}
@@ -1066,7 +1066,7 @@
ot = dcommontype(s, ot, t)
xt = ot - 3*Widthptr
- ot = duint8(s, ot, uint8(bool2int(isddd)))
+ ot = duint8(s, ot, uint8(obj.Bool2int(isddd)))
// two slice headers: in and out.
ot = int(Rnd(int64(ot), int64(Widthptr)))
@@ -1146,7 +1146,7 @@
}
ot = duint16(s, ot, uint16(mapbucket(t).Width))
- ot = duint8(s, ot, uint8(bool2int(isreflexive(t.Down))))
+ ot = duint8(s, ot, uint8(obj.Bool2int(isreflexive(t.Down))))
case TPTR32, TPTR64:
if t.Type.Etype == TANY {