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

cmd/compile: remove duplicates by using finishcompare

Updates #23834

Change-Id: If05001f9fd6b97d72069f440102eec6e371908dd
Reviewed-on: https://go-review.googlesource.com/97016
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Kunpei Sakai 2018-02-25 17:54:44 +09:00 committed by Matthew Dempsky
parent a375a6b363
commit 21343e07d6

View File

@ -1700,10 +1700,7 @@ opswitch:
} else {
cmp = nod(OOROR, nod(ONE, lt, rt), nod(ONOT, call, nil))
}
cmp = typecheck(cmp, Erv)
cmp = walkexpr(cmp, init)
cmp.Type = n.Type
n = cmp
n = finishcompare(n, cmp, init)
case OARRAYLIT, OSLICELIT, OMAPLIT, OSTRUCTLIT, OPTRLIT:
if isStaticCompositeLiteral(n) && !canSSAType(n.Type) {