rust/tests/mir-opt/inline/inline_generator.main.Inline.panic-unwind.diff

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

125 lines
3.5 KiB
Diff
Raw Normal View History

2020-11-10 18:00:00 -06:00
- // MIR for `main` before Inline
+ // MIR for `main` after Inline
fn main() -> () {
2023-06-06 08:47:00 -05:00
let mut _0: ();
let _1: std::ops::GeneratorState<i32, bool>;
let mut _2: std::pin::Pin<&mut {generator@$DIR/inline_generator.rs:16:5: 16:8}>;
let mut _3: &mut {generator@$DIR/inline_generator.rs:16:5: 16:8};
let mut _4: {generator@$DIR/inline_generator.rs:16:5: 16:8};
2023-09-30 05:44:31 -05:00
+ let mut _6: bool;
2020-11-10 18:00:00 -06:00
scope 1 {
2023-06-06 08:47:00 -05:00
debug _r => _1;
2020-11-10 18:00:00 -06:00
}
2023-06-06 08:47:00 -05:00
+ scope 2 (inlined g) {
2023-09-30 05:44:31 -05:00
+ let mut _5: {generator@$DIR/inline_generator.rs:16:5: 16:8};
2020-11-10 18:00:00 -06:00
+ }
+ scope 3 (inlined Pin::<&mut {generator@$DIR/inline_generator.rs:16:5: 16:8}>::new) {
2023-06-06 08:47:00 -05:00
+ debug pointer => _3;
2020-11-10 18:00:00 -06:00
+ scope 4 {
+ scope 5 (inlined Pin::<&mut {generator@$DIR/inline_generator.rs:16:5: 16:8}>::new_unchecked) {
2023-06-06 08:47:00 -05:00
+ debug pointer => _3;
2020-11-10 18:00:00 -06:00
+ }
+ }
+ }
2023-06-06 08:47:00 -05:00
+ scope 6 (inlined g::{closure#0}) {
2023-09-30 05:44:31 -05:00
+ debug a => _6;
+ let mut _7: &mut {generator@$DIR/inline_generator.rs:16:5: 16:8};
+ let mut _8: u32;
+ let mut _9: i32;
2020-11-10 18:00:00 -06:00
+ }
bb0: {
2023-06-06 08:47:00 -05:00
StorageLive(_1);
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
2023-06-23 11:53:09 -05:00
- _4 = g() -> [return: bb1, unwind continue];
2020-11-10 18:00:00 -06:00
- }
-
- bb1: {
2023-09-30 05:44:31 -05:00
+ StorageLive(_5);
+ _5 = {generator@$DIR/inline_generator.rs:16:5: 16:8 (#0)};
+ _4 = move (_5 as subtype {generator@$DIR/inline_generator.rs:16:5: 16:8});
2023-09-30 05:44:31 -05:00
+ StorageDead(_5);
2023-06-06 08:47:00 -05:00
_3 = &mut _4;
2023-01-28 12:49:48 -06:00
- _2 = Pin::<&mut {generator@$DIR/inline_generator.rs:16:5: 16:8}>::new(move _3) -> [return: bb2, unwind: bb5];
2020-11-10 18:00:00 -06:00
- }
-
- bb2: {
+ _2 = Pin::<&mut {generator@$DIR/inline_generator.rs:16:5: 16:8}> { pointer: move _3 };
2023-06-06 08:47:00 -05:00
StorageDead(_3);
2023-01-28 12:49:48 -06:00
- _1 = <{generator@$DIR/inline_generator.rs:16:5: 16:8} as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb5];
2023-09-30 05:44:31 -05:00
+ StorageLive(_6);
+ _6 = const false;
+ _7 = (_2.0: &mut {generator@$DIR/inline_generator.rs:16:5: 16:8});
+ _8 = discriminant((*_7));
+ switchInt(move _8) -> [0: bb5, 1: bb9, 3: bb10, otherwise: bb11];
2020-11-10 18:00:00 -06:00
}
- bb3: {
+ bb1: {
+ StorageDead(_6);
2023-06-06 08:47:00 -05:00
StorageDead(_2);
2023-01-28 12:49:48 -06:00
- drop(_4) -> [return: bb4, unwind: bb6];
+ drop(_4) -> [return: bb2, unwind: bb4];
}
- bb4: {
+ bb2: {
2023-06-06 08:47:00 -05:00
StorageDead(_4);
_0 = const ();
StorageDead(_1);
return;
2020-11-10 18:00:00 -06:00
}
2023-01-28 12:49:48 -06:00
- bb5 (cleanup): {
- drop(_4) -> [return: bb6, unwind terminate(cleanup)];
+ bb3 (cleanup): {
+ drop(_4) -> [return: bb4, unwind terminate(cleanup)];
}
- bb6 (cleanup): {
+ bb4 (cleanup): {
2023-06-06 08:47:00 -05:00
resume;
2020-11-10 18:00:00 -06:00
+ }
+
2023-01-28 12:49:48 -06:00
+ bb5: {
2023-09-30 05:44:31 -05:00
+ StorageLive(_9);
+ switchInt(_6) -> [0: bb6, otherwise: bb7];
2020-11-10 18:00:00 -06:00
+ }
+
2023-01-28 12:49:48 -06:00
+ bb6: {
2023-09-30 05:44:31 -05:00
+ _9 = const 13_i32;
2023-01-28 12:49:48 -06:00
+ goto -> bb8;
2020-11-10 18:00:00 -06:00
+ }
+
2023-01-28 12:49:48 -06:00
+ bb7: {
2023-09-30 05:44:31 -05:00
+ _9 = const 7_i32;
2023-01-28 12:49:48 -06:00
+ goto -> bb8;
2020-11-10 18:00:00 -06:00
+ }
+
2023-01-28 12:49:48 -06:00
+ bb8: {
2023-09-30 05:44:31 -05:00
+ _1 = GeneratorState::<i32, bool>::Yielded(move _9);
+ discriminant((*_7)) = 3;
2023-06-06 08:47:00 -05:00
+ goto -> bb1;
2020-11-10 18:00:00 -06:00
+ }
+
2023-01-28 12:49:48 -06:00
+ bb9: {
+ assert(const false, "generator resumed after completion") -> [success: bb9, unwind: bb3];
+ }
+
2023-01-28 12:49:48 -06:00
+ bb10: {
2023-09-30 05:44:31 -05:00
+ StorageLive(_9);
+ StorageDead(_9);
+ _1 = GeneratorState::<i32, bool>::Complete(_6);
+ discriminant((*_7)) = 1;
2023-06-06 08:47:00 -05:00
+ goto -> bb1;
2020-11-10 18:00:00 -06:00
+ }
+
2023-01-28 12:49:48 -06:00
+ bb11: {
2023-06-06 08:47:00 -05:00
+ unreachable;
2020-11-10 18:00:00 -06:00
}
}