summary refs log tree commit diff
path: root/src/test/ui/stats
AgeCommit message (Collapse)AuthorLines
2022-09-08Introduce `DotDotPos`.Nicholas Nethercote-12/+12
This shrinks `hir::Pat` from 88 to 72 bytes.
2022-09-08Arena-allocate `hir::Lifetime`.Nicholas Nethercote-34/+35
This shrinks `hir::Ty` from 72 to 48 bytes. `visit_lifetime` is added to the HIR stats collector because these types are now stored in memory on their own, instead of being within other types.
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-22/+23
Fixes #46213
2022-09-05use `propagate_through_exprs` instead of `propagate_through_expr`Takayuki Maeda-22/+22
fix `ExprKind` static_assert_size fix hir-stats
2022-08-29Improve HIR stats collector.Nicholas Nethercote-20/+52
Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting. Brings it in line with the AST stats collector.
2022-08-29Add prefix to every line of `-Zhir-stats` output.Nicholas Nethercote-151/+145
This is based on `-Zprint-type-sizes` which does the same thing. It makes the output provenance clearer, and helps with post-processing. E.g. if you have `-Zhir-stats` output from numerous compiler invocations you can now easily extract the pre-expansion stats separately from the post-expansion stats.
2022-08-22Use `AttrVec` in more places.Nicholas Nethercote-67/+67
In some places we use `Vec<Attribute>` and some places we use `ThinVec<Attribute>` (a.k.a. `AttrVec`). This results in various points where we have to convert between `Vec` and `ThinVec`. This commit changes the places that use `Vec<Attribute>` to use `AttrVec`. A lot of this is mechanical and boring, but there are some interesting parts: - It adds a few new methods to `ThinVec`. - It implements `MapInPlace` for `ThinVec`, and introduces a macro to avoid the repetition of this trait for `Vec`, `SmallVec`, and `ThinVec`. Overall, it makes the code a little nicer, and has little effect on performance. But it is a precursor to removing `rustc_data_structures::thin_vec::ThinVec` and replacing it with `thin_vec::ThinVec`, which is implemented more efficiently.
2022-08-17Box the `MacCall` in various types.Nicholas Nethercote-55/+55
2022-08-16Shrink `ast::Attribute`.Nicholas Nethercote-100/+100
2022-08-11Add a second level to the AST size reporting.Nicholas Nethercote-2/+62
This tells you which variants of the enums are most common, which is very useful. I've only done it for the AST for now, HIR can be done later.
2022-08-11Add percentages to `-Zhir-stats` output.Nicholas Nethercote-70/+70
2022-08-11Change how `AssocItem` is reported.Nicholas Nethercote-4/+2
Currently it's reported as either `TraitItem` or `ImplItem`. This commit changes it to `AssocItem`, because having the report match the type name is (a) consistent with other types, and (b) the trait/impl split isn't that important here.
2022-08-11Improve AST stat collector.Nicholas Nethercote-5/+15
This commit: - Adds a comment explaining which `visit_*` methods should be implemented. - Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting.
2022-08-11Add a test for `-Zhir-stats` output.Nicholas Nethercote-0/+124
This will be very useful in subsequent commits where I will improve the output.