cmd/compile: extract gc.eqtype as types.Identical

For symmetry with go/types.Identical.

Passes toolstash-check.

Change-Id: Id19c3956e44ed8e2d9f203d15824322cc5842d3d
Reviewed-on: https://go-review.googlesource.com/c/143180
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Matthew Dempsky 2018-10-18 15:24:50 -07:00
parent a440cc0d70
commit 2d58fbac2f
13 changed files with 161 additions and 155 deletions

View file

@ -288,7 +288,7 @@ func staticcopy(l *Node, r *Node, out *[]*Node) bool {
orig := r
r = r.Name.Defn.Right
for r.Op == OCONVNOP && !eqtype(r.Type, l.Type) {
for r.Op == OCONVNOP && !types.Identical(r.Type, l.Type) {
r = r.Left
}
@ -833,7 +833,7 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) {
var a *Node
if x := prealloc[n]; x != nil {
// temp allocated during order.go for dddarg
if !eqtype(t, x.Type) {
if !types.Identical(t, x.Type) {
panic("dotdotdot base type does not match order's assigned type")
}
@ -1154,7 +1154,7 @@ func oaslit(n *Node, init *Nodes) bool {
// not a special composite literal assignment
return false
}
if !eqtype(n.Left.Type, n.Right.Type) {
if !types.Identical(n.Left.Type, n.Right.Type) {
// not a special composite literal assignment
return false
}