Scc

Trait Scc 

Source
pub trait Scc {
    // Required methods
    fn on_scc_found(&mut self, root: usize, scc_components: &[usize]);
    fn get_next(&mut self, root: usize) -> FxHashSet<usize>;
    fn get_size(&mut self) -> usize;

    // Provided methods
    fn find_scc(&mut self) { ... }
    fn find_scc_from(&mut self, start: usize) { ... }
    fn tarjan(
        &mut self,
        index: usize,
        stack: &mut Vec<usize>,
        instack: &mut FxHashSet<usize>,
        dfn: &mut Vec<usize>,
        low: &mut Vec<usize>,
        time: &mut usize,
    ) { ... }
}
Expand description

Tarjan SCC callback trait.

Required Methods§

Source

fn on_scc_found(&mut self, root: usize, scc_components: &[usize])

Callback invoked for each discovered SCC.

Source

fn get_next(&mut self, root: usize) -> FxHashSet<usize>

Return outgoing successors of root.

Source

fn get_size(&mut self) -> usize

Return the number of graph nodes.

Provided Methods§

Source

fn find_scc(&mut self)

Run SCC discovery from CFG entry block 0.

Source

fn find_scc_from(&mut self, start: usize)

Run SCC discovery from a specific start node.

Source

fn tarjan( &mut self, index: usize, stack: &mut Vec<usize>, instack: &mut FxHashSet<usize>, dfn: &mut Vec<usize>, low: &mut Vec<usize>, time: &mut usize, )

Recursive Tarjan traversal.

Implementors§

Source§

impl Scc for SccDetector

Source§

impl<'tcx> Scc for MopGraph<'tcx>