llgo/ssa: MakeInterface

This commit is contained in:
xushiwei
2024-04-29 22:57:40 +08:00
parent 85bb1302ca
commit f64abf37ab
7 changed files with 40 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ import (
"github.com/goplus/llgo/internal/abi"
)
type Interface = iface
// -----------------------------------------------------------------------------
type InterfaceType = abi.InterfaceType
@@ -30,6 +30,10 @@ var (
TyAny = &InterfaceType{}
)
// -----------------------------------------------------------------------------
type Interface = iface
func MakeAnyInt(typ *Type, data uintptr) Interface {
return Interface{
tab: &itab{inter: TyAny, _type: typ, hash: 0, fun: [1]uintptr{0}},
@@ -71,3 +75,5 @@ func CheckI2Int(v Interface, t *Type) (uintptr, bool) {
}
return 0, false
}
// -----------------------------------------------------------------------------