Skip to content

Refactor the abi handling code a bit - #79067

Merged
bors merged 5 commits into
rust-lang:masterfrom
bjorn3:abi_refactor
Nov 21, 2020
Merged

Refactor the abi handling code a bit#79067
bors merged 5 commits into
rust-lang:masterfrom
bjorn3:abi_refactor

Conversation

@bjorn3

Copy link
Copy Markdown
Member

I am not quite sure if all changes are improvements.

@bjorn3bjorn3 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. A-codegen Area: Code generation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 15, 2020
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @lcnr

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 15, 2020
@bjorn3
bjorn3force-pushed the abi_refactor branch 2 times, most recently from c75dd3f to c4aa9d9CompareNovember 15, 2020 10:13
@bjorn3
bjorn3 marked this pull request as draft November 15, 2020 10:24
@bjorn3
bjorn3force-pushed the abi_refactor branch 3 times, most recently from 9a81fa8 to 0c7827fCompareNovember 15, 2020 10:54
@bjorn3
bjorn3 marked this pull request as ready for review November 15, 2020 11:45
@bjorn3

bjorn3 commented Nov 15, 2020

Copy link
Copy Markdown
MemberAuthor

I mixed up the apply_llfn and apply_callsite methods a few times. It is now fixed. I also marked them as unsafe, as the mixup caused the process to abort.

@lcnrlcnr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this looks good to me but don't know enough about this.

Really like the commit structure ❤️

r? @nagisa maybe

Comment threadcompiler/rustc_target/src/abi/call/mod.rs Outdated
@lcnrlcnr assigned nagisa and unassigned lcnrNov 15, 2020
@lcnr

lcnr commented Nov 15, 2020

Copy link
Copy Markdown
Contributor

forgot that bors ignores review comments

@bors

bors commented Nov 19, 2020

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #79106) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@nagisanagisa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have concerns with the last commit. The arguments they take are &Value (i.e. must be valid pointers to a Value by construction) and the crash mentioned in the commit was more likely a downcast assertion, rather than a genuine memory safety problem.

The rest LGTM

Comment threadcompiler/rustc_target/src/abi/call/mod.rs Outdated
Comment threadcompiler/rustc_codegen_llvm/src/abi.rs Outdated
Both flags are mutually exclusive
@bjorn3

Copy link
Copy Markdown
MemberAuthor

I only have concerns with the last commit. The arguments they take are &Value (i.e. must be valid pointers to a Value by construction) and the crash mentioned in the commit was more likely a downcast assertion, rather than a genuine memory safety problem.

Dropped that commit

@bjorn3
bjorn3force-pushed the abi_refactor branch 2 times, most recently from adc1c7e to a833e6aCompareNovember 21, 2020 18:16
@nagisa

Copy link
Copy Markdown
Member

r=me with db6aa9f squashed away.

This makes it clearer that only PassMode::Indirect allows ByVal
It is applied exactly when the return value has an indirect pass mode.
Except for InReg on x86 fastcall, arg attrs are now only used for
optimization purposes and thus are fine to ignore.
@bjorn3

Copy link
Copy Markdown
MemberAuthor

@bors r=nagisa

@bors

bors commented Nov 21, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 43968aa has been approved by nagisa

@borsbors 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 Nov 21, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 21, 2020
Rollup of 8 pull requests
Successful merges:
- rust-lang#77844 (clarify rules for ZST Boxes)
- rust-lang#79067 (Refactor the abi handling code a bit)
- rust-lang#79182 (Fix links to extern types in rustdoc (fixesrust-lang#78777))
- rust-lang#79231 (Exhaustively match in variant count instrinsic)
- rust-lang#79238 (Direct RUSTC_LOG (tracing/log) output to stderr instead of stdout.)
- rust-lang#79256 (Fix typos)
- rust-lang#79264 (Get rid of some doctree items)
- rust-lang#79272 (Support building clone shims for arrays with generic size)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 4268357 into rust-lang:masterNov 21, 2020
@rustbotrustbot added this to the 1.50.0 milestone Nov 21, 2020
@bjorn3
bjorn3 deleted the abi_refactor branch November 21, 2020 22:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-codegenArea: Code generationC-cleanupCategory: PRs that clean code up or issues documenting cleanup.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@bjorn3@rust-highfive@lcnr@bors@nagisa@rustbot