1
Fork 0

Fix cranelift build

This commit is contained in:
oli 2020-10-29 13:30:47 +00:00
parent c478574786
commit 3a7970848c
6 changed files with 28 additions and 10 deletions

View file

@ -499,7 +499,7 @@ fn codegen_stmt<'tcx>(
UnOp::Neg => match layout.ty.kind() {
ty::Int(IntTy::I128) => {
// FIXME remove this case once ineg.i128 works
let zero = CValue::const_val(fx, layout, 0);
let zero = CValue::const_val(fx, layout, ty::ScalarInt::null(layout.size));
crate::num::codegen_int_binop(fx, BinOp::Sub, zero, operand)
}
ty::Int(_) => CValue::by_val(fx.bcx.ins().ineg(val), layout),
@ -592,6 +592,7 @@ fn codegen_stmt<'tcx>(
} else {
discr.val
};
let discr = discr.into();
let discr = CValue::const_val(fx, fx.layout_of(to_ty), discr);
lval.write_cvalue(fx, discr);