Repository navigation
Introduce compute_abi helper and ComputeCallConv trait - #165920
Conversation
|
Some changes occurred in compiler/rustc_target/src/callconv/amdgpu.rs cc @Flakebi |
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
|
||
| #[rustc_abi(debug)] | ||
| extern "C" fn pass_zst(_: ()) {} //~ ERROR: fn_abi | ||
| extern "C" fn pass_zst(_: Czst) {} //~ ERROR: fn_abi |
There was a problem hiding this comment.
This was testing a Rust ZST, not a C ZST. I've added a new test for Rust ZSTs.
|
Aside from the SPARC bugfix no behavior changes are intended. |
This comment has been minimized.
This comment has been minimized.
3c50d78 to
2848ca9
Compare
|
|
This comment has been minimized.
This comment has been minimized.
2848ca9 to
55e1ad2
Compare
This comment has been minimized.
This comment has been minimized.
55e1ad2 to
f68eaaf
Compare
This comment has been minimized.
This comment has been minimized.
|
also I was thinking that we can probably land most of the test changes as an NFC PR? |
|
idk if you've already reviewed the whole thing that may not be needed at this point, but at least to me it would make reviewing easier, the diff is (by necessity) a total mess. |
|
I agree it would be good to land the test changes first separately (probably with the fix for SPARC to make this PR a NFC) so that it's easy to see from CI that this refactor doesn't affect the output. |
This comment has been minimized.
This comment has been minimized.
f68eaaf to
38ec2fe
Compare
This comment has been minimized.
This comment has been minimized.
|
Split the testing changes and SPARC fix into #166098 |
38ec2fe to
60050ba
Compare
Actually test ABI for C ZSTs and fix Rust ZST ABI for SPARC Split out of rust-lang#165920 r? @beetrees
af27c68 to
fe548f4
Compare
|
Thanks! |
|
@bors r- Could you squash the review changes first? Then |
|
This pull request was unapproved. |
This deduplicates code between most callconv computation implementations. 32bit x86 has some postprocessing going on that makes it non-trivial to use this abstraction, but for all other archs it works fine.
And make sure Rust ZSTs are always ignored. Previously they incorrectly got passed by-ref on SPARC.
ExternAbi distinguishes between ABIs that should have identical callconvs.
fe548f4 to
c4c1ae8
Compare
|
Squashed review changes and checked that the diff is unchanged. @bors r=beetrees |
Introduce compute_abi helper and ComputeCallConv trait This deduplicates code between most callconv computation implementations. 32bit x86 has some postprocessing going on that makes it non-trivial to use this abstraction, but for all other archs it works fine. After that deduplicate ZST arg/ret handling and make sure Rust ZSTs are always ignored. Previously they incorrectly got passed by-ref on SPARC. This will help a bit with rust-lang#119183 by marking it easier to ensure code like the `repr(transparent)` handling is done consistently across all targets.
…uwer Rollup of 12 pull requests Successful merges: - #166340 (Revert "implement const Iterator for Range - #156216") - #165345 (Remove the 'eq', 'eq_trace', and 'goals_to_obligations' methods from 'At') - #165538 (Supertraits returns Unnormalized) - #165794 (`consider_impl_candidate` tweaks) - #160752 (Avoid inference constraints from opaque blanket impls) - #163187 (add `scalbn` and `ilogb` methods on floats) - #164541 (Add regression test for #152415) - #164543 (Add regression test for #151316) - #165920 (Introduce compute_abi helper and ComputeCallConv trait) - #166313 (Move `rustdoc-ui` tests in the right folder) - #166420 ([rustdoc] Fix search index generation: if crate content didn't change, it should generate the same search index) - #166485 (Allow passing `--exact-match` and `--purge` to `x perf`)
Rollup merge of #165920 - bjorn3:callconv_refactor, r=beetrees Introduce compute_abi helper and ComputeCallConv trait This deduplicates code between most callconv computation implementations. 32bit x86 has some postprocessing going on that makes it non-trivial to use this abstraction, but for all other archs it works fine. After that deduplicate ZST arg/ret handling and make sure Rust ZSTs are always ignored. Previously they incorrectly got passed by-ref on SPARC. This will help a bit with #119183 by marking it easier to ensure code like the `repr(transparent)` handling is done consistently across all targets.
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#166340 (Revert "implement const Iterator for Range - rust-lang/rust#156216") - rust-lang/rust#165345 (Remove the 'eq', 'eq_trace', and 'goals_to_obligations' methods from 'At') - rust-lang/rust#165538 (Supertraits returns Unnormalized) - rust-lang/rust#165794 (`consider_impl_candidate` tweaks) - rust-lang/rust#160752 (Avoid inference constraints from opaque blanket impls) - rust-lang/rust#163187 (add `scalbn` and `ilogb` methods on floats) - rust-lang/rust#164541 (Add regression test for rust-lang/rust#152415) - rust-lang/rust#164543 (Add regression test for rust-lang/rust#151316) - rust-lang/rust#165920 (Introduce compute_abi helper and ComputeCallConv trait) - rust-lang/rust#166313 (Move `rustdoc-ui` tests in the right folder) - rust-lang/rust#166420 ([rustdoc] Fix search index generation: if crate content didn't change, it should generate the same search index) - rust-lang/rust#166485 (Allow passing `--exact-match` and `--purge` to `x perf`)
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#166340 (Revert "implement const Iterator for Range - rust-lang/rust#156216") - rust-lang/rust#165345 (Remove the 'eq', 'eq_trace', and 'goals_to_obligations' methods from 'At') - rust-lang/rust#165538 (Supertraits returns Unnormalized) - rust-lang/rust#165794 (`consider_impl_candidate` tweaks) - rust-lang/rust#160752 (Avoid inference constraints from opaque blanket impls) - rust-lang/rust#163187 (add `scalbn` and `ilogb` methods on floats) - rust-lang/rust#164541 (Add regression test for rust-lang/rust#152415) - rust-lang/rust#164543 (Add regression test for rust-lang/rust#151316) - rust-lang/rust#165920 (Introduce compute_abi helper and ComputeCallConv trait) - rust-lang/rust#166313 (Move `rustdoc-ui` tests in the right folder) - rust-lang/rust#166420 ([rustdoc] Fix search index generation: if crate content didn't change, it should generate the same search index) - rust-lang/rust#166485 (Allow passing `--exact-match` and `--purge` to `x perf`)
View all comments
This deduplicates code between most callconv computation implementations. 32bit x86 has some postprocessing going on that makes it non-trivial to use this abstraction, but for all other archs it works fine.
After that deduplicate ZST arg/ret handling and make sure Rust ZSTs are always ignored. Previously they incorrectly
got passed by-ref on SPARC.
This will help a bit with #119183 by marking it easier to ensure code like the
repr(transparent)handling is done consistently across all targets.