]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: remove queuemethod
authorDave Cheney <dave@cheney.net>
Fri, 7 Apr 2017 10:07:54 +0000 (20:07 +1000)
committerDave Cheney <dave@cheney.net>
Fri, 7 Apr 2017 21:53:23 +0000 (21:53 +0000)
queuemethod was unused. As queuemethod is unused, nothing appends to the
methodqueue global. As methodqueue is always nil or empty, there are no
live callers of domethod, so it can be removed.

Change-Id: Ic7427ac4621bbf403947815e3988c3a1113487f2
Reviewed-on: https://go-review.googlesource.com/39931
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/typecheck.go

index e447b0b618af3f58c397efd764b14066ebc5b5fe..b272d27612f60c4fca6810c8bac9de77f422d55b 100644 (file)
@@ -3502,39 +3502,6 @@ func stringtoarraylit(n *Node) *Node {
 
 var ntypecheckdeftype int
 
-var methodqueue []*Node
-
-func domethod(n *Node) {
-       nt := asNode(n.Type.FuncType().Nname)
-       nt = typecheck(nt, Etype)
-       if nt.Type == nil {
-               // type check failed; leave empty func
-               // TODO(mdempsky): Fix Type rekinding.
-               n.Type.Etype = TFUNC
-               n.Type.Nod = nil
-               return
-       }
-
-       // If we have
-       //      type I interface {
-       //              M(_ int)
-       //      }
-       // then even though I.M looks like it doesn't care about the
-       // value of its argument, a specific implementation of I may
-       // care. The _ would suppress the assignment to that argument
-       // while generating a call, so remove it.
-       for _, t := range nt.Type.Params().Fields().Slice() {
-               if t.Sym != nil && t.Sym.Name == "_" {
-                       t.Sym = nil
-               }
-       }
-
-       // TODO(mdempsky): Fix Type rekinding.
-       *n.Type = *nt.Type
-       n.Type.Nod = nil
-       checkwidth(n.Type)
-}
-
 type mapqueueval struct {
        n   *Node
        lno src.XPos
@@ -3629,19 +3596,9 @@ ret:
        lineno = lno
 
        // if there are no type definitions going on, it's safe to
-       // try to resolve the method types for the interfaces
+       // try to validate the map key types for the interfaces
        // we just read.
        if ntypecheckdeftype == 1 {
-               for {
-                       s := methodqueue
-                       if len(s) == 0 {
-                               break
-                       }
-                       methodqueue = nil
-                       for _, n := range s {
-                               domethod(n)
-                       }
-               }
                for _, e := range mapqueue {
                        lineno = e.lno
                        if !IsComparable(e.n.Type) {
@@ -3655,15 +3612,6 @@ ret:
        ntypecheckdeftype--
 }
 
-func queuemethod(n *Node) {
-       if ntypecheckdeftype == 0 {
-               domethod(n)
-               return
-       }
-
-       methodqueue = append(methodqueue, n)
-}
-
 func typecheckdef(n *Node) *Node {
        lno := lineno
        setlineno(n)