make some things public for the benefit of priroda

This commit is contained in:
Ralf Jung 2018-10-24 11:39:31 +02:00
parent 356369dd08
commit a34b9c7b70
2 changed files with 24 additions and 4 deletions

View file

@ -44,8 +44,12 @@ use range_map::RangeMap;
#[allow(unused_imports)] // FIXME rustc bug https://github.com/rust-lang/rust/issues/53682
use helpers::{ScalarExt, EvalContextExt as HelpersEvalContextExt};
use mono_hash_map::MonoHashMap;
use stacked_borrows::{EvalContextExt as StackedBorEvalContextExt, Borrow};
use stacked_borrows::{EvalContextExt as StackedBorEvalContextExt};
// Used by priroda
pub use stacked_borrows::{Borrow, Stacks, Mut as MutBorrow};
// Used by priroda
pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
main_id: DefId,

View file

@ -21,12 +21,20 @@ pub enum Mut {
impl Mut {
#[inline(always)]
fn is_raw(self) -> bool {
pub fn is_raw(self) -> bool {
match self {
Mut::Raw => true,
_ => false,
}
}
#[inline(always)]
pub fn is_uniq(self) -> bool {
match self {
Mut::Uniq(_) => true,
_ => false,
}
}
}
/// Information about any kind of borrow
@ -40,9 +48,17 @@ pub enum Borrow {
impl Borrow {
#[inline(always)]
fn is_uniq(self) -> bool {
pub fn is_uniq(self) -> bool {
match self {
Borrow::Mut(Mut::Uniq(_)) => true,
Borrow::Mut(m) => m.is_uniq(),
_ => false,
}
}
#[inline(always)]
pub fn is_frz(self) -> bool {
match self {
Borrow::Frz(_) => true,
_ => false,
}
}