rust/tests/mir-opt/early_otherwise_branch_unwind.poll.EarlyOtherwiseBranch.diff

127 lines
3 KiB
Diff
Raw Normal View History

- // MIR for `poll` before EarlyOtherwiseBranch
+ // MIR for `poll` after EarlyOtherwiseBranch
fn poll(_1: Poll<Result<Option<Vec<u8>>, u8>>) -> () {
debug val => _1;
let mut _0: ();
let mut _2: isize;
let mut _3: isize;
let mut _4: isize;
let _5: std::vec::Vec<u8>;
let _6: u8;
let mut _7: bool;
let mut _8: bool;
let mut _9: isize;
scope 1 {
debug _trailers => _5;
}
scope 2 {
debug _err => _6;
}
bb0: {
_7 = const false;
_8 = const false;
_7 = const true;
_8 = const true;
_4 = discriminant(_1);
switchInt(copy _4) -> [0: bb2, 1: bb4, otherwise: bb1];
}
bb1: {
unreachable;
}
bb2: {
_3 = discriminant(((_1 as Ready).0: std::result::Result<std::option::Option<std::vec::Vec<u8>>, u8>));
switchInt(copy _3) -> [0: bb3, 1: bb6, otherwise: bb1];
}
bb3: {
_2 = discriminant(((((_1 as Ready).0: std::result::Result<std::option::Option<std::vec::Vec<u8>>, u8>) as Ok).0: std::option::Option<std::vec::Vec<u8>>));
switchInt(copy _2) -> [0: bb5, 1: bb7, otherwise: bb1];
}
bb4: {
_0 = const ();
goto -> bb17;
}
bb5: {
_0 = const ();
goto -> bb17;
}
bb6: {
StorageLive(_6);
_6 = copy ((((_1 as Ready).0: std::result::Result<std::option::Option<std::vec::Vec<u8>>, u8>) as Err).0: u8);
_0 = const ();
StorageDead(_6);
goto -> bb17;
}
bb7: {
StorageLive(_5);
_5 = move ((((((_1 as Ready).0: std::result::Result<std::option::Option<std::vec::Vec<u8>>, u8>) as Ok).0: std::option::Option<std::vec::Vec<u8>>) as Some).0: std::vec::Vec<u8>);
_0 = const ();
drop(_5) -> [return: bb8, unwind: bb20];
}
bb8: {
StorageDead(_5);
goto -> bb17;
}
bb9 (cleanup): {
resume;
}
bb10: {
return;
}
bb11: {
switchInt(copy _7) -> [0: bb12, otherwise: bb16];
}
bb12: {
_7 = const false;
goto -> bb10;
}
bb13: {
switchInt(copy _8) -> [0: bb14, otherwise: bb15];
}
bb14: {
_8 = const false;
goto -> bb12;
}
bb15: {
goto -> bb14;
}
bb16: {
_9 = discriminant(((_1 as Ready).0: std::result::Result<std::option::Option<std::vec::Vec<u8>>, u8>));
switchInt(move _9) -> [0: bb13, otherwise: bb12];
}
bb17: {
switchInt(copy _4) -> [0: bb11, otherwise: bb10];
}
bb18 (cleanup): {
switchInt(copy _3) -> [0: bb19, otherwise: bb9];
}
bb19 (cleanup): {
goto -> bb9;
}
bb20 (cleanup): {
switchInt(copy _4) -> [0: bb18, otherwise: bb9];
}
}