Skip to content

Commit ac61d29

Browse files
authored
Merge pull request #668 from kenta7777/rename-evalcontext-to-interpretcx
Renames `EvalContext` to `InterpretCx`
2 parents 11cbfd7 + adbda8c commit ac61d29

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-03-20
1+
nightly-2019-03-29

src/fn_call.rs

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

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

src/lib.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
6767
tcx: TyCtxt<'a, 'tcx, 'tcx>,
6868
main_id: DefId,
6969
config: MiriConfig,
70-
) -> EvalResult<'tcx, EvalContext<'a, 'mir, 'tcx, Evaluator<'tcx>>> {
71-
let mut ecx = EvalContext::new(
70+
) -> EvalResult<'tcx, InterpretCx<'a, 'mir, 'tcx, Evaluator<'tcx>>> {
71+
let mut ecx = InterpretCx::new(
7272
tcx.at(syntax::source_map::DUMMY_SP),
7373
ty::ParamEnv::reveal_all(),
7474
Evaluator::new(config.validate),
@@ -345,7 +345,7 @@ impl<'tcx> Evaluator<'tcx> {
345345

346346
// FIXME: rustc issue <https://github.com/rust-lang/rust/issues/47131>.
347347
#[allow(dead_code)]
348-
type MiriEvalContext<'a, 'mir, 'tcx> = EvalContext<'a, 'mir, 'tcx, Evaluator<'tcx>>;
348+
type MiriEvalContext<'a, 'mir, 'tcx> = InterpretCx<'a, 'mir, 'tcx, Evaluator<'tcx>>;
349349

350350
// A little trait that's useful to be inherited by extension traits.
351351
pub trait MiriEvalContextExt<'a, 'mir, 'tcx> {
@@ -376,14 +376,14 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
376376
const STATIC_KIND: Option<MiriMemoryKind> = Some(MiriMemoryKind::MutStatic);
377377

378378
#[inline(always)]
379-
fn enforce_validity(ecx: &EvalContext<'a, 'mir, 'tcx, Self>) -> bool {
379+
fn enforce_validity(ecx: &InterpretCx<'a, 'mir, 'tcx, Self>) -> bool {
380380
ecx.machine.validate
381381
}
382382

383383
/// Returns `Ok()` when the function was handled; fail otherwise.
384384
#[inline(always)]
385385
fn find_fn(
386-
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
386+
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
387387
instance: ty::Instance<'tcx>,
388388
args: &[OpTy<'tcx, Borrow>],
389389
dest: Option<PlaceTy<'tcx, Borrow>>,
@@ -394,7 +394,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
394394

395395
#[inline(always)]
396396
fn call_intrinsic(
397-
ecx: &mut rustc_mir::interpret::EvalContext<'a, 'mir, 'tcx, Self>,
397+
ecx: &mut rustc_mir::interpret::InterpretCx<'a, 'mir, 'tcx, Self>,
398398
instance: ty::Instance<'tcx>,
399399
args: &[OpTy<'tcx, Borrow>],
400400
dest: PlaceTy<'tcx, Borrow>,
@@ -404,7 +404,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
404404

405405
#[inline(always)]
406406
fn ptr_op(
407-
ecx: &rustc_mir::interpret::EvalContext<'a, 'mir, 'tcx, Self>,
407+
ecx: &rustc_mir::interpret::InterpretCx<'a, 'mir, 'tcx, Self>,
408408
bin_op: mir::BinOp,
409409
left: ImmTy<'tcx, Borrow>,
410410
right: ImmTy<'tcx, Borrow>,
@@ -413,7 +413,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
413413
}
414414

415415
fn box_alloc(
416-
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
416+
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
417417
dest: PlaceTy<'tcx, Borrow>,
418418
) -> EvalResult<'tcx> {
419419
trace!("box_alloc for {:?}", dest.layout.ty);
@@ -481,7 +481,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
481481
}
482482

483483
#[inline(always)]
484-
fn before_terminator(_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>
484+
fn before_terminator(_ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>
485485
{
486486
// We are not interested in detecting loops.
487487
Ok(())
@@ -511,7 +511,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
511511
}
512512

513513
fn tag_dereference(
514-
ecx: &EvalContext<'a, 'mir, 'tcx, Self>,
514+
ecx: &InterpretCx<'a, 'mir, 'tcx, Self>,
515515
place: MPlaceTy<'tcx, Borrow>,
516516
mutability: Option<hir::Mutability>,
517517
) -> EvalResult<'tcx, Scalar<Borrow>> {
@@ -532,7 +532,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
532532

533533
#[inline(always)]
534534
fn tag_new_allocation(
535-
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
535+
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
536536
ptr: Pointer,
537537
kind: MemoryKind<Self::MemoryKinds>,
538538
) -> Pointer<Borrow> {
@@ -547,7 +547,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
547547

548548
#[inline(always)]
549549
fn retag(
550-
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
550+
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
551551
kind: mir::RetagKind,
552552
place: PlaceTy<'tcx, Borrow>,
553553
) -> EvalResult<'tcx> {
@@ -565,14 +565,14 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
565565

566566
#[inline(always)]
567567
fn stack_push(
568-
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
568+
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
569569
) -> EvalResult<'tcx, stacked_borrows::CallId> {
570570
Ok(ecx.memory().extra.borrow_mut().new_call())
571571
}
572572

573573
#[inline(always)]
574574
fn stack_pop(
575-
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
575+
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
576576
extra: stacked_borrows::CallId,
577577
) -> EvalResult<'tcx> {
578578
Ok(ecx.memory().extra.borrow_mut().end_call(extra))

0 commit comments

Comments
 (0)