pub struct EqualityAnalysis<'a, 'db> { /* private fields */ }Expand description
Variable equality analysis.
This analyzer tracks snapshot/desnap, box/unbox, struct construct, and array construct
relationships as data
flows through the program. At merge points (after match arms converge), we union-find variables
that share the same equivalence classes in both branches ((rep1, rep2) meet), rebuild
forward / reverse, and intersect relations without mapping variables across differing
branch-local equivalence roots (structure fields fall back to placeholders).
Implementations§
Trait Implementations§
Source§impl<'db, 'a> DataflowAnalyzer<'db, 'a> for EqualityAnalysis<'a, 'db>
impl<'db, 'a> DataflowAnalyzer<'db, 'a> for EqualityAnalysis<'a, 'db>
Source§type Info = EqualityState<'db>
type Info = EqualityState<'db>
The analysis state/info type.
Source§fn initial_info(
&mut self,
_block_id: BlockId,
_block_end: &'a BlockEnd<'db>,
) -> Self::Info
fn initial_info( &mut self, _block_id: BlockId, _block_end: &'a BlockEnd<'db>, ) -> Self::Info
Create the initial analysis state at a terminal block. Read more
Source§fn merge(
&mut self,
_lowered: &Lowered<'db>,
_statement_location: StatementLocation,
info1: Self::Info,
info2: Self::Info,
) -> Self::Info
fn merge( &mut self, _lowered: &Lowered<'db>, _statement_location: StatementLocation, info1: Self::Info, info2: Self::Info, ) -> Self::Info
Merge/join states from multiple control flow paths.
Called at join points (match merge for backward, block entry for forward). Read more
Source§fn transfer_stmt(
&mut self,
info: &mut Self::Info,
_statement_location: StatementLocation,
stmt: &'a Statement<'db>,
)
fn transfer_stmt( &mut self, info: &mut Self::Info, _statement_location: StatementLocation, stmt: &'a Statement<'db>, )
Transfer function for a single statement. Read more
Source§fn transfer_edge(
&mut self,
info: &Self::Info,
edge: &Edge<'db, 'a>,
) -> Self::Info
fn transfer_edge( &mut self, info: &Self::Info, edge: &Edge<'db, 'a>, ) -> Self::Info
Transfer state along a CFG edge.
Called when traversing between blocks via control flow edges. Read more
Source§fn transfer_block(
&mut self,
info: &mut Self::Info,
block_id: BlockId,
block: &'a Block<'db>,
)
fn transfer_block( &mut self, info: &mut Self::Info, block_id: BlockId, block: &'a Block<'db>, )
Transfer function for an entire block. Read more
Source§fn visit_block_start(
&mut self,
_info: &mut Self::Info,
_block_id: BlockId,
_block: &Block<'db>,
)
fn visit_block_start( &mut self, _info: &mut Self::Info, _block_id: BlockId, _block: &Block<'db>, )
Called when entering a block during traversal (before transfer_block).
Source§fn block_entry_location(
&self,
lowered: &Lowered<'db>,
block_id: BlockId,
) -> LocationId<'db>
fn block_entry_location( &self, lowered: &Lowered<'db>, block_id: BlockId, ) -> LocationId<'db>
Block entry location.
For Backward it is the merge location.
For Forward it is the block entry location, if there is a statement.
If not statement exists it will look at block end. This might recurse to next block if we
have a goto with no remappings.
Auto Trait Implementations§
impl<'a, 'db> !RefUnwindSafe for EqualityAnalysis<'a, 'db>
impl<'a, 'db> !Send for EqualityAnalysis<'a, 'db>
impl<'a, 'db> !Sync for EqualityAnalysis<'a, 'db>
impl<'a, 'db> !UnwindSafe for EqualityAnalysis<'a, 'db>
impl<'a, 'db> Freeze for EqualityAnalysis<'a, 'db>
impl<'a, 'db> Unpin for EqualityAnalysis<'a, 'db>
impl<'a, 'db> UnsafeUnpin for EqualityAnalysis<'a, 'db>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more