1
0
mirror of https://github.com/golang/go synced 2024-11-23 11:00:08 -07:00

cmd/compile: remove redundant anylit calls in walkcompare

walkcompare already called walkexpr on n.Left and n.Right, which in
turn calls anylit when appropriate.

Passes toolstash-check.

Change-Id: I6912ac5a42b977c04db9d85cb2e7295e275e083d
Reviewed-on: https://go-review.googlesource.com/c/go/+/197600
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Matthew Dempsky 2019-09-26 10:59:11 -07:00
parent f91c850be6
commit ecc2d61798

View File

@ -3125,21 +3125,11 @@ func walkcompare(n *Node, init *Nodes) *Node {
// Chose not to inline. Call equality function directly.
if !inline {
if isvaluelit(cmpl) {
var_ := temp(cmpl.Type)
anylit(cmpl, var_, init)
cmpl = var_
}
if isvaluelit(cmpr) {
var_ := temp(cmpr.Type)
anylit(cmpr, var_, init)
cmpr = var_
}
// eq algs take pointers; cmpl and cmpr must be addressable
if !islvalue(cmpl) || !islvalue(cmpr) {
Fatalf("arguments of comparison must be lvalues - %v %v", cmpl, cmpr)
}
// eq algs take pointers
pl := temp(types.NewPtr(t))
al := nod(OAS, pl, nod(OADDR, cmpl, nil))
al = typecheck(al, ctxStmt)