This libgo patch by Cherry Zhang inlines and remove eqtype.  Now that
type equality is just a pointer equality, inline and remove the eqtype
function.  Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.
Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 272577)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-5bca69ab3b41df535193474baecc3a8a4c0b3dbe
+fdf0af774aabb31ba8a62f358b7b40dfe8b35da9
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/runtime/alg.go
===================================================================
--- libgo/go/runtime/alg.go     (revision 272577)
+++ libgo/go/runtime/alg.go     (working copy)
@@ -205,7 +205,7 @@ func nilinterequal(p, q unsafe.Pointer)
 }
 func efaceeq(x, y eface) bool {
        t := x._type
-       if !eqtype(t, y._type) {
+       if t != y._type {
                return false
        }
        if t == nil {
@@ -229,7 +229,7 @@ func ifaceeq(x, y iface) bool {
                return false
        }
        t := *(**_type)(xtab)
-       if !eqtype(t, *(**_type)(y.tab)) {
+       if t != *(**_type)(y.tab) {
                return false
        }
        eq := t.equalfn
@@ -247,7 +247,7 @@ func ifacevaleq(x iface, t *_type, p uns
                return false
        }
        xt := *(**_type)(x.tab)
-       if !eqtype(xt, t) {
+       if xt != t {
                return false
        }
        eq := t.equalfn
@@ -268,7 +268,7 @@ func ifaceefaceeq(x iface, y eface) bool
                return false
        }
        xt := *(**_type)(x.tab)
-       if !eqtype(xt, y._type) {
+       if xt != y._type {
                return false
        }
        eq := xt.equalfn
@@ -285,7 +285,7 @@ func efacevaleq(x eface, t *_type, p uns
        if x._type == nil {
                return false
        }
-       if !eqtype(x._type, t) {
+       if x._type != t {
                return false
        }
        eq := t.equalfn
Index: libgo/go/runtime/iface.go
===================================================================
--- libgo/go/runtime/iface.go   (revision 272577)
+++ libgo/go/runtime/iface.go   (working copy)
@@ -233,7 +233,7 @@ func (m *itab) init() string {
                        ri++
                }
 
-               if !eqtype(lhsMethod.typ, rhsMethod.mtyp) {
+               if lhsMethod.typ != rhsMethod.mtyp {
                        m.methods[1] = nil
                        return *lhsMethod.name
                }
@@ -406,7 +406,7 @@ func ifaceI2I2(inter *_type, i iface) (i
 
 // Convert an empty interface to a pointer non-interface type.
 func ifaceE2T2P(t *_type, e eface) (unsafe.Pointer, bool) {
-       if !eqtype(t, e._type) {
+       if t != e._type {
                return nil, false
        } else {
                return e.data, true
@@ -415,7 +415,7 @@ func ifaceE2T2P(t *_type, e eface) (unsa
 
 // Convert a non-empty interface to a pointer non-interface type.
 func ifaceI2T2P(t *_type, i iface) (unsafe.Pointer, bool) {
-       if i.tab == nil || !eqtype(t, *(**_type)(i.tab)) {
+       if i.tab == nil || t != *(**_type)(i.tab) {
                return nil, false
        } else {
                return i.data, true
@@ -424,7 +424,7 @@ func ifaceI2T2P(t *_type, i iface) (unsa
 
 // Convert an empty interface to a non-pointer non-interface type.
 func ifaceE2T2(t *_type, e eface, ret unsafe.Pointer) bool {
-       if !eqtype(t, e._type) {
+       if t != e._type {
                typedmemclr(t, ret)
                return false
        } else {
@@ -439,7 +439,7 @@ func ifaceE2T2(t *_type, e eface, ret un
 
 // Convert a non-empty interface to a non-pointer non-interface type.
 func ifaceI2T2(t *_type, i iface, ret unsafe.Pointer) bool {
-       if i.tab == nil || !eqtype(t, *(**_type)(i.tab)) {
+       if i.tab == nil || t != *(**_type)(i.tab) {
                typedmemclr(t, ret)
                return false
        } else {
@@ -485,7 +485,7 @@ func ifaceT2Ip(to, from *_type) bool {
                        ri++
                }
 
-               if !eqtype(fromMethod.mtyp, toMethod.typ) {
+               if fromMethod.mtyp != toMethod.typ {
                        return false
                }
 
Index: libgo/go/runtime/type.go
===================================================================
--- libgo/go/runtime/type.go    (revision 272577)
+++ libgo/go/runtime/type.go    (working copy)
@@ -48,11 +48,6 @@ func (t *_type) pkgpath() string {
        return ""
 }
 
-// Return whether two type descriptors are equal.
-func eqtype(t1, t2 *_type) bool {
-       return t1 == t2
-}
-
 type method struct {
        name    *string
        pkgPath *string

Reply via email to