1
Fork 0

Turn ArgAbi::pad into a bool.

Because it's only ever set to `None` or `Some(Reg::i32())`.
This commit is contained in:
Nicholas Nethercote 2022-08-25 19:18:01 +10:00
parent feeaa4db3c
commit b853e8a619
8 changed files with 20 additions and 20 deletions

View file

@ -21,7 +21,7 @@ use rustc_middle::ty::{self, Instance, Ty, TypeVisitable};
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;
@ -1159,8 +1159,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
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() {

View file

@ -283,7 +283,7 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
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);
@ -309,7 +309,7 @@ fn arg_local_refs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
let arg = &fx.fn_abi.args[idx];
idx += 1;
if arg.pad.is_some() {
if arg.pad_i32 {
llarg_idx += 1;
}