pub enum IrType {
Void,
Scalar(ScalarType),
Vector(VectorType),
Ptr(Box<IrType>),
Array(Box<IrType>, usize),
Slice(Box<IrType>),
Struct(StructType),
Function(FunctionType),
}Expand description
IR type.
Variants§
Void
Void type (for functions with no return).
Scalar(ScalarType)
Scalar type.
Vector(VectorType)
Vector type.
Ptr(Box<IrType>)
Pointer type.
Array(Box<IrType>, usize)
Array type with static size.
Slice(Box<IrType>)
Slice type (runtime-sized array).
Struct(StructType)
Struct type with named fields.
Function(FunctionType)
Function type.
Implementations§
Source§impl IrType
impl IrType
Sourcepub fn size_bytes(&self) -> Option<usize>
pub fn size_bytes(&self) -> Option<usize>
Get size in bytes (None for unsized types).
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Check if this is a numeric type.
Sourcepub fn element_type(&self) -> Option<&IrType>
pub fn element_type(&self) -> Option<&IrType>
Get the element type for pointers, arrays, and slices.
Trait Implementations§
impl Eq for IrType
impl StructuralPartialEq for IrType
Auto Trait Implementations§
impl Freeze for IrType
impl RefUnwindSafe for IrType
impl Send for IrType
impl Sync for IrType
impl Unpin for IrType
impl UnwindSafe for IrType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more