Skip to content
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

Merged
merged 2 commits into from
May 19, 2022

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented May 15, 2022

This makes the code simpler and easier to read.

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
@bjorn3 bjorn3 added the C-cleanup Category: PRs that clean code up or issues documenting cleanup. label May 15, 2022
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 15, 2022
@rust-highfive
Copy link
Collaborator

r? @compiler-errors

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 15, 2022
@@ -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;
Copy link
Member

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))?

Copy link
Contributor

@klensy klensy May 15, 2022

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).

Copy link
Member

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.

Copy link
Member Author

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.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 18, 2022

📌 Commit a06deb5 has been approved by compiler-errors

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 18, 2022
…mpiler-errors

Couple of refactorings to cg_ssa::base::codegen_crate

This makes the code simpler and easier to read.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 19, 2022
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
@bors bors merged commit 330e03f into rust-lang:master May 19, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 19, 2022
@bjorn3 bjorn3 deleted the cg_ssa_driver_refactor branch May 20, 2022 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants