diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-03-15 15:29:22 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-03-15 15:39:36 -0700 |
commit | 7a46377dbfedbd688ed8d4f27efab544d50b9a76 (patch) | |
tree | 30ec9fd56c40921824328a527613f0e020349e84 | |
parent | e446f3b10f886362cfa31f5ba17b91cc638aa60a (diff) |
Add edge labels to our graphviz output
This adds the `EdgeKind` as a label to edges in the graphviz IR dump
output. This is useful for understanding why something is referenced by another
thing.
-rw-r--r-- | src/ir/dot.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ir/dot.rs b/src/ir/dot.rs index e7e1f47b..7472dd8e 100644 --- a/src/ir/dot.rs +++ b/src/ir/dot.rs @@ -36,15 +36,16 @@ pub fn write_dot_file<P>(ctx: &BindgenContext, path: P) -> io::Result<()> try!(writeln!(&mut dot_file, r#"</table> >];"#)); item.trace(ctx, - &mut |sub_id: ItemId, _edge_kind| { + &mut |sub_id: ItemId, edge_kind| { if err.is_some() { return; } match writeln!(&mut dot_file, - "{} -> {};", + "{} -> {} [label={:?}];", id.as_usize(), - sub_id.as_usize()) { + sub_id.as_usize(), + edge_kind) { Ok(_) => {} Err(e) => err = Some(Err(e)), } |