Commit 7ce7139
committed
Auto merge of #30301 - michaelwoerister:mir-to-metadata2, r=nikomatsakis
This PR makes `Mir` `RustcEncodable` and `RustcDecodable` and stores it in crate metadata for inlinable items.
Some other things in here:
- `mir::visit::Visitor` is extended to also visit `Literals`, `Spans` and `DefIds`.
- It also adds `mir::visit::MutVisitor` which allows to mutate the visited `Mir` structure in place.
- Some numbers on how big MIR is in metadata (total metadata size in bytes):
| | w/ MIR | w/o MIR | Rel. Size |
|----------------|-----------:|------------:|:---------:|
| libcore | 17,695,473 | 14,263,377 | 124% |
| liblibc | 411,440 | 404,382 | 102% |
| libcollections | 4,537,975 | 3,526,933 | 129% |
| libserialize | 2,574,769 | 2,060,798 | 125% |
| libsyntax | 15,262,894 | 12,075,574 | 126% |
| librustc | 16,984,537 | 13,692,168 | 124% |
So, adding MIR to metadata makes it about 25% bigger. It could be worse, considering that it still uses the inefficient RBML encoding. Still, the question is whether we should put MIR emission behind a `-Z` flag.File tree
20 files changed
+567
-63
lines changed- src
- librustc_data_structures
- librustc_metadata
- librustc_mir
- build
- expr
- matches
- transform
- librustc_trans/trans
- mir
- librustc
- middle
- ty
- mir
20 files changed
+567
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
| 221 | + | |
| 222 | + | |
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
| |||
235 | 239 | | |
236 | 240 | | |
237 | 241 | | |
| 242 | + | |
238 | 243 | | |
239 | 244 | | |
240 | 245 | | |
| |||
383 | 388 | | |
384 | 389 | | |
385 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
386 | 394 | | |
387 | 395 | | |
388 | 396 | | |
| |||
404 | 412 | | |
405 | 413 | | |
406 | 414 | | |
| 415 | + | |
407 | 416 | | |
408 | 417 | | |
409 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
236 | | - | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
249 | 269 | | |
250 | 270 | | |
251 | 271 | | |
| |||
434 | 454 | | |
435 | 455 | | |
436 | 456 | | |
437 | | - | |
| 457 | + | |
438 | 458 | | |
439 | 459 | | |
440 | 460 | | |
| |||
632 | 652 | | |
633 | 653 | | |
634 | 654 | | |
635 | | - | |
| 655 | + | |
636 | 656 | | |
637 | 657 | | |
638 | 658 | | |
| |||
701 | 721 | | |
702 | 722 | | |
703 | 723 | | |
704 | | - | |
| 724 | + | |
705 | 725 | | |
706 | 726 | | |
707 | 727 | | |
| |||
0 commit comments