1
Fork 0

NVPTX: Avoid PassMode::Direct for args in C abi

This commit is contained in:
Kjetil Kjeka 2024-05-10 18:39:05 +02:00
parent e93f342101
commit ead02ba0f1
3 changed files with 440 additions and 5 deletions

View file

@ -11,11 +11,10 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
}
fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
if arg.layout.is_aggregate() && arg.layout.size.bits() > 64 {
arg.make_indirect();
} else {
// FIXME: this is wrong! Need to decide which ABI we really want here.
arg.make_direct_deprecated();
if arg.layout.is_aggregate() {
arg.make_indirect_byval(None);
} else if arg.layout.size.bits() < 32 {
arg.extend_integer_width_to(32);
}
}