1
Fork 0

Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData.

Also update comments that refered to BackendRepr::Uninhabited.
This commit is contained in:
Zachary S 2025-01-25 20:15:24 -06:00
parent 28b83ee596
commit 7ba3d7b54e
26 changed files with 93 additions and 113 deletions

View file

@ -80,7 +80,7 @@ where
}
}
},
BackendRepr::Vector { .. } | BackendRepr::Uninhabited => return Err(CannotUseFpConv),
BackendRepr::Vector { .. } => return Err(CannotUseFpConv),
BackendRepr::ScalarPair(..) | BackendRepr::Memory { .. } => match arg_layout.fields {
FieldsShape::Primitive => {
unreachable!("aggregates can't have `FieldsShape::Primitive`")

View file

@ -38,7 +38,7 @@ mod xtensa;
pub enum PassMode {
/// Ignore the argument.
///
/// The argument is either uninhabited or a ZST.
/// The argument is a ZST.
Ignore,
/// Pass the argument directly.
///
@ -350,7 +350,6 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
scalar_attrs: impl Fn(&TyAndLayout<'a, Ty>, Scalar, Size) -> ArgAttributes,
) -> Self {
let mode = match layout.backend_repr {
BackendRepr::Uninhabited => PassMode::Ignore,
BackendRepr::Scalar(scalar) => {
PassMode::Direct(scalar_attrs(&layout, scalar, Size::ZERO))
}

View file

@ -86,7 +86,7 @@ where
}
}
},
BackendRepr::Vector { .. } | BackendRepr::Uninhabited => return Err(CannotUseFpConv),
BackendRepr::Vector { .. } => return Err(CannotUseFpConv),
BackendRepr::ScalarPair(..) | BackendRepr::Memory { .. } => match arg_layout.fields {
FieldsShape::Primitive => {
unreachable!("aggregates can't have `FieldsShape::Primitive`")

View file

@ -108,9 +108,7 @@ where
Ty: TyAbiInterface<'a, C> + Copy,
{
match layout.backend_repr {
BackendRepr::Uninhabited
| BackendRepr::Scalar(_)
| BackendRepr::ScalarPair(..) => false,
BackendRepr::Scalar(_) | BackendRepr::ScalarPair(..) => false,
BackendRepr::Vector { .. } => true,
BackendRepr::Memory { .. } => {
for i in 0..layout.fields.count() {

View file

@ -51,8 +51,6 @@ where
}
let mut c = match layout.backend_repr {
BackendRepr::Uninhabited => return Ok(()),
BackendRepr::Scalar(scalar) => match scalar.primitive() {
Primitive::Int(..) | Primitive::Pointer(_) => Class::Int,
Primitive::Float(_) => Class::Sse,

View file

@ -8,7 +8,7 @@ use crate::spec::{HasTargetSpec, RustcAbi};
pub(crate) fn compute_abi_info<Ty>(cx: &impl HasTargetSpec, fn_abi: &mut FnAbi<'_, Ty>) {
let fixup = |a: &mut ArgAbi<'_, Ty>, is_ret: bool| {
match a.layout.backend_repr {
BackendRepr::Uninhabited | BackendRepr::Memory { sized: false } => {}
BackendRepr::Memory { sized: false } => {}
BackendRepr::ScalarPair(..) | BackendRepr::Memory { sized: true } => {
match a.layout.size.bits() {
8 => a.cast_to(Reg::i8()),