-
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
Couple of refactorings to cg_ssa::base::codegen_crate #97062
Conversation
There is no reason it needs to be lazily computed at the first iteration of the cgu loop.
This reduces the complexity of this code a lot
(rust-highfive has picked a reviewer for you, use r? to override) |
@@ -15,8 +15,9 @@ use rustc_attr as attr; | |||
use rustc_data_structures::fx::FxHashMap; | |||
use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry}; | |||
|
|||
use rustc_data_structures::sync::par_iter; |
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.
where is par_iter
called in cfg(not(parallel_compiler))
?
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 think it moved because in other case in will fail to compile, the reason is cfg!(parallel_compiler)
. If return back #[cfg(parallel_compiler)]
all should work (at least i remembering something like that when i touched that part of code here #93787).
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.
My bad, I didn't see the par_iter
call in the hidden section between the diffs.
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 switched from #[cfg]
to cfg!()
to ensure that changes to the code are always typechecked and not just when explicitly running in the parallel_compiler configuration.
@bors r+ |
📌 Commit a06deb5 has been approved by |
…mpiler-errors Couple of refactorings to cg_ssa::base::codegen_crate This makes the code simpler and easier to read.
Rollup of 6 pull requests Successful merges: - rust-lang#96866 (Switch CI bucket uploads to intelligent tiering) - rust-lang#97062 (Couple of refactorings to cg_ssa::base::codegen_crate) - rust-lang#97127 (Revert "Auto merge of rust-lang#96441 - ChrisDenton:sync-pipes, r=m-ou-se") - rust-lang#97131 (Improve println! documentation) - rust-lang#97139 (Move some settings DOM generation out of JS) - rust-lang#97152 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This makes the code simpler and easier to read.