llgo/internal/runtime

This commit is contained in:
xushiwei
2024-04-27 13:57:21 +08:00
parent 39076c75cf
commit f1761c0c9c
6 changed files with 134 additions and 0 deletions

View File

@@ -23,6 +23,10 @@ import (
"github.com/goplus/llvm"
)
var (
tyAny = types.NewInterfaceType(nil, nil)
)
// -----------------------------------------------------------------------------
type valueKind = int
@@ -237,6 +241,9 @@ func (p Program) toLLVMType(typ types.Type) Type {
case *types.Pointer:
elem := p.Type(t.Elem())
return &aType{llvm.PointerType(elem.ll, 0), typ, vkInvalid}
case *types.Interface:
tyIface := p.runtime().Lookup("Interface").(*types.TypeName).Type().(*types.Named)
return p.toLLVMNamed(tyIface)
case *types.Slice:
case *types.Map:
case *types.Struct: