]> git.proxmox.com Git - rustc.git/blame - src/librustc_target/abi/call/powerpc.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc_target / abi / call / powerpc.rs
CommitLineData
60c5eb7d 1use crate::abi::call::{ArgAbi, FnAbi};
85aaf69f 2
60c5eb7d
XL
3fn 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 11fn 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
19pub 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 {
54a0048b 25 if arg.is_ignore() { continue; }
60c5eb7d 26 classify_arg(arg);
54a0048b 27 }
85aaf69f 28}