From 6af821f20205e449ab022d04e669c8063b6b9cb4 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 10 Jun 2016 16:20:17 +0200 Subject: [PATCH] rename GlobalEvalContext to EvalContext --- src/bin/miri.rs | 6 +++--- src/interpreter/mod.rs | 8 ++++---- src/interpreter/stepper.rs | 8 ++++---- src/lib.rs | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bin/miri.rs b/src/bin/miri.rs index cec244a5c74..f4e7ea0d7f0 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -11,7 +11,7 @@ extern crate syntax; #[macro_use] extern crate log; use miri::{ - GlobalEvalContext, + EvalContext, CachedMir, step, EvalError, @@ -59,7 +59,7 @@ fn interpret_start_points<'a, 'tcx>( debug!("Interpreting: {}", item.name); - let mut gecx = GlobalEvalContext::new(tcx, mir_map); + let mut gecx = EvalContext::new(tcx, mir_map); let substs = tcx.mk_substs(subst::Substs::empty()); let return_ptr = gecx.alloc_ret_ptr(mir.return_ty, substs); @@ -86,7 +86,7 @@ fn interpret_start_points<'a, 'tcx>( } } -fn report(tcx: TyCtxt, gecx: &GlobalEvalContext, e: EvalError) { +fn report(tcx: TyCtxt, gecx: &EvalContext, e: EvalError) { let frame = gecx.stack().last().expect("stackframe was empty"); let block = frame.mir.basic_block_data(frame.next_block); let span = if frame.stmt < block.statements.len() { diff --git a/src/interpreter/mod.rs b/src/interpreter/mod.rs index 3b08a0ff62d..9fcb2da36b5 100644 --- a/src/interpreter/mod.rs +++ b/src/interpreter/mod.rs @@ -24,11 +24,11 @@ use std::collections::HashMap; mod stepper; -pub fn step<'fncx, 'a: 'fncx, 'tcx: 'a>(gecx: &'fncx mut GlobalEvalContext<'a, 'tcx>) -> EvalResult { +pub fn step<'fncx, 'a: 'fncx, 'tcx: 'a>(gecx: &'fncx mut EvalContext<'a, 'tcx>) -> EvalResult { stepper::Stepper::new(gecx).step() } -pub struct GlobalEvalContext<'a, 'tcx: 'a> { +pub struct EvalContext<'a, 'tcx: 'a> { /// The results of the type checker, from rustc. tcx: TyCtxt<'a, 'tcx, 'tcx>, @@ -123,9 +123,9 @@ enum ConstantKind { Global, } -impl<'a, 'tcx> GlobalEvalContext<'a, 'tcx> { +impl<'a, 'tcx> EvalContext<'a, 'tcx> { pub fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>, mir_map: &'a MirMap<'tcx>) -> Self { - GlobalEvalContext { + EvalContext { tcx: tcx, mir_map: mir_map, mir_cache: RefCell::new(DefIdMap()), diff --git a/src/interpreter/stepper.rs b/src/interpreter/stepper.rs index 942c913ccf9..7e1b328a4ee 100644 --- a/src/interpreter/stepper.rs +++ b/src/interpreter/stepper.rs @@ -1,7 +1,7 @@ use super::{ CachedMir, ConstantId, - GlobalEvalContext, + EvalContext, ConstantKind, }; use error::EvalResult; @@ -13,11 +13,11 @@ use syntax::codemap::Span; use std::rc::Rc; pub(super) struct Stepper<'fncx, 'a: 'fncx, 'tcx: 'a>{ - gecx: &'fncx mut GlobalEvalContext<'a, 'tcx>, + gecx: &'fncx mut EvalContext<'a, 'tcx>, } impl<'fncx, 'a, 'tcx> Stepper<'fncx, 'a, 'tcx> { - pub(super) fn new(gecx: &'fncx mut GlobalEvalContext<'a, 'tcx>) -> Self { + pub(super) fn new(gecx: &'fncx mut EvalContext<'a, 'tcx>) -> Self { Stepper { gecx: gecx, } @@ -98,7 +98,7 @@ impl<'fncx, 'a, 'tcx> Stepper<'fncx, 'a, 'tcx> { // The reason for this is, that `push_stack_frame` modifies the stack out of obvious reasons struct ConstantExtractor<'a, 'b: 'a, 'tcx: 'b> { span: Span, - gecx: &'a mut GlobalEvalContext<'b, 'tcx>, + gecx: &'a mut EvalContext<'b, 'tcx>, mir: &'a mir::Mir<'tcx>, def_id: DefId, substs: &'tcx subst::Substs<'tcx>, diff --git a/src/lib.rs b/src/lib.rs index c5d74993dcc..c3369878f35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,7 +30,7 @@ pub use error::{ }; pub use interpreter::{ - GlobalEvalContext, + EvalContext, step, Frame, CachedMir,