summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/coroutine_storage_dead_unwind.main-{closure#0}.StateTransform.before.panic-unwind.mir
blob: 1773db1abffe3969e449e31d2bb5842ee7f4aa85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// MIR for `main::{closure#0}` before StateTransform

fn main::{closure#0}(_1: {coroutine@$DIR/coroutine_storage_dead_unwind.rs:23:16: 23:18}, _2: ()) -> ()
yields ()
 {
    let mut _0: ();
    let _3: Foo;
    let _5: ();
    let mut _6: ();
    let _7: ();
    let mut _8: Foo;
    let _9: ();
    let mut _10: Bar;
    scope 1 {
        debug a => _3;
        let _4: Bar;
        scope 2 {
            debug b => _4;
        }
    }

    bb0: {
        StorageLive(_3);
        _3 = Foo(const 5_i32);
        StorageLive(_4);
        _4 = Bar(const 6_i32);
        StorageLive(_5);
        StorageLive(_6);
        _6 = ();
        _5 = yield(move _6) -> [resume: bb1, drop: bb6];
    }

    bb1: {
        StorageDead(_6);
        StorageDead(_5);
        StorageLive(_7);
        StorageLive(_8);
        _8 = move _3;
        _7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb10];
    }

    bb2: {
        StorageDead(_8);
        StorageDead(_7);
        StorageLive(_9);
        StorageLive(_10);
        _10 = move _4;
        _9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb9];
    }

    bb3: {
        StorageDead(_10);
        StorageDead(_9);
        _0 = const ();
        StorageDead(_4);
        goto -> bb4;
    }

    bb4: {
        StorageDead(_3);
        drop(_1) -> [return: bb5, unwind: bb14];
    }

    bb5: {
        return;
    }

    bb6: {
        StorageDead(_6);
        StorageDead(_5);
        StorageDead(_4);
        drop(_3) -> [return: bb7, unwind: bb15];
    }

    bb7: {
        StorageDead(_3);
        drop(_1) -> [return: bb8, unwind: bb14];
    }

    bb8: {
        coroutine_drop;
    }

    bb9 (cleanup): {
        StorageDead(_10);
        StorageDead(_9);
        goto -> bb12;
    }

    bb10 (cleanup): {
        goto -> bb11;
    }

    bb11 (cleanup): {
        StorageDead(_8);
        StorageDead(_7);
        goto -> bb12;
    }

    bb12 (cleanup): {
        StorageDead(_4);
        goto -> bb13;
    }

    bb13 (cleanup): {
        StorageDead(_3);
        drop(_1) -> [return: bb14, unwind terminate(cleanup)];
    }

    bb14 (cleanup): {
        resume;
    }

    bb15 (cleanup): {
        StorageDead(_3);
        drop(_1) -> [return: bb14, unwind terminate(cleanup)];
    }
}