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/gsubr.go b/src/cmd/internal/gc/gsubr.go
index 34b9612..1f6b7d2 100644
--- a/src/cmd/internal/gc/gsubr.go
+++ b/src/cmd/internal/gc/gsubr.go
@@ -87,7 +87,7 @@
p.To.Val = nil
if as != obj.AJMP && likely != 0 && Thearch.Thechar != '9' && Thearch.Thechar != '7' {
p.From.Type = obj.TYPE_CONST
- p.From.Offset = int64(bool2int(likely > 0))
+ p.From.Offset = int64(obj.Bool2int(likely > 0))
}
return p
@@ -417,7 +417,7 @@
case CTBOOL:
a.Sym = nil
a.Type = obj.TYPE_CONST
- a.Offset = int64(bool2int(n.Val.U.Bval))
+ a.Offset = int64(obj.Bool2int(n.Val.U.Bval))
case CTNIL:
a.Sym = nil