CFuncPtr.Hash

This commit is contained in:
xushiwei
2024-05-03 18:02:09 +08:00
parent 13a1c8ac4b
commit 236debab33
2 changed files with 49 additions and 36 deletions

View File

@@ -18,6 +18,8 @@ package ssa
import (
"go/types"
"github.com/goplus/llgo/internal/typeutil"
)
// -----------------------------------------------------------------------------
@@ -46,6 +48,10 @@ type CFuncPtr types.Signature
func (t *CFuncPtr) String() string { return (*types.Signature)(t).String() }
func (t *CFuncPtr) Underlying() types.Type { return (*types.Signature)(t) }
func (t *CFuncPtr) Hash(h typeutil.Hasher) uint32 {
return typeutil.HashSig(h, (*types.Signature)(t))*13 + 97
}
// -----------------------------------------------------------------------------
// CType convert a C type into Go.