Merge WithNumNodes
into DirectedGraph
This commit is contained in:
parent
029cb1b13b
commit
398da593a5
13 changed files with 33 additions and 52 deletions
|
@ -141,9 +141,7 @@ impl<'tcx> std::ops::Deref for BasicBlocks<'tcx> {
|
|||
|
||||
impl<'tcx> graph::DirectedGraph for BasicBlocks<'tcx> {
|
||||
type Node = BasicBlock;
|
||||
}
|
||||
|
||||
impl<'tcx> graph::WithNumNodes for BasicBlocks<'tcx> {
|
||||
#[inline]
|
||||
fn num_nodes(&self) -> usize {
|
||||
self.basic_blocks.len()
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::io::{self, Write};
|
|||
|
||||
pub struct GraphvizWriter<
|
||||
'a,
|
||||
G: graph::DirectedGraph + graph::WithSuccessors + graph::WithStartNode + graph::WithNumNodes,
|
||||
G: graph::DirectedGraph + graph::WithSuccessors + graph::WithStartNode,
|
||||
NodeContentFn: Fn(<G as graph::DirectedGraph>::Node) -> Vec<String>,
|
||||
EdgeLabelsFn: Fn(<G as graph::DirectedGraph>::Node) -> Vec<String>,
|
||||
> {
|
||||
|
@ -19,7 +19,7 @@ pub struct GraphvizWriter<
|
|||
|
||||
impl<
|
||||
'a,
|
||||
G: graph::DirectedGraph + graph::WithSuccessors + graph::WithStartNode + graph::WithNumNodes,
|
||||
G: graph::DirectedGraph + graph::WithSuccessors + graph::WithStartNode,
|
||||
NodeContentFn: Fn(<G as graph::DirectedGraph>::Node) -> Vec<String>,
|
||||
EdgeLabelsFn: Fn(<G as graph::DirectedGraph>::Node) -> Vec<String>,
|
||||
> GraphvizWriter<'a, G, NodeContentFn, EdgeLabelsFn>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue