struct PointsToAnalysis<'a> {
fn_sig: Option<&'a EarlyBinder<PolyFnSig>>,
map: &'a Map,
}
Expand description
This implement a points to analysis for mutable references over a [FlatSet
]. The analysis is
a may analysis. If you want to know if a reference definitively points to a location you have to
combine it with the result of a definitely initialized analysis. See module level documentation
for more details.
Fields§
§fn_sig: Option<&'a EarlyBinder<PolyFnSig>>
§map: &'a Map
Implementations§
Source§impl<'a> PointsToAnalysis<'a>
impl<'a> PointsToAnalysis<'a>
fn new(map: &'a Map, fn_sig: Option<&'a EarlyBinder<PolyFnSig>>) -> Self
fn handle_statement(&self, statement: &Statement<'_>, state: &mut State)
fn handle_assign( &self, target: Place<'_>, rvalue: &Rvalue<'_>, state: &mut State, )
fn handle_ref(&self, place: &Place<'_>, state: &State) -> FlatSet<Loc>
fn handle_operand(&self, operand: &Operand<'_>) -> Option<PlaceIndex>
Sourcefn handle_terminator<'mir, 'tcx>(
&self,
terminator: &'mir Terminator<'tcx>,
state: &mut State,
) -> TerminatorEdges<'mir, 'tcx>
fn handle_terminator<'mir, 'tcx>( &self, terminator: &'mir Terminator<'tcx>, state: &mut State, ) -> TerminatorEdges<'mir, 'tcx>
The effect of a successful function call return should not be
applied here, see [Analysis::apply_terminator_effect
].
fn handle_call_return( &self, return_places: CallReturnPlaces<'_, '_>, state: &mut State, )
Trait Implementations§
Source§impl<'tcx> Analysis<'tcx> for PointsToAnalysis<'_>
impl<'tcx> Analysis<'tcx> for PointsToAnalysis<'_>
Source§const NAME: &'static str = "PointsToAnalysis"
const NAME: &'static str = "PointsToAnalysis"
A descriptive name for this analysis. Used only for debugging. Read more
Source§fn bottom_value(&self, _: &Body<'tcx>) -> Self::Domain
fn bottom_value(&self, _: &Body<'tcx>) -> Self::Domain
Returns the initial value of the dataflow state upon entry to each basic block.
Source§fn initialize_start_block(&self, body: &Body<'tcx>, state: &mut Self::Domain)
fn initialize_start_block(&self, body: &Body<'tcx>, state: &mut Self::Domain)
Mutates the initial value of the dataflow state upon entry to the
START_BLOCK
. Read moreSource§fn apply_statement_effect(
&mut self,
state: &mut Self::Domain,
statement: &Statement<'tcx>,
_location: Location,
)
fn apply_statement_effect( &mut self, state: &mut Self::Domain, statement: &Statement<'tcx>, _location: Location, )
Updates the current dataflow state with the effect of evaluating a statement.
Source§fn apply_terminator_effect<'mir>(
&mut self,
state: &mut Self::Domain,
terminator: &'mir Terminator<'tcx>,
_location: Location,
) -> TerminatorEdges<'mir, 'tcx>
fn apply_terminator_effect<'mir>( &mut self, state: &mut Self::Domain, terminator: &'mir Terminator<'tcx>, _location: Location, ) -> TerminatorEdges<'mir, 'tcx>
Updates the current dataflow state with the effect of evaluating a terminator. Read more
Source§fn apply_call_return_effect(
&mut self,
state: &mut Self::Domain,
_block: BasicBlock,
return_places: CallReturnPlaces<'_, 'tcx>,
)
fn apply_call_return_effect( &mut self, state: &mut Self::Domain, _block: BasicBlock, return_places: CallReturnPlaces<'_, 'tcx>, )
Updates the current dataflow state with the effect of a successful return from a
Call
terminator. Read moreSource§fn apply_switch_int_edge_effects(
&mut self,
_block: BasicBlock,
_discr: &Operand<'tcx>,
_apply_edge_effects: &mut impl SwitchIntEdgeEffects<Self::Domain>,
)
fn apply_switch_int_edge_effects( &mut self, _block: BasicBlock, _discr: &Operand<'tcx>, _apply_edge_effects: &mut impl SwitchIntEdgeEffects<Self::Domain>, )
Updates the current dataflow state with the effect of taking a particular branch in a
SwitchInt
terminator. Read more§fn apply_before_statement_effect(
&mut self,
_state: &mut Self::Domain,
_statement: &Statement<'tcx>,
_location: Location,
)
fn apply_before_statement_effect( &mut self, _state: &mut Self::Domain, _statement: &Statement<'tcx>, _location: Location, )
Updates the current dataflow state with an effect that occurs immediately before the
given statement. Read more
§fn apply_before_terminator_effect(
&mut self,
_state: &mut Self::Domain,
_terminator: &Terminator<'tcx>,
_location: Location,
)
fn apply_before_terminator_effect( &mut self, _state: &mut Self::Domain, _terminator: &Terminator<'tcx>, _location: Location, )
Updates the current dataflow state with an effect that occurs immediately before the
given terminator. Read more
Source§impl DebugWithContext<PointsToAnalysis<'_>> for State
impl DebugWithContext<PointsToAnalysis<'_>> for State
This is used to visualize the dataflow analysis.
fn fmt_with(&self, ctxt: &PointsToAnalysis<'_>, f: &mut Formatter<'_>) -> Result
Source§fn fmt_diff_with(
&self,
old: &Self,
ctxt: &PointsToAnalysis<'_>,
f: &mut Formatter<'_>,
) -> Result
fn fmt_diff_with( &self, old: &Self, ctxt: &PointsToAnalysis<'_>, f: &mut Formatter<'_>, ) -> Result
Auto Trait Implementations§
impl<'a> Freeze for PointsToAnalysis<'a>
impl<'a> RefUnwindSafe for PointsToAnalysis<'a>
impl<'a> Send for PointsToAnalysis<'a>
impl<'a> Sync for PointsToAnalysis<'a>
impl<'a> Unpin for PointsToAnalysis<'a>
impl<'a> UnwindSafe for PointsToAnalysis<'a>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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