1
Fork 0

Check which blocks are cleanup in mir-opt tests

This commit is contained in:
Matthew Jasper 2019-03-03 19:04:26 +00:00
parent 2cfd6444a7
commit 2131b153b3
10 changed files with 22 additions and 23 deletions

View file

@ -317,9 +317,8 @@ where
let data = &mir[block];
// Basic block label at the top.
let cleanup_text = if data.is_cleanup { " // cleanup" } else { "" };
let lbl = format!("{}{:?}: {{", INDENT, block);
writeln!(w, "{0:1$}{2}", lbl, ALIGN, cleanup_text)?;
let cleanup_text = if data.is_cleanup { " (cleanup)" } else { "" };
writeln!(w, "{}{:?}{}: {{", INDENT, block, cleanup_text)?;
// List of statements in the middle.
let mut current_location = Location {

View file

@ -48,7 +48,7 @@ fn main() {
// drop(_6) -> [return: bb6, unwind: bb4];
// }
// ...
// bb5: {
// bb5 (cleanup): {
// drop(_6) -> bb4;
// }
// END rustc.main.SimplifyCfg-initial.after.mir

View file

@ -38,7 +38,7 @@ impl Drop for S {
// (*_2) = const S::new() -> [return: bb2, unwind: bb3];
// }
//
// bb1: {
// bb1 (cleanup): {
// resume;
// }
//
@ -47,7 +47,7 @@ impl Drop for S {
// drop(_2) -> bb4;
// }
//
// bb3: {
// bb3 (cleanup): {
// drop(_2) -> bb1;
// }
//
@ -62,11 +62,11 @@ impl Drop for S {
// drop(_4) -> [return: bb8, unwind: bb6];
// }
//
// bb6: {
// bb6 (cleanup): {
// drop(_1) -> bb1;
// }
//
// bb7: {
// bb7 (cleanup): {
// drop(_4) -> bb6;
// }
//

View file

@ -18,7 +18,7 @@ fn main() {
// FakeRead(ForLet, _1);
// goto -> bb2;
// }
// bb1: {
// bb1 (cleanup): {
// resume;
// }
// bb2: {

View file

@ -43,7 +43,7 @@ fn main() {
// FakeRead(ForMatchedPlace, _3);
// switchInt(_3) -> [false: bb9, otherwise: bb8];
// }
// bb4: {
// bb4 (cleanup): {
// resume;
// }
// bb5: {

View file

@ -18,7 +18,7 @@ fn main() {
// END RUST SOURCE
// START rustc.main.SimplifyCfg-qualify-consts.after.mir
// ...
// bb1: { // The cleanup block
// bb1 (cleanup): {
// resume;
// }
// ...

View file

@ -47,7 +47,7 @@ fn main() {
// _3 = discriminant(_2);
// switchInt(move _3) -> [0isize: bb4, 1isize: bb2, otherwise: bb7];
// }
// bb1: {
// bb1 (cleanup): {
// resume;
// }
// bb2: {
@ -116,7 +116,7 @@ fn main() {
// _3 = discriminant(_2);
// switchInt(move _3) -> [0isize: bb3, 1isize: bb2, otherwise: bb7];
// }
// bb1: {
// bb1 (cleanup): {
// resume;
// }
// bb2: {
@ -185,7 +185,7 @@ fn main() {
// _3 = discriminant(_2);
// switchInt(move _3) -> [1isize: bb2, otherwise: bb3];
// }
// bb1: {
// bb1 (cleanup): {
// resume;
// }
// bb2: {

View file

@ -38,14 +38,14 @@ impl Drop for Droppy {
// _6 = move (_1.0: Aligned);
// drop(_6) -> [return: bb4, unwind: bb3];
// }
// bb1: {
// bb1 (cleanup): {
// resume;
// }
// bb2: {
// StorageDead(_1);
// return;
// }
// bb3: {
// bb3 (cleanup): {
// (_1.0: Aligned) = move _4;
// drop(_1) -> bb1;
// }

View file

@ -63,7 +63,7 @@ fn main() {
// StorageDead(_8);
// return;
// }
// bb10: {
// bb10 (cleanup): {
// resume;
// }
// END rustc.match_guard.CleanupNonCodegenStatements.before.mir
@ -114,7 +114,7 @@ fn main() {
// StorageDead(_8);
// return;
// }
// bb10: {
// bb10 (cleanup): {
// resume;
// }
// END rustc.match_guard.CleanupNonCodegenStatements.after.mir

View file

@ -22,7 +22,7 @@ fn main() {
// _0 = const 2i32;
// return;
// }
// bb1: {
// bb1 (cleanup): {
// resume;
// }
// END rustc.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.mir
@ -32,7 +32,7 @@ fn main() {
// _0 = const 5isize;
// return;
// }
// bb1: {
// bb1 (cleanup): {
// resume;
// }
// END rustc.E-V-{{constant}}.mir_map.0.mir
@ -44,16 +44,16 @@ fn main() {
// bb1: {
// return;
// }
// bb2: {
// bb2 (cleanup): {
// resume;
// }
// bb3: {
// goto -> bb1;
// }
// bb4: {
// bb4 (cleanup): {
// goto -> bb2;
// }
// bb5: {
// bb5 (cleanup): {
// drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4;
// }
// bb6: {