pub fn compute_dominator_tree(
        &self,
        start_index: usize,
    ) -> Result<Graph<NullVertex, NullEdge>> {
        let mut graph = Graph::new();
        for vertex in &self.vertices {
            graph.insert_vertex(NullVertex::new(*vertex.0))?;
        }

        let idoms = self.compute_immediate_dominators(start_index)?;
        for (vertex, idom) in idoms {
            graph.insert_edge(NullEdge::new(idom, vertex))?;
        }

        Ok(graph)
    }
/// Creates a dominator tree with NullVertex and NullEdge
Creates a dominator tree with NullVertex and NullEdge
Creates a dominator tree with NullVertex and NullEdge
pub fn compute_dominator_tree(
        &self,
        start_index: usize,
    ) -> Result<Graph<NullVertex, NullEdge>> {
        let mut graph = Graph::new();
        for vertex in &self.vertices {
            graph.insert_vertex(NullVertex::new(*vertex.0))?;
        }
        let idoms = self.compute_immediate_dominators(start_index)?;
        for (vertex, idom) in idoms {
            graph.insert_edge(NullEdge::new(idom, vertex))?;
        }
        Ok(graph)
    }
pub fn compute_dominator_tree ( & self , start_index : usize , ) -> Result < Graph < NullVertex , NullEdge > > { let mut graph = Graph :: new ( ) ; for vertex in & self . vertices { graph . insert_vertex ( NullVertex :: new ( * vertex . 0 ) ) ? ; } let idoms = self . compute_immediate_dominators ( start_index ) ? ; for ( vertex , idom ) in idoms { graph . insert_edge ( NullEdge :: new ( idom , vertex ) ) ? ; } Ok ( graph ) }
Creates a dominator tree with NullVertex and NullEdge
Creates a dominator tree with NullVertex and NullEdge
&self
start_index
usize
&self
start_index
usize