rename GlobalEvalContext to EvalContext
This commit is contained in:
parent
b3c1713b89
commit
6af821f202
@ -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() {
|
||||
|
@ -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<bool> {
|
||||
pub fn step<'fncx, 'a: 'fncx, 'tcx: 'a>(gecx: &'fncx mut EvalContext<'a, 'tcx>) -> EvalResult<bool> {
|
||||
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()),
|
||||
|
@ -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>,
|
||||
|
@ -30,7 +30,7 @@ pub use error::{
|
||||
};
|
||||
|
||||
pub use interpreter::{
|
||||
GlobalEvalContext,
|
||||
EvalContext,
|
||||
step,
|
||||
Frame,
|
||||
CachedMir,
|
||||
|
Loading…
x
Reference in New Issue
Block a user