]> git.lizzy.rs Git - rust.git/commitdiff
renames EvalContext to InterpretCx
authorkenta7777 <k.hasegw7@gmail.com>
Wed, 27 Mar 2019 08:58:11 +0000 (17:58 +0900)
committerkenta7777 <k.hasegw7@gmail.com>
Sat, 30 Mar 2019 01:58:28 +0000 (10:58 +0900)
src/fn_call.rs
src/lib.rs

index b496a9b7d41d7327daf1947da77458f8a6c1387a..3c6384e1a79efb19bbbe8e5886834e074bd179e7 100644 (file)
@@ -255,7 +255,7 @@ fn emulate_foreign_item(
                 trace!("__rust_maybe_catch_panic: {:?}", f_instance);
 
                 // Now we make a function call.
-                // TODO: consider making this reusable? `EvalContext::step` does something similar
+                // TODO: consider making this reusable? `InterpretCx::step` does something similar
                 // for the TLS destructors, and of course `eval_main`.
                 let mir = this.load_mir(f_instance.def)?;
                 let ret_place = MPlaceTy::dangling(this.layout_of(this.tcx.mk_unit())?, this).into();
index ee739a5435acc7b7a9e245ba99fbdf15513d756b..be58c6a6a464262661532a90073af66ad5cce895 100644 (file)
@@ -67,8 +67,8 @@ pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
     tcx: TyCtxt<'a, 'tcx, 'tcx>,
     main_id: DefId,
     config: MiriConfig,
-) -> EvalResult<'tcx, EvalContext<'a, 'mir, 'tcx, Evaluator<'tcx>>> {
-    let mut ecx = EvalContext::new(
+) -> EvalResult<'tcx, InterpretCx<'a, 'mir, 'tcx, Evaluator<'tcx>>> {
+    let mut ecx = InterpretCx::new(
         tcx.at(syntax::source_map::DUMMY_SP),
         ty::ParamEnv::reveal_all(),
         Evaluator::new(config.validate),
@@ -345,7 +345,7 @@ fn new(validate: bool) -> Self {
 
 // FIXME: rustc issue <https://github.com/rust-lang/rust/issues/47131>.
 #[allow(dead_code)]
-type MiriEvalContext<'a, 'mir, 'tcx> = EvalContext<'a, 'mir, 'tcx, Evaluator<'tcx>>;
+type MiriEvalContext<'a, 'mir, 'tcx> = InterpretCx<'a, 'mir, 'tcx, Evaluator<'tcx>>;
 
 // A little trait that's useful to be inherited by extension traits.
 pub trait MiriEvalContextExt<'a, 'mir, 'tcx> {
@@ -376,14 +376,14 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
     const STATIC_KIND: Option<MiriMemoryKind> = Some(MiriMemoryKind::MutStatic);
 
     #[inline(always)]
-    fn enforce_validity(ecx: &EvalContext<'a, 'mir, 'tcx, Self>) -> bool {
+    fn enforce_validity(ecx: &InterpretCx<'a, 'mir, 'tcx, Self>) -> bool {
         ecx.machine.validate
     }
 
     /// Returns `Ok()` when the function was handled; fail otherwise.
     #[inline(always)]
     fn find_fn(
-        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
         instance: ty::Instance<'tcx>,
         args: &[OpTy<'tcx, Borrow>],
         dest: Option<PlaceTy<'tcx, Borrow>>,
@@ -394,7 +394,7 @@ fn find_fn(
 
     #[inline(always)]
     fn call_intrinsic(
-        ecx: &mut rustc_mir::interpret::EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &mut rustc_mir::interpret::InterpretCx<'a, 'mir, 'tcx, Self>,
         instance: ty::Instance<'tcx>,
         args: &[OpTy<'tcx, Borrow>],
         dest: PlaceTy<'tcx, Borrow>,
@@ -404,7 +404,7 @@ fn call_intrinsic(
 
     #[inline(always)]
     fn ptr_op(
-        ecx: &rustc_mir::interpret::EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &rustc_mir::interpret::InterpretCx<'a, 'mir, 'tcx, Self>,
         bin_op: mir::BinOp,
         left: ImmTy<'tcx, Borrow>,
         right: ImmTy<'tcx, Borrow>,
@@ -413,7 +413,7 @@ fn ptr_op(
     }
 
     fn box_alloc(
-        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
         dest: PlaceTy<'tcx, Borrow>,
     ) -> EvalResult<'tcx> {
         trace!("box_alloc for {:?}", dest.layout.ty);
@@ -481,7 +481,7 @@ fn find_foreign_static(
     }
 
     #[inline(always)]
-    fn before_terminator(_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>
+    fn before_terminator(_ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>) -> EvalResult<'tcx>
     {
         // We are not interested in detecting loops.
         Ok(())
@@ -511,7 +511,7 @@ fn adjust_static_allocation<'b>(
     }
 
     fn tag_dereference(
-        ecx: &EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &InterpretCx<'a, 'mir, 'tcx, Self>,
         place: MPlaceTy<'tcx, Borrow>,
         mutability: Option<hir::Mutability>,
     ) -> EvalResult<'tcx, Scalar<Borrow>> {
@@ -532,7 +532,7 @@ fn tag_dereference(
 
     #[inline(always)]
     fn tag_new_allocation(
-        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
         ptr: Pointer,
         kind: MemoryKind<Self::MemoryKinds>,
     ) -> Pointer<Borrow> {
@@ -547,7 +547,7 @@ fn tag_new_allocation(
 
     #[inline(always)]
     fn retag(
-        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
         kind: mir::RetagKind,
         place: PlaceTy<'tcx, Borrow>,
     ) -> EvalResult<'tcx> {
@@ -565,14 +565,14 @@ fn retag(
 
     #[inline(always)]
     fn stack_push(
-        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
     ) -> EvalResult<'tcx, stacked_borrows::CallId> {
         Ok(ecx.memory().extra.borrow_mut().new_call())
     }
 
     #[inline(always)]
     fn stack_pop(
-        ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
+        ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
         extra: stacked_borrows::CallId,
     ) -> EvalResult<'tcx> {
         Ok(ecx.memory().extra.borrow_mut().end_call(extra))