Commit 6114e3e
authored
Rollup merge of rust-lang#71840 - matthewjasper:drop-trees, r=oli-obk
Rework MIR drop tree lowering
This PR changes how drops are generated in MIR construction. This is the first half of the fix for rust-lang#47949.
Rather than generating the drops for a given unwind/break/continue/return/generator drop path as soon as they are needed, the required drops are recorded and get generated later.
The motivation for this is
* It simplifies the caching scheme, because it's now possible to walk up the currently scheduled drop tree to recover state.
* The basic block order for MIR more closely resembles execution order.
This PR also:
* Highlights cleanup blocks in the graphviz MIR output.
* Removes some unnecessary drop flag assignments.File tree
56 files changed
+1618
-1749
lines changed- src
- librustc_mir_build/build
- expr
- matches
- librustc_mir
- dataflow/move_paths
- util
- test
- codegen
- mir-opt
- basic_assignment
- box_expr
- const-promotion-extern-static
- const_prop/boxes
- generator-drop-cleanup
- generator-storage-dead-unwind
- graphviz
- inline/inline-into-box-place
- 32bit
- 64bit
- issue-38669
- issue-41110
- issue-41697
- 32bit
- 64bit
- issue-41888
- issue-49232
- issue-62289
- loop_test
- match-arm-scopes
- match_false_edges
- nll/region-subtyping-basic
- 32bit
- 64bit
- no-drop-for-inactive-variant
- no-spurious-drop-after-call
- packed-struct-drop-aligned
- 32bit
- 64bit
- retag
- simple-match
- 32bit
- 64bit
- simplify_cfg
- simplify_try
- storage_live_dead_in_statics
- uniform_array_move_out
- unusual-item-types
- 32bit
- 64bit
- while-storage
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+1618
-1749
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
364 | 371 | | |
365 | 372 | | |
366 | 373 | | |
367 | | - | |
368 | | - | |
369 | 374 | | |
370 | 375 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | 376 | | |
376 | 377 | | |
377 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | 166 | | |
169 | 167 | | |
170 | 168 | | |
| |||
175 | 173 | | |
176 | 174 | | |
177 | 175 | | |
178 | | - | |
179 | | - | |
180 | | - | |
| 176 | + | |
181 | 177 | | |
182 | 178 | | |
183 | 179 | | |
| |||
249 | 245 | | |
250 | 246 | | |
251 | 247 | | |
252 | | - | |
| 248 | + | |
253 | 249 | | |
254 | 250 | | |
255 | 251 | | |
| |||
278 | 274 | | |
279 | 275 | | |
280 | 276 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 277 | + | |
288 | 278 | | |
289 | 279 | | |
290 | 280 | | |
| |||
820 | 810 | | |
821 | 811 | | |
822 | 812 | | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
| 813 | + | |
828 | 814 | | |
829 | 815 | | |
830 | 816 | | |
| |||
835 | 821 | | |
836 | 822 | | |
837 | 823 | | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
| 824 | + | |
| 825 | + | |
845 | 826 | | |
846 | 827 | | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | 828 | | |
853 | 829 | | |
854 | 830 | | |
| |||
861 | 837 | | |
862 | 838 | | |
863 | 839 | | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
864 | 845 | | |
865 | 846 | | |
866 | 847 | | |
| |||
969 | 950 | | |
970 | 951 | | |
971 | 952 | | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | 953 | | |
978 | 954 | | |
979 | 955 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | | - | |
103 | | - | |
| 107 | + | |
104 | 108 | | |
105 | | - | |
| 109 | + | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | 137 | | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
142 | | - | |
| 141 | + | |
143 | 142 | | |
144 | 143 | | |
145 | | - | |
146 | 144 | | |
147 | 145 | | |
148 | 146 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 147 | + | |
153 | 148 | | |
| 149 | + | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
158 | 154 | | |
159 | 155 | | |
160 | 156 | | |
161 | | - | |
162 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
163 | 161 | | |
164 | 162 | | |
165 | 163 | | |
| |||
201 | 199 | | |
202 | 200 | | |
203 | 201 | | |
204 | | - | |
205 | 202 | | |
206 | 203 | | |
207 | 204 | | |
| |||
211 | 208 | | |
212 | 209 | | |
213 | 210 | | |
214 | | - | |
| 211 | + | |
215 | 212 | | |
216 | 213 | | |
217 | 214 | | |
| |||
223 | 220 | | |
224 | 221 | | |
225 | 222 | | |
| 223 | + | |
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
| |||
358 | 356 | | |
359 | 357 | | |
360 | 358 | | |
361 | | - | |
362 | 359 | | |
363 | 360 | | |
364 | 361 | | |
365 | | - | |
| 362 | + | |
366 | 363 | | |
| 364 | + | |
367 | 365 | | |
368 | 366 | | |
369 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
| |||
247 | 245 | | |
248 | 246 | | |
249 | 247 | | |
250 | | - | |
| 248 | + | |
251 | 249 | | |
252 | 250 | | |
253 | 251 | | |
| |||
284 | 282 | | |
285 | 283 | | |
286 | 284 | | |
287 | | - | |
| 285 | + | |
288 | 286 | | |
289 | 287 | | |
290 | 288 | | |
| |||
1590 | 1588 | | |
1591 | 1589 | | |
1592 | 1590 | | |
1593 | | - | |
| 1591 | + | |
1594 | 1592 | | |
1595 | 1593 | | |
1596 | 1594 | | |
| |||
1702 | 1700 | | |
1703 | 1701 | | |
1704 | 1702 | | |
1705 | | - | |
| 1703 | + | |
1706 | 1704 | | |
1707 | 1705 | | |
1708 | 1706 | | |
| |||
1746 | 1744 | | |
1747 | 1745 | | |
1748 | 1746 | | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
| 1747 | + | |
1755 | 1748 | | |
1756 | 1749 | | |
1757 | 1750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | 426 | | |
428 | 427 | | |
429 | 428 | | |
| |||
441 | 440 | | |
442 | 441 | | |
443 | 442 | | |
444 | | - | |
| 443 | + | |
445 | 444 | | |
446 | 445 | | |
447 | 446 | | |
| 447 | + | |
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| |||
0 commit comments