things priroda needs to be public or changed
This commit is contained in:
@@ -154,7 +154,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn memory(&self) -> &Memory {
|
pub fn memory(&self) -> &Memory<'a, 'tcx> {
|
||||||
&self.memory
|
&self.memory
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
|
|||||||
&mut self.memory
|
&mut self.memory
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn stack(&self) -> &[Frame] {
|
pub fn stack(&self) -> &[Frame<'a, 'tcx>] {
|
||||||
&self.stack
|
&self.stack
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
|
|||||||
ty.is_sized(self.tcx, &self.tcx.empty_parameter_environment(), DUMMY_SP)
|
ty.is_sized(self.tcx, &self.tcx.empty_parameter_environment(), DUMMY_SP)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_mir(&self, def_id: DefId) -> CachedMir<'a, 'tcx> {
|
pub fn load_mir(&self, def_id: DefId) -> CachedMir<'a, 'tcx> {
|
||||||
match self.tcx.map.as_local_node_id(def_id) {
|
match self.tcx.map.as_local_node_id(def_id) {
|
||||||
Some(node_id) => CachedMir::Ref(self.mir_map.map.get(&node_id).unwrap()),
|
Some(node_id) => CachedMir::Ref(self.mir_map.map.get(&node_id).unwrap()),
|
||||||
None => {
|
None => {
|
||||||
@@ -255,7 +255,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn monomorphize(&self, ty: Ty<'tcx>, substs: &'tcx Substs<'tcx>) -> Ty<'tcx> {
|
pub fn monomorphize(&self, ty: Ty<'tcx>, substs: &'tcx Substs<'tcx>) -> Ty<'tcx> {
|
||||||
let substituted = ty.subst(self.tcx, substs);
|
let substituted = ty.subst(self.tcx, substs);
|
||||||
self.tcx.normalize_associated_type(&substituted)
|
self.tcx.normalize_associated_type(&substituted)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,8 @@ pub use interpreter::{
|
|||||||
eval_main,
|
eval_main,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use memory::Memory;
|
pub use memory::{
|
||||||
|
Memory,
|
||||||
|
Pointer,
|
||||||
|
AllocId,
|
||||||
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use primval::PrimVal;
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
|
||||||
pub struct AllocId(u64);
|
pub struct AllocId(pub u64);
|
||||||
|
|
||||||
impl fmt::Display for AllocId {
|
impl fmt::Display for AllocId {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
@@ -77,6 +77,10 @@ impl<'a, 'tcx> Memory<'a, 'tcx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn allocations<'b>(&'b self) -> ::std::collections::hash_map::Iter<'b, AllocId, Allocation> {
|
||||||
|
self.alloc_map.iter()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn create_fn_ptr(&mut self, def_id: DefId, substs: &'tcx Substs<'tcx>, fn_ty: &'tcx BareFnTy<'tcx>) -> Pointer {
|
pub fn create_fn_ptr(&mut self, def_id: DefId, substs: &'tcx Substs<'tcx>, fn_ty: &'tcx BareFnTy<'tcx>) -> Pointer {
|
||||||
let def = FunctionDefinition {
|
let def = FunctionDefinition {
|
||||||
def_id: def_id,
|
def_id: def_id,
|
||||||
@@ -576,7 +580,7 @@ impl UndefMask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Check whether the range `start..end` (end-exclusive) is entirely defined.
|
/// Check whether the range `start..end` (end-exclusive) is entirely defined.
|
||||||
fn is_range_defined(&self, start: usize, end: usize) -> bool {
|
pub fn is_range_defined(&self, start: usize, end: usize) -> bool {
|
||||||
if end > self.len { return false; }
|
if end > self.len { return false; }
|
||||||
for i in start..end {
|
for i in start..end {
|
||||||
if !self.get(i) { return false; }
|
if !self.get(i) { return false; }
|
||||||
|
|||||||
Reference in New Issue
Block a user