This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
compiler/rustc_target/src/abi/call Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 77use crate :: abi:: call:: { ArgAbi , FnAbi , Reg , Uniform } ;
88
99fn classify_ret < Ty > ( arg : & mut ArgAbi < ' _ , Ty > ) {
10+ if !arg. layout . is_sized ( ) {
11+ // Not touching this...
12+ return ;
13+ }
1014 // For return type, aggregate which <= 2*XLen will be returned in registers.
1115 // Otherwise, aggregate will be returned indirectly.
1216 if arg. layout . is_aggregate ( ) {
@@ -24,6 +28,10 @@ fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
2428}
2529
2630fn classify_arg < Ty > ( arg : & mut ArgAbi < ' _ , Ty > ) {
31+ if !arg. layout . is_sized ( ) {
32+ // Not touching this...
33+ return ;
34+ }
2735 // For argument type, the first 4*XLen parts of aggregate will be passed
2836 // in registers, and the rest will be passed in stack.
2937 // So we can coerce to integers directly and let backend handle it correctly.
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
99}
1010
1111fn classify_arg < Ty > ( arg : & mut ArgAbi < ' _ , Ty > ) {
12+ if !arg. layout . is_sized ( ) {
13+ // Not touching this...
14+ return ;
15+ }
1216 if arg. layout . is_aggregate ( ) {
1317 arg. make_indirect_byval ( None ) ;
1418 } else {
Original file line number Diff line number Diff line change 4646// revisions: wasi
4747//[wasi] compile-flags: --target wasm32-wasi
4848//[wasi] needs-llvm-components: webassembly
49+ // revisions: csky
50+ //[csky] compile-flags: --target csky-unknown-linux-gnuabiv2
51+ //[csky] needs-llvm-components: csky
52+ // revisions: bpf
53+ //[bpf] compile-flags: --target bpfeb-unknown-none
54+ //[bpf] needs-llvm-components: bpf
55+ // revisions: m68k
56+ //[m68k] compile-flags: --target m68k-unknown-linux-gnu
57+ //[m68k] needs-llvm-components: m68k
4958// FIXME: disabled on nvptx64 since the target ABI fails the sanity check
5059// see https://github.com/rust-lang/rust/issues/117480
5160/* revisions: nvptx64
You can’t perform that action at this time.
0 commit comments