-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
adjust_abi: make fallback logic for ABIs a bit easier to read #137370
Conversation
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
These commits modify compiler targets. |
a0c0f49
to
f7ae9e1
Compare
While I'm touching this code anyway... @workingjubilee do you have any idea why this is not done as part of |
I intend to burn out the entire idea of "adjusting ABIs" as soon as I can check enough things off my list of things to clean up that it is on the top. |
I don't really find this variant appreciably more legible. |
Hm... surprising. The old logic makes it non-trivial to tell "what is all the logic that applies to |
yes, I read things and organize them in my head in precisely the opposite way: when I see a |
But that's so many cases all mixed up without any structure? Many more degrees of freedom, many more different ways to write the same thing... and it's not even easy to visually identify the conditionals as the Not sure how to resolve this, all I can say is it I feel I have to de-spaghetti this function every single time I look at it.^^ |
🤔 It's a very simple structure, isn't it? An array. |
} else { | ||
C { unwind } | ||
} | ||
} |
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.
TBH I prefer match (abi, &self.arch) { ... }
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.
It's hard to judge the pros and cons of these writings. I gonna merge this PR if you don't make more changes.
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.
That doesn't work for System
where the logic depends on more than just the architecture.
Exactly. The |
Well, it kinda shouldn't, honestly. Even the MSVC compiler prefers to reject vectorcall more often:
Since we're requiring sse2, we should probably just reject it. |
Not sure what exactly you are replying to, but this PR is not intended to change behavior. I agree vectorcall should be rejected on non-x86 targets, but it seems odd to do this one target at a time so see #137018 for that. |
@bors r+ rollup |
Rollup of 8 pull requests Successful merges: - rust-lang#137370 (adjust_abi: make fallback logic for ABIs a bit easier to read) - rust-lang#137444 (Improve behavior of `IF_LET_RESCOPE` around temporaries and place expressions) - rust-lang#137464 (Fix invalid suggestion from type error for derive macro) - rust-lang#137539 ( Add rustdoc-gui regression test for rust-lang#137082 ) - rust-lang#137576 (Don't doc-comment BTreeMap<K, SetValZST, A>) - rust-lang#137595 (remove `simd_fpow` and `simd_fpowi`) - rust-lang#137600 (type_ir: remove redundant part of comment) - rust-lang#137602 (feature: fix typo in attribute description) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137370 - RalfJung:x86-abi-fallback, r=SparrowLii adjust_abi: make fallback logic for ABIs a bit easier to read I feel like the match guards here make this unnecessarily harder to follow.
I feel like the match guards here make this unnecessarily harder to follow.