llgo/ssa: rtType, rtFunc

This commit is contained in:
xushiwei
2024-04-27 17:39:25 +08:00
parent f1761c0c9c
commit 6a02c3ac4c
14 changed files with 259 additions and 19 deletions

View File

@@ -242,9 +242,9 @@ func (p Program) toLLVMType(typ types.Type) Type {
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)
return p.toLLVMNamed(p.rtType("Interface"))
case *types.Slice:
return p.toLLVMNamed(p.rtType("Slice"))
case *types.Map:
case *types.Struct:
return p.toLLVMStruct(t)