rustc_target/callconv/
m68k.rs

1use crate::callconv::{ArgAbi, FnAbi};
2
3fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
4    if ret.layout.is_aggregate() {
5        ret.make_indirect();
6    } else {
7        ret.extend_integer_width_to(32);
8    }
9}
10
11fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
12    if !arg.layout.is_sized() {
13        // Not touching this...
14        return;
15    }
16    if arg.layout.is_aggregate() {
17        arg.pass_by_stack_offset(None);
18    } else {
19        arg.extend_integer_width_to(32);
20    }
21}
22
23pub(crate) fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
24    if !fn_abi.ret.is_ignore() {
25        classify_ret(&mut fn_abi.ret);
26    }
27
28    for arg in fn_abi.args.iter_mut() {
29        if arg.is_ignore() {
30            continue;
31        }
32        classify_arg(arg);
33    }
34}