mirror of
https://github.com/golang/go
synced 2024-11-17 19:15:21 -07:00
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 <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
ce9bef261c
commit
f96abb40b6
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user