mirror of
https://github.com/golang/go
synced 2024-11-17 23:14:49 -07:00
cmd/compile/internal/walk: remove unused eqFor
CL 436436 replaced eqFor with reflectdata.EqFor, but forgot removing it. Change-Id: I3f2bf02da2e161a27718226b970b81815e9f0a46 Reviewed-on: https://go-review.googlesource.com/c/go/+/468815 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
9aaaedbbb4
commit
89c3f7c119
@ -462,33 +462,6 @@ func finishCompare(n *ir.BinaryExpr, r ir.Node, init *ir.Nodes) ir.Node {
|
||||
return r
|
||||
}
|
||||
|
||||
func eqFor(t *types.Type) (n ir.Node, needsize bool) {
|
||||
// Should only arrive here with large memory or
|
||||
// a struct/array containing a non-memory field/element.
|
||||
// Small memory is handled inline, and single non-memory
|
||||
// is handled by walkCompare.
|
||||
switch a, _ := types.AlgType(t); a {
|
||||
case types.AMEM:
|
||||
n := typecheck.LookupRuntime("memequal")
|
||||
n = typecheck.SubstArgTypes(n, t, t)
|
||||
return n, true
|
||||
case types.ASPECIAL:
|
||||
sym := reflectdata.TypeSymPrefix(".eq", t)
|
||||
// TODO(austin): This creates an ir.Name with a nil Func.
|
||||
n := typecheck.NewName(sym)
|
||||
ir.MarkFunc(n)
|
||||
n.SetType(types.NewSignature(nil, []*types.Field{
|
||||
types.NewField(base.Pos, nil, types.NewPtr(t)),
|
||||
types.NewField(base.Pos, nil, types.NewPtr(t)),
|
||||
}, []*types.Field{
|
||||
types.NewField(base.Pos, nil, types.Types[types.TBOOL]),
|
||||
}))
|
||||
return n, false
|
||||
}
|
||||
base.Fatalf("eqFor %v", t)
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// brcom returns !(op).
|
||||
// For example, brcom(==) is !=.
|
||||
func brcom(op ir.Op) ir.Op {
|
||||
|
Loading…
Reference in New Issue
Block a user