Skip to content

Commit 1729965

Browse files
committed
rename InterpretCx -> InterpCx
1 parent f23b782 commit 1729965

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/eval.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc::hir::def_id::DefId;
88
use rustc::mir;
99

1010
use crate::{
11-
InterpResult, InterpError, InterpretCx, StackPopCleanup, struct_error,
11+
InterpResult, InterpError, InterpCx, StackPopCleanup, struct_error,
1212
Scalar, Tag, Pointer,
1313
MemoryExtra, MiriMemoryKind, Evaluator, TlsEvalContextExt,
1414
};
@@ -28,8 +28,8 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
2828
tcx: TyCtxt<'tcx>,
2929
main_id: DefId,
3030
config: MiriConfig,
31-
) -> InterpResult<'tcx, InterpretCx<'mir, 'tcx, Evaluator<'tcx>>> {
32-
let mut ecx = InterpretCx::new(
31+
) -> InterpResult<'tcx, InterpCx<'mir, 'tcx, Evaluator<'tcx>>> {
32+
let mut ecx = InterpCx::new(
3333
tcx.at(syntax::source_map::DUMMY_SP),
3434
ty::ParamEnv::reveal_all(),
3535
Evaluator::new(),
@@ -43,7 +43,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
4343
config.validate
4444
};
4545

46-
// FIXME: InterpretCx::new should take an initial MemoryExtra
46+
// FIXME: InterpCx::new should take an initial MemoryExtra
4747
ecx.memory_mut().extra = MemoryExtra::new(config.seed.map(StdRng::seed_from_u64), validate);
4848

4949
let main_instance = ty::Instance::mono(ecx.tcx.tcx, main_id);

src/machine.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ impl<'tcx> Evaluator<'tcx> {
105105
}
106106
}
107107

108-
/// A rustc InterpretCx for Miri.
109-
pub type MiriEvalContext<'mir, 'tcx> = InterpretCx<'mir, 'tcx, Evaluator<'tcx>>;
108+
/// A rustc InterpCx for Miri.
109+
pub type MiriEvalContext<'mir, 'tcx> = InterpCx<'mir, 'tcx, Evaluator<'tcx>>;
110110

111111
/// A little trait that's useful to be inherited by extension traits.
112112
pub trait MiriEvalContextExt<'mir, 'tcx> {
@@ -138,14 +138,14 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
138138
const STATIC_KIND: Option<MiriMemoryKind> = Some(MiriMemoryKind::Static);
139139

140140
#[inline(always)]
141-
fn enforce_validity(ecx: &InterpretCx<'mir, 'tcx, Self>) -> bool {
141+
fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
142142
ecx.memory().extra.validate
143143
}
144144

145145
/// Returns `Ok()` when the function was handled; fail otherwise.
146146
#[inline(always)]
147147
fn find_fn(
148-
ecx: &mut InterpretCx<'mir, 'tcx, Self>,
148+
ecx: &mut InterpCx<'mir, 'tcx, Self>,
149149
instance: ty::Instance<'tcx>,
150150
args: &[OpTy<'tcx, Tag>],
151151
dest: Option<PlaceTy<'tcx, Tag>>,
@@ -156,7 +156,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
156156

157157
#[inline(always)]
158158
fn call_intrinsic(
159-
ecx: &mut rustc_mir::interpret::InterpretCx<'mir, 'tcx, Self>,
159+
ecx: &mut rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,
160160
instance: ty::Instance<'tcx>,
161161
args: &[OpTy<'tcx, Tag>],
162162
dest: PlaceTy<'tcx, Tag>,
@@ -166,7 +166,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
166166

167167
#[inline(always)]
168168
fn ptr_op(
169-
ecx: &rustc_mir::interpret::InterpretCx<'mir, 'tcx, Self>,
169+
ecx: &rustc_mir::interpret::InterpCx<'mir, 'tcx, Self>,
170170
bin_op: mir::BinOp,
171171
left: ImmTy<'tcx, Tag>,
172172
right: ImmTy<'tcx, Tag>,
@@ -175,7 +175,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
175175
}
176176

177177
fn box_alloc(
178-
ecx: &mut InterpretCx<'mir, 'tcx, Self>,
178+
ecx: &mut InterpCx<'mir, 'tcx, Self>,
179179
dest: PlaceTy<'tcx, Tag>,
180180
) -> InterpResult<'tcx> {
181181
trace!("box_alloc for {:?}", dest.layout.ty);
@@ -241,7 +241,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
241241
}
242242

243243
#[inline(always)]
244-
fn before_terminator(_ecx: &mut InterpretCx<'mir, 'tcx, Self>) -> InterpResult<'tcx>
244+
fn before_terminator(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx>
245245
{
246246
// We are not interested in detecting loops.
247247
Ok(())
@@ -311,7 +311,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
311311

312312
#[inline(always)]
313313
fn retag(
314-
ecx: &mut InterpretCx<'mir, 'tcx, Self>,
314+
ecx: &mut InterpCx<'mir, 'tcx, Self>,
315315
kind: mir::RetagKind,
316316
place: PlaceTy<'tcx, Tag>,
317317
) -> InterpResult<'tcx> {
@@ -325,14 +325,14 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
325325

326326
#[inline(always)]
327327
fn stack_push(
328-
ecx: &mut InterpretCx<'mir, 'tcx, Self>,
328+
ecx: &mut InterpCx<'mir, 'tcx, Self>,
329329
) -> InterpResult<'tcx, stacked_borrows::CallId> {
330330
Ok(ecx.memory().extra.stacked_borrows.borrow_mut().new_call())
331331
}
332332

333333
#[inline(always)]
334334
fn stack_pop(
335-
ecx: &mut InterpretCx<'mir, 'tcx, Self>,
335+
ecx: &mut InterpCx<'mir, 'tcx, Self>,
336336
extra: stacked_borrows::CallId,
337337
) -> InterpResult<'tcx> {
338338
Ok(ecx.memory().extra.stacked_borrows.borrow_mut().end_call(extra))

src/shims/foreign_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
345345
trace!("__rust_maybe_catch_panic: {:?}", f_instance);
346346

347347
// Now we make a function call.
348-
// TODO: consider making this reusable? `InterpretCx::step` does something similar
348+
// TODO: consider making this reusable? `InterpCx::step` does something similar
349349
// for the TLS destructors, and of course `eval_main`.
350350
let mir = this.load_mir(f_instance.def)?;
351351
let ret_place = MPlaceTy::dangling(this.layout_of(this.tcx.mk_unit())?, this).into();

0 commit comments

Comments
 (0)