Change FnAbi::args to a boxed slice.

This commit is contained in:
Nicholas Nethercote 2022-08-25 19:08:04 +10:00
parent 4df7bffa95
commit b75b3b3afe
24 changed files with 29 additions and 29 deletions

View File

@ -140,7 +140,7 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
}
};
for arg in &self.args {
for arg in self.args.iter() {
// add padding
if let Some(ty) = arg.pad {
argument_tys.push(ty.gcc_type(cx));

View File

@ -442,7 +442,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
}
_ => {}
}
for arg in &self.args {
for arg in self.args.iter() {
if arg.pad.is_some() {
apply(&ArgAttributes::new());
}
@ -518,7 +518,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
}
}
}
for arg in &self.args {
for arg in self.args.iter() {
if arg.pad.is_some() {
apply(bx.cx, &ArgAttributes::new());
}

View File

@ -3334,7 +3334,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
}
};
fixup(&mut fn_abi.ret);
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
fixup(arg);
}
} else {

View File

@ -77,7 +77,7 @@ where
classify_ret(cx, &mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -26,7 +26,7 @@ where
classify_ret(cx, &mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -88,7 +88,7 @@ where
classify_ret(cx, &mut fn_abi.ret, vfp);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -49,7 +49,7 @@ pub fn compute_abi_info<Ty>(fty: &mut FnAbi<'_, Ty>) {
classify_ret_ty(&mut fty.ret);
}
for arg in &mut fty.args {
for arg in fty.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -22,7 +22,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -21,7 +21,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -21,7 +21,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -42,7 +42,7 @@ where
classify_ret(cx, &mut fn_abi.ret, &mut offset);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -158,7 +158,7 @@ where
classify_ret(cx, &mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -614,7 +614,7 @@ pub enum Conv {
#[derive(PartialEq, Eq, Hash, Debug, HashStable_Generic)]
pub struct FnAbi<'a, Ty> {
/// The LLVM types of each argument.
pub args: Vec<ArgAbi<'a, Ty>>,
pub args: Box<[ArgAbi<'a, Ty>]>,
/// LLVM return type.
pub ret: ArgAbi<'a, Ty>,
@ -738,5 +738,5 @@ mod size_asserts {
use rustc_data_structures::static_assert_size;
// These are in alphabetical order, which is easy to maintain.
static_assert_size!(ArgAbi<'_, usize>, 72);
static_assert_size!(FnAbi<'_, usize>, 104);
static_assert_size!(FnAbi<'_, usize>, 96);
}

View File

@ -30,7 +30,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -38,7 +38,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}
@ -55,7 +55,7 @@ where
panic!("Kernels should not return anything other than () or !");
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -21,7 +21,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -132,7 +132,7 @@ where
classify_ret(cx, &mut fn_abi.ret, abi);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -48,7 +48,7 @@ where
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -42,7 +42,7 @@ where
classify_ret(cx, &mut fn_abi.ret, &mut offset);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -217,7 +217,7 @@ where
classify_arg(cx, &mut fn_abi.ret, Size { raw: 32 });
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -50,7 +50,7 @@ where
classify_ret(cx, &mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}
@ -66,7 +66,7 @@ pub fn compute_wasm_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
classify_ret(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -49,7 +49,7 @@ where
}
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}
@ -72,7 +72,7 @@ where
let mut free_regs = 2;
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
let attrs = match arg.mode {
PassMode::Ignore
| PassMode::Indirect { attrs: _, extra_attrs: None, on_stack: _ } => {

View File

@ -239,7 +239,7 @@ where
x86_64_arg_or_ret(&mut fn_abi.ret, false);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}

View File

@ -31,7 +31,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
if !fn_abi.ret.is_ignore() {
fixup(&mut fn_abi.ret);
}
for arg in &mut fn_abi.args {
for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}