llgo/ssa: unsafeInterface; runtime.PointerTo

This commit is contained in:
xushiwei
2024-05-27 08:07:34 +08:00
parent 12b0d81dda
commit 165a99fd83
8 changed files with 220 additions and 89 deletions

View File

@@ -125,6 +125,7 @@ type aProgram struct {
rtStringTy llvm.Type
rtEfaceTy llvm.Type
rtIfaceTy llvm.Type
rtSliceTy llvm.Type
rtMapTy llvm.Type
@@ -149,7 +150,6 @@ type aProgram struct {
pyObjPPtr Type
abiTyptr Type
abiTypptr Type
//efaceTy Type
pyImpTy *types.Signature
pyNewList *types.Signature
@@ -256,6 +256,13 @@ func (p Program) rtEface() llvm.Type {
return p.rtEfaceTy
}
func (p Program) rtIface() llvm.Type {
if p.rtIfaceTy.IsNil() {
p.rtIfaceTy = p.rtType("Iface").ll
}
return p.rtIfaceTy
}
func (p Program) rtMap() llvm.Type {
if p.rtMapTy.IsNil() {
p.rtMapTy = p.rtType("Map").ll