]>
Commit | Line | Data |
---|---|---|
60c5eb7d | 1 | use crate::abi::call::{ArgAbi, FnAbi}; |
85aaf69f | 2 | |
60c5eb7d XL |
3 | fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) { |
4 | if ret.layout.is_aggregate() { | |
ff7c6d11 | 5 | ret.make_indirect(); |
60c5eb7d XL |
6 | } else { |
7 | ret.extend_integer_width_to(32); | |
85aaf69f SL |
8 | } |
9 | } | |
10 | ||
60c5eb7d | 11 | fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) { |
cc61c64b | 12 | if arg.layout.is_aggregate() { |
60c5eb7d | 13 | arg.make_indirect(); |
85aaf69f | 14 | } else { |
54a0048b | 15 | arg.extend_integer_width_to(32); |
85aaf69f | 16 | } |
85aaf69f SL |
17 | } |
18 | ||
60c5eb7d XL |
19 | pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) { |
20 | if !fn_abi.ret.is_ignore() { | |
21 | classify_ret(&mut fn_abi.ret); | |
54a0048b | 22 | } |
85aaf69f | 23 | |
60c5eb7d | 24 | for arg in &mut fn_abi.args { |
dfeec247 XL |
25 | if arg.is_ignore() { |
26 | continue; | |
27 | } | |
60c5eb7d | 28 | classify_arg(arg); |
54a0048b | 29 | } |
85aaf69f | 30 | } |