summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/building/match_false_edges.main.built.after.mir
blob: 91fe2f90e35b2e97e855c85104057b885da4f3a0 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// 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);
        FakeRead(ForMatchedPlace(None), _2);
        _4 = discriminant(_2);
        switchInt(move _4) -> [1: bb2, otherwise: bb1];
    }

    bb1: {
        falseEdge -> [real: bb13, imaginary: bb6];
    }

    bb2: {
        falseEdge -> [real: bb8, imaginary: bb1];
    }

    bb3: {
        goto -> bb1;
    }

    bb4: {
        _3 = discriminant(_2);
        switchInt(move _3) -> [1: bb6, otherwise: bb5];
    }

    bb5: {
        StorageLive(_14);
        _14 = _2;
        _1 = const 4_i32;
        StorageDead(_14);
        goto -> bb19;
    }

    bb6: {
        falseEdge -> [real: bb14, imaginary: bb5];
    }

    bb7: {
        goto -> bb5;
    }

    bb8: {
        StorageLive(_7);
        _7 = &((_2 as Some).0: i32);
        _5 = &shallow _2;
        StorageLive(_8);
        _8 = guard() -> [return: bb9, unwind: bb20];
    }

    bb9: {
        switchInt(move _8) -> [0: bb11, otherwise: bb10];
    }

    bb10: {
        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 -> bb19;
    }

    bb11: {
        goto -> bb12;
    }

    bb12: {
        StorageDead(_8);
        StorageDead(_7);
        falseEdge -> [real: bb3, imaginary: bb1];
    }

    bb13: {
        StorageLive(_9);
        _9 = _2;
        _1 = const 2_i32;
        StorageDead(_9);
        goto -> bb19;
    }

    bb14: {
        StorageLive(_11);
        _11 = &((_2 as Some).0: i32);
        _5 = &shallow _2;
        StorageLive(_12);
        StorageLive(_13);
        _13 = (*_11);
        _12 = guard2(move _13) -> [return: bb15, unwind: bb20];
    }

    bb15: {
        switchInt(move _12) -> [0: bb17, otherwise: bb16];
    }

    bb16: {
        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 -> bb19;
    }

    bb17: {
        goto -> bb18;
    }

    bb18: {
        StorageDead(_13);
        StorageDead(_12);
        StorageDead(_11);
        falseEdge -> [real: bb7, imaginary: bb5];
    }

    bb19: {
        PlaceMention(_1);
        StorageDead(_2);
        StorageDead(_1);
        _0 = const ();
        return;
    }

    bb20 (cleanup): {
        resume;
    }
}