| 1 |
// Copyright 2020 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
// +build aix,gccgo |
| 6 |
|
| 7 |
package runtime |
| 8 |
|
| 9 |
import ( |
| 10 |
_ "unsafe" |
| 11 |
) |
| 12 |
|
| 13 |
// eqtype is a compiler-called function. |
| 14 |
// |
| 15 |
//go:linkname eqtype |
| 16 |
|
| 17 |
// Return whether two type descriptors are equal. |
| 18 |
// This is gccgo-specific, as some linkers are not able |
| 19 |
// to merge identical type descriptors coming from |
| 20 |
// different object or shared object files. |
| 21 |
func eqtype(t1, t2 *_type) bool { |
| 22 |
switch { |
| 23 |
case t1 == t2: |
| 24 |
return true |
| 25 |
case t1 == nil || t2 == nil: |
| 26 |
return false |
| 27 |
case t1.kind != t2.kind || t1.hash != t2.hash: |
| 28 |
return false |
| 29 |
default: |
| 30 |
return t1.string() == t2.string() |
| 31 |
} |
| 32 |
} |