From 03903cbc20fe5a12efe6eb98dbd5ab54b457ddf0 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Sat, 19 Dec 2015 00:45:39 +0200 Subject: [PATCH] Prettify MIR graphviz output One will look at graphviz often when working with MIR, so may as well make the tables a bit more pretty :) --- src/librustc_mir/graphviz/mod.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/librustc_mir/graphviz/mod.rs b/src/librustc_mir/graphviz/mod.rs index f8cec83dc31..d5da606d76e 100644 --- a/src/librustc_mir/graphviz/mod.rs +++ b/src/librustc_mir/graphviz/mod.rs @@ -34,24 +34,24 @@ impl<'a,'tcx> dot::Labeller<'a, BasicBlock, EdgeIndex> for Mir<'tcx> { fn node_label(&'a self, &n: &BasicBlock) -> dot::LabelText<'a> { let mut buffer = String::new(); - buffer.push_str(""); + buffer.push_str("
"); - buffer.push_str(""); + buffer.push_str(""); let data = self.basic_block_data(n); for statement in &data.statements { - buffer.push_str(""); + buffer.push_str(""); } - buffer.push_str(""); + buffer.push_str(""); - buffer.push_str("
"); - buffer.push_str(&format!("{:?}", n)); - buffer.push_str("
"); + buffer.push_str(&escape(format!("{:?}", n))); + buffer.push_str("
"); + buffer.push_str("
"); buffer.push_str(&escape(format!("{:?}", statement))); - buffer.push_str("
"); + buffer.push_str("
"); buffer.push_str(&escape(format!("{:?}", &data.terminator))); - buffer.push_str("
"); + buffer.push_str(""); dot::LabelText::html(buffer) }