Because it's only ever set to `None` or `Some(Reg::i32())`.
for arg in self.args.iter() {
// add padding
- if let Some(ty) = arg.pad {
- argument_tys.push(ty.gcc_type(cx));
+ if arg.pad_i32 {
+ argument_tys.push(Reg::i32().gcc_type(cx));
}
let arg_ty = match arg.mode {
for arg in args {
// add padding
- if let Some(ty) = arg.pad {
- llargument_tys.push(ty.llvm_type(cx));
+ if arg.pad_i32 {
+ llargument_tys.push(Reg::i32().llvm_type(cx));
}
let llarg_ty = match &arg.mode {
_ => {}
}
for arg in self.args.iter() {
- if arg.pad.is_some() {
+ if arg.pad_i32 {
apply(&ArgAttributes::new());
}
match &arg.mode {
}
}
for arg in self.args.iter() {
- if arg.pad.is_some() {
+ if arg.pad_i32 {
apply(bx.cx, &ArgAttributes::new());
}
match &arg.mode {
use rustc_span::source_map::Span;
use rustc_span::{sym, Symbol};
use rustc_symbol_mangling::typeid::typeid_for_fnabi;
-use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode};
+use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode, Reg};
use rustc_target::abi::{self, HasDataLayout, WrappingRange};
use rustc_target::spec::abi::Abi;
arg: &ArgAbi<'tcx, Ty<'tcx>>,
) {
// Fill padding with undef value, where applicable.
- if let Some(ty) = arg.pad {
- llargs.push(bx.const_undef(bx.reg_backend_type(&ty)))
+ if arg.pad_i32 {
+ llargs.push(bx.const_undef(bx.reg_backend_type(&Reg::i32())))
}
if arg.is_ignore() {
for i in 0..tupled_arg_tys.len() {
let arg = &fx.fn_abi.args[idx];
idx += 1;
- if arg.pad.is_some() {
+ if arg.pad_i32 {
llarg_idx += 1;
}
let pr_field = place.project_field(bx, i);
let arg = &fx.fn_abi.args[idx];
idx += 1;
- if arg.pad.is_some() {
+ if arg.pad_i32 {
llarg_idx += 1;
}
}
};
// Padding must be fully equal.
- let pad_compat = || caller_abi.pad == callee_abi.pad;
+ let pad_compat = || caller_abi.pad_i32 == callee_abi.pad_i32;
// When comparing the PassMode, we have to be smart about comparing the attributes.
let arg_attr_compat = |a1: &ArgAttributes, a2: &ArgAttributes| {
// There's only one regular attribute that matters for the call ABI: InReg.
if arg.layout.is_aggregate() {
arg.cast_to(Uniform { unit: Reg::i32(), total: size });
if !offset.is_aligned(align) {
- arg.pad_with(Reg::i32());
+ arg.pad_with_i32();
}
} else {
arg.extend_integer_width_to(32);
pub layout: TyAndLayout<'a, Ty>,
/// Dummy argument, which is emitted before the real argument.
- pub pad: Option<Reg>,
+ pub pad_i32: bool,
pub mode: PassMode,
}
Abi::Vector { .. } => PassMode::Direct(ArgAttributes::new()),
Abi::Aggregate { .. } => PassMode::Direct(ArgAttributes::new()),
};
- ArgAbi { layout, pad: None, mode }
+ ArgAbi { layout, pad_i32: false, mode }
}
fn indirect_pass_mode(layout: &TyAndLayout<'a, Ty>) -> PassMode {
self.mode = PassMode::Cast(Box::new(target.into()));
}
- pub fn pad_with(&mut self, reg: Reg) {
- self.pad = Some(reg);
+ pub fn pad_with_i32(&mut self) {
+ self.pad_i32 = true;
}
pub fn is_indirect(&self) -> bool {
use super::*;
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>, 96);
+ static_assert_size!(ArgAbi<'_, usize>, 64);
+ static_assert_size!(FnAbi<'_, usize>, 88);
}
if arg.layout.is_aggregate() {
arg.cast_to(Uniform { unit: Reg::i32(), total: size });
if !offset.is_aligned(align) {
- arg.pad_with(Reg::i32());
+ arg.pad_with_i32();
}
} else {
arg.extend_integer_width_to(32);