pub struct PartialGraph<'tcx, K> {
pub(crate) nodes: FxHashSet<DepNode<'tcx, OneHopLocation>>,
pub(crate) edges: FxHashSet<(DepNode<'tcx, OneHopLocation>, DepNode<'tcx, OneHopLocation>, DepEdge<OneHopLocation>)>,
pub(crate) generics: GenericArgsRef<'tcx>,
pub(crate) def_id: DefId,
arg_count: usize,
local_decls: IndexVec<Local, LocalDecl<'tcx>>,
pub(crate) k: K,
pub(crate) inlined_calls: Vec<(Location, Instance<'tcx>, K, Vec<(DepNode<'tcx, OneHopLocation>, DepEdge<OneHopLocation>)>)>,
}
Fields§
§nodes: FxHashSet<DepNode<'tcx, OneHopLocation>>
§edges: FxHashSet<(DepNode<'tcx, OneHopLocation>, DepNode<'tcx, OneHopLocation>, DepEdge<OneHopLocation>)>
§generics: GenericArgsRef<'tcx>
§def_id: DefId
§arg_count: usize
§local_decls: IndexVec<Local, LocalDecl<'tcx>>
§k: K
§inlined_calls: Vec<(Location, Instance<'tcx>, K, Vec<(DepNode<'tcx, OneHopLocation>, DepEdge<OneHopLocation>)>)>
Implementations§
Source§impl<'tcx, K: Hash + Eq + Clone> PartialGraph<'tcx, K>
impl<'tcx, K: Hash + Eq + Clone> PartialGraph<'tcx, K>
fn modular_mutation_visitor<'a, 'mir>( &'a mut self, results: &'a Results<'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>>, state: &'a InstructionState<'tcx>, ) -> ModularMutationVisitor<'a, 'tcx, impl FnMut(Location, Mutation<'tcx>) + use<'a, 'tcx, 'mir, K>>
Sourcefn handle_as_inline<'a>(
&mut self,
results: &Results<'tcx, &'a LocalAnalysis<'tcx, 'a, K>>,
state: &InstructionState<'tcx>,
terminator: &Terminator<'tcx>,
location: Location,
) -> bool
fn handle_as_inline<'a>( &mut self, results: &Results<'tcx, &'a LocalAnalysis<'tcx, 'a, K>>, state: &InstructionState<'tcx>, terminator: &Terminator<'tcx>, location: Location, ) -> bool
returns whether we were able to successfully handle this as inline
fn register_mutation( &mut self, results: &Results<'tcx, &'_ LocalAnalysis<'tcx, '_, K>>, state: &InstructionState<'tcx>, inputs: Inputs<'tcx>, mutated: Either<Place<'tcx>, DepNode<'tcx, OneHopLocation>>, location: Location, target_use: TargetUse, )
Source§impl<'tcx, K: Clone + Hash + Eq> PartialGraph<'tcx, K>
impl<'tcx, K: Clone + Hash + Eq> PartialGraph<'tcx, K>
pub fn to_petgraph<'c>( &self, memo: &'c MemoPdgConstructor<'tcx, K>, ) -> DepGraph<'tcx>
pub fn to_petgraph_with_extra_global_location<'c>( &self, memo: &'c MemoPdgConstructor<'tcx, K>, extra_global_location: GlobalLocation, ) -> DepGraph<'tcx>
Source§impl<'tcx, K> PartialGraph<'tcx, K>
impl<'tcx, K> PartialGraph<'tcx, K>
pub fn new( generics: GenericArgsRef<'tcx>, def_id: DefId, arg_count: usize, local_decls: &LocalDecls<'tcx>, k: K, ) -> Self
Trait Implementations§
Source§impl<'tcx, K: Clone> Clone for PartialGraph<'tcx, K>
impl<'tcx, K: Clone> Clone for PartialGraph<'tcx, K>
Source§fn clone(&self) -> PartialGraph<'tcx, K>
fn clone(&self) -> PartialGraph<'tcx, K>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'tcx, K: Debug> Debug for PartialGraph<'tcx, K>
impl<'tcx, K: Debug> Debug for PartialGraph<'tcx, K>
Source§impl<'tcx, K> HasLocalDecls<'tcx> for PartialGraph<'tcx, K>
impl<'tcx, K> HasLocalDecls<'tcx> for PartialGraph<'tcx, K>
fn local_decls(&self) -> &LocalDecls<'tcx>
Source§impl<'mir, 'tcx, K: Hash + Eq + Clone> ResultsVisitor<'mir, 'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>> for PartialGraph<'tcx, K>
impl<'mir, 'tcx, K: Hash + Eq + Clone> ResultsVisitor<'mir, 'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>> for PartialGraph<'tcx, K>
Source§fn visit_after_early_terminator_effect(
&mut self,
results: &mut Results<'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>>,
state: &InstructionState<'tcx>,
terminator: &'mir Terminator<'tcx>,
location: Location,
)
fn visit_after_early_terminator_effect( &mut self, results: &mut Results<'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>>, state: &InstructionState<'tcx>, terminator: &'mir Terminator<'tcx>, location: Location, )
We handle terminators during graph construction generally in the before state, because we’re interested in what the dependencies of our read places are before the modification pass overwrites the read places from any mutable arguments.
There is one exception which is that non-inlined function calls are handled in two steps. Before the primary effects we generate edges from the dependencies to the input arguments. After the primary effect we insert edges from each argument to each modified location. It is cleaner to do this afterwards, because the logic that resolves a place to a graph node assumes that you are reading all of your inputs from the “last_modification”. In the “before” state that map contains the “original” dependencies of each argument, e.g. we haven’t combined them with the reachable places yet. So this ordering means we can reuse the same logic but just have to run it twice for every non-inlined function call site.
Source§fn visit_after_early_statement_effect(
&mut self,
results: &mut Results<'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>>,
state: &InstructionState<'tcx>,
statement: &'mir Statement<'tcx>,
location: Location,
)
fn visit_after_early_statement_effect( &mut self, results: &mut Results<'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>>, state: &InstructionState<'tcx>, statement: &'mir Statement<'tcx>, location: Location, )
state
.Source§fn visit_after_primary_terminator_effect(
&mut self,
results: &mut Results<'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>>,
state: &InstructionState<'tcx>,
terminator: &'mir Terminator<'tcx>,
location: Location,
)
fn visit_after_primary_terminator_effect( &mut self, results: &mut Results<'tcx, &'mir LocalAnalysis<'tcx, 'mir, K>>, state: &InstructionState<'tcx>, terminator: &'mir Terminator<'tcx>, location: Location, )
state
. Read morefn visit_block_start(&mut self, _state: &<A as Analysis<'tcx>>::Domain)
§fn visit_after_primary_statement_effect(
&mut self,
_results: &mut Results<'tcx, A>,
_state: &<A as Analysis<'tcx>>::Domain,
_statement: &'mir Statement<'tcx>,
_location: Location,
)
fn visit_after_primary_statement_effect( &mut self, _results: &mut Results<'tcx, A>, _state: &<A as Analysis<'tcx>>::Domain, _statement: &'mir Statement<'tcx>, _location: Location, )
state
.fn visit_block_end(&mut self, _state: &<A as Analysis<'tcx>>::Domain)
Auto Trait Implementations§
impl<'tcx, K> Freeze for PartialGraph<'tcx, K>where
K: Freeze,
impl<'tcx, K> !RefUnwindSafe for PartialGraph<'tcx, K>
impl<'tcx, K> Send for PartialGraph<'tcx, K>where
K: Send,
impl<'tcx, K> Sync for PartialGraph<'tcx, K>where
K: Sync,
impl<'tcx, K> Unpin for PartialGraph<'tcx, K>where
K: Unpin,
impl<'tcx, K> !UnwindSafe for PartialGraph<'tcx, K>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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