merge upstream
This commit is contained in:
16
ssa/expr.go
16
ssa/expr.go
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user