-
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
Minor rustc_mir_dataflow
cleanups
#118203
Conversation
The current order is a mess.
`lib.rs` is a strange place for it, and it's only used within `rustc_peek.rs`, so it doesn't need to be `pub`.
It's not useful, and only obfuscates things.
`Forward` is the default.
All the fields are named.
Some types have a `body: &'mir Body<'tcx>` and some have `body: &'a Body<'tcx>`. The former is more readable, so this commit converts some fo the latter to the former.
`body` is already a `&Body`.
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
`on_all_children_bits` has two arguments that are unused: `tcx` and `body`. This was not detected by the compiler because it's a recursive function. This commit removes them, and removes lots of other arguments and fields that are no longer necessary.
`mut_results` immediately below is the `&mut self` version, this one should be `&self`.
We can just call `ResultsCursor::state` and `ResultsCursor::analysis` separately.
BTW I am working on some more extensive simplifications to this code, but it's good to get lots of the little changes out of the way first in this PR. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e2e978f): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 673.908s -> 674.85s (0.14%) |
…aflow-cleanups, r=<try> Still more `rustc_mir_dataflow` cleanups A sequel to rust-lang#118203, rust-lang#118230, rust-lang#118638, and rust-lang#131481. I'm pleased with this PR. It cleans up a few things that have been bugging me for a while. It took quite some effort to find these improvements. r? `@cjgillot`
r? @cjgillot