Skip to content

Refactor linker code #86911

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

Merged
merged 8 commits into from
Jul 7, 2021
Merged

Refactor linker code #86911

merged 8 commits into from
Jul 7, 2021

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Jul 6, 2021

This merges LinkerInfo into CrateInfo as there is no reason to keep them separate. LinkerInfo::to_linker is merged into get_linker as both have different logic for each linker type and to_linker is directly called after get_linker. Also contains a couple of small cleanups.

See the individual commits for all changes.

@bjorn3 bjorn3 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 6, 2021
@rust-highfive
Copy link
Contributor

Some changes occured to rustc_codegen_cranelift

cc @bjorn3

@rust-highfive
Copy link
Contributor

r? @davidtwco

(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 Jul 6, 2021
@petrochenkov
Copy link
Contributor

r? @petrochenkov

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r=me with fulldeps tests fixed.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 6, 2021
@bjorn3
Copy link
Member Author

bjorn3 commented Jul 6, 2021

I would like to do a perf run first. I have been bitten by a perf regression during refactorings more than once.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 6, 2021
@bors
Copy link
Collaborator

bors commented Jul 6, 2021

⌛ Trying commit 25e45ba with merge 0a0da8444906b2540c2e9df61115d7fb40e2b4a0...

@bors
Copy link
Collaborator

bors commented Jul 6, 2021

☀️ Try build successful - checks-actions
Build commit: 0a0da8444906b2540c2e9df61115d7fb40e2b4a0 (0a0da8444906b2540c2e9df61115d7fb40e2b4a0)

@rust-timer
Copy link
Collaborator

Queued 0a0da8444906b2540c2e9df61115d7fb40e2b4a0 with parent b09dad3, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (0a0da8444906b2540c2e9df61115d7fb40e2b4a0): comparison url.

Summary: This benchmark run did not return any significant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 6, 2021
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 6, 2021
@bjorn3
Copy link
Member Author

bjorn3 commented Jul 6, 2021

Mostly improvements up to 0.7%. Only a couple regressions up to 0.4%.

@bjorn3
Copy link
Member Author

bjorn3 commented Jul 6, 2021

@bors r=petrochenkov

@bors
Copy link
Collaborator

bors commented Jul 6, 2021

📌 Commit 25e45ba has been approved by petrochenkov

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 6, 2021
@nagisa
Copy link
Member

nagisa commented Jul 6, 2021

I would like to see the commit messages expanded with more of "why" in addition to "what". For example, what is the motivation to move LinkerInfo into CrateInfo? I would also like to see some discussion on why this is the overall direction we want to be taking.

@petrochenkov
Copy link
Contributor

I think the changes are reasonable because LinkerInfo generally doesn't make sense as a separate structure.

Yes, it contains some pre-computed properties of the compilation session used when building linker invocation, but it's not clear why they should be separated from similar properties from (maybe misnamed) CrateInfo.

@nagisa
Copy link
Member

nagisa commented Jul 6, 2021 via email

@bjorn3
Copy link
Member Author

bjorn3 commented Jul 6, 2021

Edited the PR description to describe the reason behind some changes.

@bors
Copy link
Collaborator

bors commented Jul 6, 2021

⌛ Testing commit 25e45ba with merge b20e3ff...

@bors
Copy link
Collaborator

bors commented Jul 7, 2021

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing b20e3ff to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 7, 2021
@bors bors merged commit b20e3ff into rust-lang:master Jul 7, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 7, 2021
@bjorn3 bjorn3 deleted the crate_info_refactor branch July 8, 2021 16:33
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. merged-by-bors This PR was explicitly merged by bors. 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.

9 participants