diff options
| author | kennytm <kennytm@gmail.com> | 2018-11-06 15:21:07 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-11-06 17:08:25 +0800 |
| commit | 8b3d9e5effaaeb19dfe13e82b3f238d43ec4c8b8 (patch) | |
| tree | 05429f561a9d96cff1994d4fb87a949d4cb2c52e | |
| parent | 435aca1c8f06c184099d71841e85462603aecb56 (diff) | |
| parent | c9054977663207e16aecc121d46a6ecb56a5774b (diff) | |
| download | rust-8b3d9e5effaaeb19dfe13e82b3f238d43ec4c8b8.tar.gz rust-8b3d9e5effaaeb19dfe13e82b3f238d43ec4c8b8.zip | |
Rollup merge of #55689 - RalfJung:miri-immediate, r=oli-obk
miri: binary_op_val -> binary_op_imm Seems like this was overlooked during the value -> immediate rename. r? @oli-obk
| -rw-r--r-- | src/librustc_mir/interpret/intrinsics.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/operator.rs | 8 | ||||
| -rw-r--r-- | src/librustc_mir/transform/const_prop.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_mir/interpret/intrinsics.rs b/src/librustc_mir/interpret/intrinsics.rs index bed938a534f..cb2a750f4e3 100644 --- a/src/librustc_mir/interpret/intrinsics.rs +++ b/src/librustc_mir/interpret/intrinsics.rs @@ -140,7 +140,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> "unchecked_shr" => BinOp::Shr, _ => bug!("Already checked for int ops") }; - let (val, overflowed) = self.binary_op_val(bin_op, l, r)?; + let (val, overflowed) = self.binary_op_imm(bin_op, l, r)?; if overflowed { let layout = self.layout_of(substs.type_at(0))?; let r_val = r.to_scalar()?.to_bits(layout.size)?; diff --git a/src/librustc_mir/interpret/operator.rs b/src/librustc_mir/interpret/operator.rs index 2c6b8732fdb..31824d5ec4a 100644 --- a/src/librustc_mir/interpret/operator.rs +++ b/src/librustc_mir/interpret/operator.rs @@ -28,7 +28,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> right: ImmTy<'tcx, M::PointerTag>, dest: PlaceTy<'tcx, M::PointerTag>, ) -> EvalResult<'tcx> { - let (val, overflowed) = self.binary_op_val(op, left, right)?; + let (val, overflowed) = self.binary_op_imm(op, left, right)?; let val = Immediate::ScalarPair(val.into(), Scalar::from_bool(overflowed).into()); self.write_immediate(val, dest) } @@ -42,7 +42,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> right: ImmTy<'tcx, M::PointerTag>, dest: PlaceTy<'tcx, M::PointerTag>, ) -> EvalResult<'tcx> { - let (val, _overflowed) = self.binary_op_val(op, left, right)?; + let (val, _overflowed) = self.binary_op_imm(op, left, right)?; self.write_scalar(val, dest) } } @@ -283,9 +283,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> } /// Convenience wrapper that's useful when keeping the layout together with the - /// value. + /// immediate value. #[inline] - pub fn binary_op_val( + pub fn binary_op_imm( &self, bin_op: mir::BinOp, left: ImmTy<'tcx, M::PointerTag>, diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs index 52ef37ab40e..4f92ba40048 100644 --- a/src/librustc_mir/transform/const_prop.rs +++ b/src/librustc_mir/transform/const_prop.rs @@ -455,7 +455,7 @@ impl<'a, 'mir, 'tcx> ConstPropagator<'a, 'mir, 'tcx> { })?; trace!("const evaluating {:?} for {:?} and {:?}", op, left, right); let (val, overflow) = self.use_ecx(source_info, |this| { - this.ecx.binary_op_val(op, l, r) + this.ecx.binary_op_imm(op, l, r) })?; let val = if let Rvalue::CheckedBinaryOp(..) = *rvalue { Immediate::ScalarPair( |
