pub struct AvailableSet { /* private fields */ }Expand description
The set of expressions available at a given program point.
This is essentially the “out” set from classical data-flow analysis, maintained as a simple hash map from expression key to the variable holding the result.
Implementations§
Source§impl AvailableSet
impl AvailableSet
pub fn new() -> Self
Sourcepub fn insert(
&mut self,
key: ExprKey,
var_id: LcnfVarId,
name: String,
depth: usize,
)
pub fn insert( &mut self, key: ExprKey, var_id: LcnfVarId, name: String, depth: usize, )
Insert a newly computed expression into the available set.
Sourcepub fn find(&self, key: &ExprKey) -> Option<LcnfVarId>
pub fn find(&self, key: &ExprKey) -> Option<LcnfVarId>
Look up whether key is already available, returning the variable
that holds its value if so.
Sourcepub fn kill_above_depth(&mut self, kill_depth: usize)
pub fn kill_above_depth(&mut self, kill_depth: usize)
Invalidate all entries introduced at depth >= kill_depth.
Used when leaving a case branch scope.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for AvailableSet
impl Clone for AvailableSet
Source§fn clone(&self) -> AvailableSet
fn clone(&self) -> AvailableSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AvailableSet
impl Debug for AvailableSet
Source§impl Default for AvailableSet
impl Default for AvailableSet
Source§fn default() -> AvailableSet
fn default() -> AvailableSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AvailableSet
impl RefUnwindSafe for AvailableSet
impl Send for AvailableSet
impl Sync for AvailableSet
impl Unpin for AvailableSet
impl UnsafeUnpin for AvailableSet
impl UnwindSafe for AvailableSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more