merge upstream

This commit is contained in:
xushiwei
2024-06-12 21:02:26 +08:00
21 changed files with 6462 additions and 367 deletions

View File

@@ -421,6 +421,22 @@ func (b Builder) BinOp(op token.Token, x, y Expr) Expr {
ret.impl = llvm.CreateNot(b.impl, ret.impl)
return ret
}
case vkIface, vkEface:
prog := b.Prog
toEface := func(x Expr, emtpy bool) Expr {
if emtpy {
return x
}
return Expr{b.unsafeEface(b.faceAbiType(x).impl, b.faceData(x.impl)), prog.rtType("Eface")}
}
switch op {
case token.EQL:
return b.InlineCall(b.Pkg.rtFunc("EfaceEqual"), toEface(x, x.kind == vkEface), toEface(y, y.kind == vkEface))
case token.NEQ:
ret := b.InlineCall(b.Pkg.rtFunc("EfaceEqual"), toEface(x, x.kind == vkEface), toEface(y, y.kind == vkEface))
ret.impl = llvm.CreateNot(b.impl, ret.impl)
return ret
}
}
}
panic("todo")