rust/tests/mir-opt/building/match_false_edges.main.built.after.mir
2024-02-17 20:21:57 +01:00

188 lines
3.4 KiB
Rust

// MIR for `main` after built
fn main() -> () {
let mut _0: ();
let mut _1: i32;
let mut _2: std::option::Option<i32>;
let mut _3: isize;
let mut _4: isize;
let mut _5: &std::option::Option<i32>;
let _6: i32;
let _7: &i32;
let mut _8: bool;
let _9: std::option::Option<i32>;
let _10: i32;
let _11: &i32;
let mut _12: bool;
let mut _13: i32;
let _14: std::option::Option<i32>;
scope 1 {
}
scope 2 {
debug _w => _6;
debug _w => _7;
}
scope 3 {
debug _x => _9;
}
scope 4 {
debug y => _10;
debug y => _11;
}
scope 5 {
debug _z => _14;
}
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = Option::<i32>::Some(const 1_i32);
PlaceMention(_2);
_4 = discriminant(_2);
switchInt(move _4) -> [1: bb8, otherwise: bb2];
}
bb1: {
FakeRead(ForMatchedPlace(None), _2);
unreachable;
}
bb2: {
falseEdge -> [real: bb15, imaginary: bb6];
}
bb3: {
_3 = discriminant(_2);
switchInt(move _3) -> [1: bb6, otherwise: bb4];
}
bb4: {
StorageLive(_14);
_14 = _2;
_1 = const 4_i32;
StorageDead(_14);
goto -> bb21;
}
bb5: {
goto -> bb1;
}
bb6: {
falseEdge -> [real: bb16, imaginary: bb4];
}
bb7: {
goto -> bb4;
}
bb8: {
falseEdge -> [real: bb10, imaginary: bb2];
}
bb9: {
goto -> bb2;
}
bb10: {
StorageLive(_7);
_7 = &((_2 as Some).0: i32);
_5 = &fake _2;
StorageLive(_8);
_8 = guard() -> [return: bb11, unwind: bb24];
}
bb11: {
switchInt(move _8) -> [0: bb13, otherwise: bb12];
}
bb12: {
StorageDead(_8);
FakeRead(ForMatchGuard, _5);
FakeRead(ForGuardBinding, _7);
StorageLive(_6);
_6 = ((_2 as Some).0: i32);
_1 = const 1_i32;
StorageDead(_6);
StorageDead(_7);
goto -> bb21;
}
bb13: {
goto -> bb14;
}
bb14: {
StorageDead(_8);
StorageDead(_7);
falseEdge -> [real: bb9, imaginary: bb2];
}
bb15: {
StorageLive(_9);
_9 = _2;
_1 = const 2_i32;
StorageDead(_9);
goto -> bb21;
}
bb16: {
StorageLive(_11);
_11 = &((_2 as Some).0: i32);
_5 = &fake _2;
StorageLive(_12);
StorageLive(_13);
_13 = (*_11);
_12 = guard2(move _13) -> [return: bb17, unwind: bb24];
}
bb17: {
switchInt(move _12) -> [0: bb19, otherwise: bb18];
}
bb18: {
StorageDead(_13);
StorageDead(_12);
FakeRead(ForMatchGuard, _5);
FakeRead(ForGuardBinding, _11);
StorageLive(_10);
_10 = ((_2 as Some).0: i32);
_1 = const 3_i32;
StorageDead(_10);
StorageDead(_11);
goto -> bb21;
}
bb19: {
goto -> bb20;
}
bb20: {
StorageDead(_13);
StorageDead(_12);
StorageDead(_11);
falseEdge -> [real: bb7, imaginary: bb4];
}
bb21: {
PlaceMention(_1);
StorageDead(_2);
StorageDead(_1);
_0 = const ();
return;
}
bb22: {
FakeRead(ForMatchedPlace(None), _1);
unreachable;
}
bb23: {
goto -> bb22;
}
bb24 (cleanup): {
resume;
}
}