diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-01-12 22:42:12 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-01-12 22:42:12 +0100 |
| commit | 82eefe368723dc426fc350be1ac8d9cddc909dd5 (patch) | |
| tree | 6185af9129b89790a6a7a4c18fe6f5dce3dce1af /src/librustc | |
| parent | b21a6da340fd958de370d2b83c0f17fd8fa51f89 (diff) | |
add --xpretty flowgraph,unlabelled variant.
Diffstat (limited to 'src/librustc')
| -rw-r--r-- | src/librustc/middle/cfg/graphviz.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc/middle/cfg/graphviz.rs b/src/librustc/middle/cfg/graphviz.rs index f4db2b6e61d..3d8348e8f5a 100644 --- a/src/librustc/middle/cfg/graphviz.rs +++ b/src/librustc/middle/cfg/graphviz.rs @@ -28,6 +28,8 @@ pub struct LabelledCFG<'a, 'ast: 'a> { pub ast_map: &'a ast_map::Map<'ast>, pub cfg: &'a cfg::CFG, pub name: String, + /// `labelled_edges` controls whether we emit labels on the edges + pub labelled_edges: bool, } fn replace_newline_with_backslash_l(s: String) -> String { @@ -75,6 +77,9 @@ impl<'a, 'ast> dot::Labeller<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast> { fn edge_label(&self, e: &Edge<'a>) -> dot::LabelText<'a> { let mut label = String::new(); + if !self.labelled_edges { + return dot::LabelText::EscStr(label.into_cow()); + } let mut put_one = false; for (i, &node_id) in e.data.exiting_scopes.iter().enumerate() { if put_one { |
