diff options
| author | Caleb Behunin <calebrobot88@gmail.com> | 2019-09-08 22:17:10 -0700 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-10-19 21:34:01 +0200 |
| commit | 2e36c84ebd48648b9c808f6e8dba5d8e49f47f3c (patch) | |
| tree | 9dbc0681d9ac2ed00f867a31734285b6865d647f /src/librustc_codegen_ssa | |
| parent | c49187530d1e5599101ff74bcf3f82888e768def (diff) | |
| download | rust-2e36c84ebd48648b9c808f6e8dba5d8e49f47f3c.tar.gz rust-2e36c84ebd48648b9c808f6e8dba5d8e49f47f3c.zip | |
Remove unreachable unit tuple compare binop codegen
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/mir/rvalue.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/librustc_codegen_ssa/mir/rvalue.rs b/src/librustc_codegen_ssa/mir/rvalue.rs index 27442bb6bff..7e662ea37db 100644 --- a/src/librustc_codegen_ssa/mir/rvalue.rs +++ b/src/librustc_codegen_ssa/mir/rvalue.rs @@ -556,7 +556,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { ) -> Bx::Value { let is_float = input_ty.is_floating_point(); let is_signed = input_ty.is_signed(); - let is_unit = input_ty.is_unit(); match op { mir::BinOp::Add => if is_float { bx.fadd(lhs, rhs) @@ -594,13 +593,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { mir::BinOp::Shl => common::build_unchecked_lshift(bx, lhs, rhs), mir::BinOp::Shr => common::build_unchecked_rshift(bx, input_ty, lhs, rhs), mir::BinOp::Ne | mir::BinOp::Lt | mir::BinOp::Gt | - mir::BinOp::Eq | mir::BinOp::Le | mir::BinOp::Ge => if is_unit { - bx.cx().const_bool(match op { - mir::BinOp::Ne | mir::BinOp::Lt | mir::BinOp::Gt => false, - mir::BinOp::Eq | mir::BinOp::Le | mir::BinOp::Ge => true, - _ => unreachable!() - }) - } else if is_float { + mir::BinOp::Eq | mir::BinOp::Le | mir::BinOp::Ge => if is_float { bx.fcmp( base::bin_op_to_fcmp_predicate(op.to_hir_binop()), lhs, rhs |
