File tree 3 files changed +21
-0
lines changed
compiler/rustc_target/src/abi/call
3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 7
7
use crate :: abi:: call:: { ArgAbi , FnAbi , Reg , Uniform } ;
8
8
9
9
fn classify_ret < Ty > ( arg : & mut ArgAbi < ' _ , Ty > ) {
10
+ if !arg. layout . is_sized ( ) {
11
+ // Not touching this...
12
+ return ;
13
+ }
10
14
// For return type, aggregate which <= 2*XLen will be returned in registers.
11
15
// Otherwise, aggregate will be returned indirectly.
12
16
if arg. layout . is_aggregate ( ) {
@@ -24,6 +28,10 @@ fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
24
28
}
25
29
26
30
fn classify_arg < Ty > ( arg : & mut ArgAbi < ' _ , Ty > ) {
31
+ if !arg. layout . is_sized ( ) {
32
+ // Not touching this...
33
+ return ;
34
+ }
27
35
// For argument type, the first 4*XLen parts of aggregate will be passed
28
36
// in registers, and the rest will be passed in stack.
29
37
// 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>) {
9
9
}
10
10
11
11
fn classify_arg < Ty > ( arg : & mut ArgAbi < ' _ , Ty > ) {
12
+ if !arg. layout . is_sized ( ) {
13
+ // Not touching this...
14
+ return ;
15
+ }
12
16
if arg. layout . is_aggregate ( ) {
13
17
arg. make_indirect_byval ( None ) ;
14
18
} else {
Original file line number Diff line number Diff line change 46
46
// revisions: wasi
47
47
//[wasi] compile-flags: --target wasm32-wasi
48
48
//[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
49
58
// FIXME: disabled on nvptx64 since the target ABI fails the sanity check
50
59
// see https://github.com/rust-lang/rust/issues/117480
51
60
/* revisions: nvptx64
You can’t perform that action at this time.
0 commit comments