From: Dave Cheney Date: Fri, 7 Apr 2017 10:07:54 +0000 (+1000) Subject: cmd/compile/internal/gc: remove queuemethod X-Git-Tag: go1.9beta1~783 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f96abb40b62ef8b9c782cb115cdc7743dba707bb;p=gostls13.git cmd/compile/internal/gc: remove queuemethod 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 TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index e447b0b618..b272d27612 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -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)