mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 12:39:31 +03:00
Remove special case in rvalue codegen.
This commit is contained in:
@@ -652,18 +652,6 @@ pub fn codegen_scalar_checked_binop(
|
||||
rhs: Bx::Value,
|
||||
input_ty: Ty<'tcx>,
|
||||
) -> OperandValue<Bx::Value> {
|
||||
// This case can currently arise only from functions marked
|
||||
// with #[rustc_inherit_overflow_checks] and inlined from
|
||||
// another crate (mostly core::num generic/#[inline] fns),
|
||||
// while the current crate doesn't use overflow checks.
|
||||
//
|
||||
// As an optimization, we emit an unchecked binop when overflow checks are disabled,
|
||||
// as the overflow flag would be ignored anyway.
|
||||
if !bx.cx().check_overflow() {
|
||||
let val = self.codegen_scalar_binop(bx, op, lhs, rhs, input_ty);
|
||||
return OperandValue::Pair(val, bx.cx().const_bool(false));
|
||||
}
|
||||
|
||||
let (val, of) = match op {
|
||||
// These are checked using intrinsics
|
||||
mir::BinOp::Add | mir::BinOp::Sub | mir::BinOp::Mul => {
|
||||
|
||||
Reference in New Issue
Block a user