1
Fork 0

make some pieces public that are required by priroda

This commit is contained in:
Oliver Schneider 2016-10-20 13:10:22 +02:00
parent 330be7766f
commit ed679c3d23
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46
2 changed files with 11 additions and 3 deletions

View file

@ -17,7 +17,7 @@ use syntax::codemap::{self, DUMMY_SP};
use error::{EvalError, EvalResult}; use error::{EvalError, EvalResult};
use memory::{Memory, Pointer, AllocId}; use memory::{Memory, Pointer, AllocId};
use primval::{self, PrimVal, PrimValKind}; use primval::{self, PrimVal, PrimValKind};
use self::value::Value; pub use self::value::Value;
use std::collections::HashMap; use std::collections::HashMap;
@ -1462,7 +1462,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
} }
impl<'a, 'tcx: 'a> Frame<'a, 'tcx> { impl<'a, 'tcx: 'a> Frame<'a, 'tcx> {
fn get_local(&self, local: mir::Local) -> Option<Value> { pub fn get_local(&self, local: mir::Local) -> Option<Value> {
// Subtract 1 because we don't store a value for the ReturnPointer, the local with index 0. // Subtract 1 because we don't store a value for the ReturnPointer, the local with index 0.
self.locals[local.index() - 1] self.locals[local.index() - 1]
} }
@ -1474,7 +1474,7 @@ impl<'a, 'tcx: 'a> Frame<'a, 'tcx> {
} }
impl Lvalue { impl Lvalue {
fn from_ptr(ptr: Pointer) -> Self { pub fn from_ptr(ptr: Pointer) -> Self {
Lvalue::Ptr { ptr: ptr, extra: LvalueExtra::None } Lvalue::Ptr { ptr: ptr, extra: LvalueExtra::None }
} }

View file

@ -36,6 +36,9 @@ pub use interpreter::{
eval_main, eval_main,
run_mir_passes, run_mir_passes,
StackPopCleanup, StackPopCleanup,
Value,
Lvalue,
LvalueExtra,
}; };
pub use memory::{ pub use memory::{
@ -43,3 +46,8 @@ pub use memory::{
Pointer, Pointer,
AllocId, AllocId,
}; };
pub use primval::{
PrimVal,
PrimValKind,
};