]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_target/src/abi/call/amdgpu.rs
Change `FnAbi::args` to a boxed slice.
[rust.git] / compiler / rustc_target / src / abi / call / amdgpu.rs
1 use crate::abi::call::{ArgAbi, FnAbi};
2 use crate::abi::{HasDataLayout, TyAbiInterface};
3
4 fn classify_ret<'a, Ty, C>(_cx: &C, ret: &mut ArgAbi<'a, Ty>)
5 where
6     Ty: TyAbiInterface<'a, C> + Copy,
7     C: HasDataLayout,
8 {
9     ret.extend_integer_width_to(32);
10 }
11
12 fn classify_arg<'a, Ty, C>(_cx: &C, arg: &mut ArgAbi<'a, Ty>)
13 where
14     Ty: TyAbiInterface<'a, C> + Copy,
15     C: HasDataLayout,
16 {
17     arg.extend_integer_width_to(32);
18 }
19
20 pub fn compute_abi_info<'a, Ty, C>(cx: &C, fn_abi: &mut FnAbi<'a, Ty>)
21 where
22     Ty: TyAbiInterface<'a, C> + Copy,
23     C: HasDataLayout,
24 {
25     if !fn_abi.ret.is_ignore() {
26         classify_ret(cx, &mut fn_abi.ret);
27     }
28
29     for arg in fn_abi.args.iter_mut() {
30         if arg.is_ignore() {
31             continue;
32         }
33         classify_arg(cx, arg);
34     }
35 }