pub struct AssignmentStateMap { /* private fields */ }Expand description
A mapping of variables to their assignment states at a point in the program.
Variables are indexed by their declaration node ID (NodeIndex).
Implementations§
Source§impl AssignmentStateMap
impl AssignmentStateMap
Sourcepub fn get(&self, var_id: NodeIndex) -> AssignmentState
pub fn get(&self, var_id: NodeIndex) -> AssignmentState
Get the assignment state for a variable.
Sourcepub fn set(&mut self, var_id: NodeIndex, state: AssignmentState)
pub fn set(&mut self, var_id: NodeIndex, state: AssignmentState)
Set the assignment state for a variable.
Sourcepub fn mark_assigned(&mut self, var_id: NodeIndex)
pub fn mark_assigned(&mut self, var_id: NodeIndex)
Mark a variable as definitely assigned.
Sourcepub fn merge(&mut self, other: &Self)
pub fn merge(&mut self, other: &Self)
Merge another state map into this one.
This is used at control flow join points where multiple paths converge.
Sourcepub fn is_definite(&self) -> bool
pub fn is_definite(&self) -> bool
Check if all variables are in a definite state (no MaybeAssigned).
Trait Implementations§
Source§impl Clone for AssignmentStateMap
impl Clone for AssignmentStateMap
Source§fn clone(&self) -> AssignmentStateMap
fn clone(&self) -> AssignmentStateMap
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 AssignmentStateMap
impl Debug for AssignmentStateMap
Auto Trait Implementations§
impl Freeze for AssignmentStateMap
impl RefUnwindSafe for AssignmentStateMap
impl Send for AssignmentStateMap
impl Sync for AssignmentStateMap
impl Unpin for AssignmentStateMap
impl UnsafeUnpin for AssignmentStateMap
impl UnwindSafe for AssignmentStateMap
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