pub struct AliasDomain {
parent: Vec<usize>,
rank: Vec<usize>,
}Expand description
Alias domain using Union-Find data structure
Fields§
§parent: Vec<usize>Parent array for Union-Find
rank: Vec<usize>Rank for path compression
Implementations§
Source§impl AliasDomain
impl AliasDomain
Sourcepub fn find(&mut self, idx: usize) -> usize
pub fn find(&mut self, idx: usize) -> usize
Find the representative of a place (with path compression)
Sourcepub fn union(&mut self, idx1: usize, idx2: usize) -> bool
pub fn union(&mut self, idx1: usize, idx2: usize) -> bool
Union two places (returns true if they were not already aliased)
Sourcepub fn are_aliased(&mut self, idx1: usize, idx2: usize) -> bool
pub fn are_aliased(&mut self, idx1: usize, idx2: usize) -> bool
Check if two places are aliased
Sourcepub fn remove_aliases(&mut self, idx: usize)
pub fn remove_aliases(&mut self, idx: usize)
Remove all aliases for a place (used in kill phase) This correctly handles the case where idx is the root of a connected component
Sourcepub fn remove_aliases_with_prefix(
&mut self,
place_id: &PlaceId,
place_info: &PlaceInfo<'_>,
)
pub fn remove_aliases_with_prefix( &mut self, place_id: &PlaceId, place_info: &PlaceInfo<'_>, )
Remove all aliases for a place and all its field projections This ensures that when lv is killed, all lv.* are also killed
Sourcepub fn get_all_alias_pairs(&self) -> Vec<(usize, usize)>
pub fn get_all_alias_pairs(&self) -> Vec<(usize, usize)>
Get all alias pairs (for debugging/summary extraction)
Trait Implementations§
Source§impl Clone for AliasDomain
impl Clone for AliasDomain
Source§fn clone(&self) -> AliasDomain
fn clone(&self) -> AliasDomain
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 AliasDomain
impl Debug for AliasDomain
Source§impl DebugWithContext<FnAliasAnalyzer<'_>> for AliasDomain
impl DebugWithContext<FnAliasAnalyzer<'_>> for AliasDomain
Source§impl JoinSemiLattice for AliasDomain
impl JoinSemiLattice for AliasDomain
Source§impl PartialEq for AliasDomain
impl PartialEq for AliasDomain
impl Eq for AliasDomain
impl StructuralPartialEq for AliasDomain
Auto Trait Implementations§
impl Freeze for AliasDomain
impl RefUnwindSafe for AliasDomain
impl Send for AliasDomain
impl Sync for AliasDomain
impl Unpin for AliasDomain
impl UnwindSafe for AliasDomain
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.