pub enum BackendRepr {
Uninhabited,
Scalar(Scalar),
ScalarPair(Scalar, Scalar),
Vector {
element: Scalar,
count: u64,
},
Memory {
sized: bool,
},
}
Expand description
The way we represent values to the backend
Previously this was conflated with the “ABI” a type is given, as in the platform-specific ABI. In reality, this implies little about that, but is mostly used to describe the syntactic form emitted for the backend, as most backends handle SSA values and blobs of memory differently. The psABI may need consideration in doing so, but this enum does not constitute a promise for how the value will be lowered to the calling convention, in itself.
Generally, a codegen backend will prefer to handle smaller values as a scalar or short vector, and larger values will usually prefer to be represented as memory.
Variants§
Implementations§
Source§impl BackendRepr
impl BackendRepr
Sourcepub fn is_unsized(&self) -> bool
pub fn is_unsized(&self) -> bool
Returns true
if the layout corresponds to an unsized type.
pub fn is_sized(&self) -> bool
Sourcepub fn is_uninhabited(&self) -> bool
pub fn is_uninhabited(&self) -> bool
Returns true
if this is an uninhabited type
Sourcepub fn inherent_align<C: HasDataLayout>(
&self,
cx: &C,
) -> Option<AbiAndPrefAlign>
pub fn inherent_align<C: HasDataLayout>( &self, cx: &C, ) -> Option<AbiAndPrefAlign>
Returns the fixed alignment of this ABI, if any is mandated.
Sourcepub fn inherent_size<C: HasDataLayout>(&self, cx: &C) -> Option<Size>
pub fn inherent_size<C: HasDataLayout>(&self, cx: &C) -> Option<Size>
Returns the fixed size of this ABI, if any is mandated.
pub fn eq_up_to_validity(&self, other: &Self) -> bool
Trait Implementations§
Source§impl Clone for BackendRepr
impl Clone for BackendRepr
Source§fn clone(&self) -> BackendRepr
fn clone(&self) -> BackendRepr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more