ssa: fix abiType && abiMethoOf

This commit is contained in:
visualfc
2024-06-23 06:51:09 +08:00
parent 5238c2457d
commit 16352df5b1
17 changed files with 3064 additions and 4409 deletions

View File

@@ -126,16 +126,10 @@ func (b Builder) MakeInterface(tinter Type, x Expr) (ret Expr) {
default:
panic("todo")
}
// abi.Type.Kind_ |= abi.KindDirectIface
pkind := b.FieldAddr(tabi, 6)
b.Store(pkind, b.BinOp(token.OR, b.Load(pkind), Expr{prog.IntVal(kindDirectIface, prog.Byte()).impl, prog.Byte()}))
data := llvm.CreateIntToPtr(b.impl, u, prog.tyVoidPtr())
return Expr{b.unsafeInterface(rawIntf, tabi, data), tinter}
}
// abi.KindDirectIface
const kindDirectIface = 1 << 5
func (b Builder) valFromData(typ Type, data llvm.Value) Expr {
prog := b.Prog
kind, real, lvl := abi.DataKindOf(typ.raw.Type, 0, prog.is32Bits)