pub struct PathAnalyzer<'tcx> {
pub tcx: TyCtxt<'tcx>,
pub debug: bool,
pub paths: FxHashMap<DefId, PathTree>,
pub graphs: FxHashMap<DefId, PathGraph<'tcx>>,
}Expand description
PathAnalyzer is responsible only for extracting path-sensitive CFG paths. Downstream analyses can reuse these paths without depending on alias logic.
Fields§
§tcx: TyCtxt<'tcx>§debug: bool§paths: FxHashMap<DefId, PathTree>§graphs: FxHashMap<DefId, PathGraph<'tcx>>Implementations§
Source§impl<'tcx> PathAnalyzer<'tcx>
impl<'tcx> PathAnalyzer<'tcx>
pub fn new(tcx: TyCtxt<'tcx>, debug: bool) -> Self
Sourcepub fn analyze(&mut self, def_id: DefId) -> Option<PathTree>
pub fn analyze(&mut self, def_id: DefId) -> Option<PathTree>
Analyze a single function, returning all whole-CFG paths for it.
Results are cached — subsequent calls for the same def_id return
the cached tree.
Sourcepub fn analyze_repeat(
&mut self,
def_id: DefId,
postfix_repeat: usize,
) -> Option<PathTree>
pub fn analyze_repeat( &mut self, def_id: DefId, postfix_repeat: usize, ) -> Option<PathTree>
Analyze a single function allowing each SCC postfix segment to
repeat up to postfix_repeat additional times.
pub fn get_fn_paths(&self, def_id: DefId) -> Option<PathTree>
pub fn get_all_paths(&self) -> FxHashMap<DefId, PathTree>
Sourcepub fn analyze_all(&mut self)
pub fn analyze_all(&mut self)
Analyze all functions in the local crate.
Sourcepub fn analyze_all_repeat(&mut self, postfix_repeat: usize)
pub fn analyze_all_repeat(&mut self, postfix_repeat: usize)
Analyze all functions with the given postfix-repeat count.
pub fn run_with_repeat(&mut self, postfix_repeat: usize)
Trait Implementations§
Auto Trait Implementations§
impl<'tcx> Freeze for PathAnalyzer<'tcx>
impl<'tcx> !RefUnwindSafe for PathAnalyzer<'tcx>
impl<'tcx> !Send for PathAnalyzer<'tcx>
impl<'tcx> !Sync for PathAnalyzer<'tcx>
impl<'tcx> Unpin for PathAnalyzer<'tcx>
impl<'tcx> !UnwindSafe for PathAnalyzer<'tcx>
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> 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