]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove a few unused bits of code
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 1 Sep 2019 10:29:41 +0000 (12:29 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Sun, 1 Sep 2019 14:25:12 +0000 (14:25 +0000)
Just the low-hanging fruit; code that was either never used, or its last
use was removed a while ago.

Change-Id: Ic7f90aeee3e6daf7edc16cde3c0a767d67e617ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/192618
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/init.go
src/cmd/compile/internal/gc/universe.go
src/cmd/compile/internal/ssa/lca_test.go
src/cmd/compile/internal/ssa/rewrite.go

index 26fd71d70ce620730f8d8f862210ce87c9a07b6e..bb894152c5211360389d7309545144e2d74aac01 100644 (file)
@@ -102,9 +102,3 @@ func fninit(n []*Node) {
        // It's not quite read only, the state field must be modifiable.
        ggloblsym(lsym, int32(ot), obj.NOPTR)
 }
-
-func (n *Node) checkInitFuncSignature() {
-       if n.Type.NumRecvs()+n.Type.NumParams()+n.Type.NumResults() > 0 {
-               Fatalf("init function cannot have receiver, params, or results: %v (%v)", n, n.Type)
-       }
-}
index 104c6bab23d328cc13ac7299ca0bfd012c725be4..b8260d65256f83dad3e19de3fb0b9267d2948aa5 100644 (file)
@@ -11,8 +11,6 @@ import "cmd/compile/internal/types"
 // builtinpkg is a fake package that declares the universe block.
 var builtinpkg *types.Pkg
 
-var itable *types.Type // distinguished *byte
-
 var basicTypes = [...]struct {
        name  string
        etype types.EType
@@ -361,8 +359,6 @@ func typeinit() {
 
        dowidth(types.Types[TSTRING])
        dowidth(types.Idealstring)
-
-       itable = types.NewPtr(types.Types[TUINT8])
 }
 
 func makeErrorInterface() *types.Type {
index 8221dc466d9a2a1492cedd6b6c2179efa693ae19..8c8920c740d0483ebf919bf2cfa8395b4033a203 100644 (file)
@@ -6,21 +6,6 @@ package ssa
 
 import "testing"
 
-type lca interface {
-       find(a, b *Block) *Block
-}
-
-func lcaEqual(f *Func, lca1, lca2 lca) bool {
-       for _, b := range f.Blocks {
-               for _, c := range f.Blocks {
-                       if lca1.find(b, c) != lca2.find(b, c) {
-                               return false
-                       }
-               }
-       }
-       return true
-}
-
 func testLCAgen(t *testing.T, bg blockGen, size int) {
        c := testConfig(t)
        fun := c.Fun("entry", bg(size)...)
index cd23fe87e580e3d27fbee7b026125ed680af77ac..22e17cb5dab9859cfe8eebcefc5b591c942ad065 100644 (file)
@@ -474,11 +474,6 @@ func NeedsFixUp(v *Value) bool {
        return v.AuxInt == 0
 }
 
-// i2f is used in rules for converting from an AuxInt to a float.
-func i2f(i int64) float64 {
-       return math.Float64frombits(uint64(i))
-}
-
 // auxFrom64F encodes a float64 value so it can be stored in an AuxInt.
 func auxFrom64F(f float64) int64 {
        return int64(math.Float64bits(f))