fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `complicated_match` after SimplifyCfg-initial 2+ // MIR for `complicated_match` after ElaborateDrops 3 4 fn complicated_match(_1: bool, _2: (bool, bool, String)) -> i32 { 5 debug cond => _1; 6 debug items => _2; 7 let mut _0: i32; 8 let mut _3: &bool; 9 let mut _4: &bool; 10 let _5: bool; 11 let _6: &bool; 12 let _7: std::string::String; 13 let _8: &std::string::String; 14 let mut _9: bool; 15 let mut _10: bool; 16 let mut _11: !; 17 let mut _12: bool; 18 let mut _13: bool; 19 let mut _14: !; 20 let _15: bool; 21 let _16: std::string::String; 22 scope 1 { 23 debug a => _5; 24 debug a => _6; 25 debug s => _7; 26 debug s => _8; 27 } 28 scope 2 { 29 debug b => _15; 30 debug t => _16; 31 } 32 33 bb0: { 34- FakeRead(ForMatchedPlace(None), _2); 35- switchInt((_2.0: bool)) -> [0: bb1, otherwise: bb2]; 36+ switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1]; 37 } 38 39 bb1: { 40- falseEdge -> [real: bb8, imaginary: bb3]; 41+ switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2]; 42 } 43 44 bb2: { 45- switchInt((_2.1: bool)) -> [0: bb3, otherwise: bb4]; 46+ switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17]; 47 } 48 49 bb3: { 50- falseEdge -> [real: bb13, imaginary: bb5]; 51- } 52- 53- bb4: { 54- switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb5]; 55- } 56- 57- bb5: { 58- falseEdge -> [real: bb20, imaginary: bb6]; 59- } 60- 61- bb6: { 62 StorageLive(_15); 63 _15 = (_2.1: bool); 64 StorageLive(_16); 65 _16 = move (_2.2: std::string::String); 66- goto -> bb19; 67+ goto -> bb16; 68 } 69 70- bb7: { 71+ bb4: { 72 _0 = const 1_i32; 73- drop(_7) -> [return: bb18, unwind: bb25]; 74+ drop(_7) -> [return: bb15, unwind: bb22]; 75 } 76 77- bb8: { 78+ bb5: { 79 StorageLive(_6); 80 _6 = &(_2.1: bool); 81 StorageLive(_8); 82 _8 = &(_2.2: std::string::String); 83- _3 = &shallow (_2.0: bool); 84- _4 = &shallow (_2.1: bool); 85 StorageLive(_9); 86 StorageLive(_10); 87 _10 = _1; 88- switchInt(move _10) -> [0: bb10, otherwise: bb9]; 89+ switchInt(move _10) -> [0: bb7, otherwise: bb6]; 90 } 91 92- bb9: { 93+ bb6: { 94 _0 = const 3_i32; 95 StorageDead(_10); 96 StorageDead(_9); 97- goto -> bb23; 98+ goto -> bb20; 99 } 100 101- bb10: { 102+ bb7: { 103 _9 = (*_6); 104- switchInt(move _9) -> [0: bb12, otherwise: bb11]; 105+ switchInt(move _9) -> [0: bb9, otherwise: bb8]; 106 } 107 108- bb11: { 109+ bb8: { 110 StorageDead(_10); 111 StorageDead(_9); 112- FakeRead(ForMatchGuard, _3); 113- FakeRead(ForMatchGuard, _4); 114- FakeRead(ForGuardBinding, _6); 115- FakeRead(ForGuardBinding, _8); 116 StorageLive(_5); 117 _5 = (_2.1: bool); 118 StorageLive(_7); 119 _7 = move (_2.2: std::string::String); 120- goto -> bb7; 121+ goto -> bb4; 122 } 123 124- bb12: { 125+ bb9: { 126 StorageDead(_10); 127 StorageDead(_9); 128 StorageDead(_8); 129 StorageDead(_6); 130- falseEdge -> [real: bb2, imaginary: bb3]; 131+ goto -> bb1; 132 } 133 134- bb13: { 135+ bb10: { 136 StorageLive(_6); 137 _6 = &(_2.0: bool); 138 StorageLive(_8); 139 _8 = &(_2.2: std::string::String); 140- _3 = &shallow (_2.0: bool); 141- _4 = &shallow (_2.1: bool); 142 StorageLive(_12); 143 StorageLive(_13); 144 _13 = _1; 145- switchInt(move _13) -> [0: bb15, otherwise: bb14]; 146+ switchInt(move _13) -> [0: bb12, otherwise: bb11]; 147 } 148 149- bb14: { 150+ bb11: { 151 _0 = const 3_i32; 152 StorageDead(_13); 153 StorageDead(_12); 154- goto -> bb23; 155+ goto -> bb20; 156 } 157 158- bb15: { 159+ bb12: { 160 _12 = (*_6); 161- switchInt(move _12) -> [0: bb17, otherwise: bb16]; 162+ switchInt(move _12) -> [0: bb14, otherwise: bb13]; 163 } 164 165- bb16: { 166+ bb13: { 167 StorageDead(_13); 168 StorageDead(_12); 169- FakeRead(ForMatchGuard, _3); 170- FakeRead(ForMatchGuard, _4); 171- FakeRead(ForGuardBinding, _6); 172- FakeRead(ForGuardBinding, _8); 173 StorageLive(_5); 174 _5 = (_2.0: bool); 175 StorageLive(_7); 176 _7 = move (_2.2: std::string::String); 177- goto -> bb7; 178+ goto -> bb4; 179 } 180 181- bb17: { 182+ bb14: { 183 StorageDead(_13); 184 StorageDead(_12); 185 StorageDead(_8); 186 StorageDead(_6); 187- falseEdge -> [real: bb4, imaginary: bb5]; 188+ goto -> bb2; 189 } 190 191- bb18: { 192+ bb15: { 193 StorageDead(_7); 194 StorageDead(_5); 195 StorageDead(_8); 196 StorageDead(_6); 197- goto -> bb22; 198+ goto -> bb19; 199 } 200 201- bb19: { 202+ bb16: { 203 _0 = const 2_i32; 204- drop(_16) -> [return: bb21, unwind: bb25]; 205+ drop(_16) -> [return: bb18, unwind: bb22]; 206 } 207 208- bb20: { 209+ bb17: { 210 StorageLive(_15); 211 _15 = (_2.1: bool); 212 StorageLive(_16); 213 _16 = move (_2.2: std::string::String); 214- goto -> bb19; 215+ goto -> bb16; 216 } 217 218- bb21: { 219+ bb18: { 220 StorageDead(_16); 221 StorageDead(_15); 222- goto -> bb22; 223+ goto -> bb19; 224 } 225 226- bb22: { 227- drop(_2) -> [return: bb24, unwind: bb26]; 228+ bb19: { 229+ goto -> bb26; 230 } 231 232- bb23: { 233+ bb20: { 234 StorageDead(_8); 235 StorageDead(_6); 236- drop(_2) -> [return: bb24, unwind: bb26]; 237+ drop(_2) -> [return: bb21, unwind: bb23]; 238 } 239 240- bb24: { 241+ bb21: { 242 return; 243 } 244 245- bb25 (cleanup): { 246- drop(_2) -> [return: bb26, unwind terminate(cleanup)]; 247+ bb22 (cleanup): { 248+ goto -> bb27; 249 } 250 251- bb26 (cleanup): { 252+ bb23 (cleanup): { 253 resume; 254+ } 255+ 256+ bb24: { 257+ goto -> bb21; 258+ } 259+ 260+ bb25 (cleanup): { 261+ goto -> bb23; 262+ } 263+ 264+ bb26: { 265+ goto -> bb24; 266+ } 267+ 268+ bb27 (cleanup): { 269+ goto -> bb23; 270 } 271 } 272