about summary refs log tree commit diff
path: root/compiler/rustc_mir/src
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2019-11-16 13:23:31 +0000
committerAaron Hill <aa1ronham@gmail.com>2020-10-04 07:54:01 -0400
commitfa3e2fcbe4bb6c878d137eb427fc34daf49b8c69 (patch)
treebc88bfa53c74fb287b3b5d513cfbcf1a6b278434 /compiler/rustc_mir/src
parent0d37dca25a51fb900a402c94c8818ad1c2789e30 (diff)
downloadrust-fa3e2fcbe4bb6c878d137eb427fc34daf49b8c69.tar.gz
rust-fa3e2fcbe4bb6c878d137eb427fc34daf49b8c69.zip
Defer creating drop trees in MIR lowering until leaving that scope
Diffstat (limited to 'compiler/rustc_mir/src')
-rw-r--r--compiler/rustc_mir/src/util/graphviz.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/rustc_mir/src/util/graphviz.rs b/compiler/rustc_mir/src/util/graphviz.rs
index 4511962d68f..cdabc70d72e 100644
--- a/compiler/rustc_mir/src/util/graphviz.rs
+++ b/compiler/rustc_mir/src/util/graphviz.rs
@@ -111,13 +111,24 @@ where
     write!(w, r#"<table border="0" cellborder="1" cellspacing="0">"#)?;
 
     // Basic block number at the top.
+    let (blk, bgcolor) = if data.is_cleanup {
+        (format!("{} (cleanup)", block.index()), "lightblue")
+    } else {
+        let color = if dark_mode {
+            "dimgray"
+        } else {
+            "gray"
+        };
+        (format!("{}", block.index()), "gray")
+    };
     write!(
         w,
         r#"<tr><td bgcolor="{bgcolor}" {attrs} colspan="{colspan}">{blk}</td></tr>"#,
         bgcolor = if dark_mode { "dimgray" } else { "gray" },
         attrs = r#"align="center""#,
         colspan = num_cols,
-        blk = block.index()
+        blk = blk,
+        color = color
     )?;
 
     init(w)?;