-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve HIR stats #101142
Improve HIR stats #101142
Conversation
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.
For consistency, and because it makes HIR measurement simpler and more accurate.
For consistency, and because it makes HIR measurement simpler and more accurate.
For consistency, and because it makes HIR measurement simpler and more accurate.
This comment on the HIR `visit_path_segment` is supposed be on the AST `visit_path_segment`.
Because `hir_id` is the standard name for methods that return a `HirId` from a HIR node.
Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting. Brings it in line with the AST stats collector.
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
Best reviewed one commit at a time. |
I learned that @michaelwoerister is on leave. Let's try another reviewer. r? @davidtwco |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, one nit, feel free to resolve it or not, r=me.
@@ -416,7 +416,7 @@ pub fn configure_and_expand( | |||
} | |||
|
|||
if sess.opts.unstable_opts.hir_stats { | |||
hir_stats::print_ast_stats(&krate, "POST EXPANSION AST STATS"); | |||
hir_stats::print_ast_stats(&krate, "POST EXPANSION AST STATS", "ast-stats-2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ast-stats-2
could probably be ast-post-stats
or something a little more descriptive? Likewise with ast-stats-1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it as is. Anything short of ast-stats-{pre,post}-expansion
is going to be non-obvious to a first-time user, but that's a bit on the long side. And the heading ensures that a first-time user will be able to quickly work out the meaning of the 1
and 2
.
@bors r=davidtwco |
Rollup of 6 pull requests Successful merges: - rust-lang#101142 (Improve HIR stats) - rust-lang#101367 (Suggest `{Option,Result}::{copied,clone}()` to satisfy type mismatch) - rust-lang#101391 (more clippy::perf fixes) - rust-lang#101409 (Don't fire `rust_2021_incompatible_closure_captures` in `edition = 2021` crates) - rust-lang#101420 (Fix `hir::Local` doc to match with the variable name used: `init`) - rust-lang#101429 (Don't suggest reborrow if usage is inside a closure) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…avidtwco Improve HIR stats rust-lang#100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
#100398 improve the AST stats collection done by
-Zhir-stats
. This PR does the same for HIR stats collection.r? @davidtwco