You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments