Struct melior_next::ir::type::Type
source · pub struct Type<'c> { /* private fields */ }
Expand description
A type.
Implementations§
source§impl<'c> Type<'c>
impl<'c> Type<'c>
sourcepub fn parse(context: &'c Context, source: &str) -> Option<Self>
pub fn parse(context: &'c Context, source: &str) -> Option<Self>
Parses a type.
Be mindful of spaces.
E.g !llvm.array<4 x i32>
is valid. But !llvm.array<4xi32>
is not.
sourcepub fn signed_integer(context: &'c Context, bits: u32) -> Self
pub fn signed_integer(context: &'c Context, bits: u32) -> Self
Creates a signed integer type.
sourcepub fn unsigned_integer(context: &'c Context, bits: u32) -> Self
pub fn unsigned_integer(context: &'c Context, bits: u32) -> Self
Creates an unsigned integer type.
sourcepub fn vector_checked(
location: Location<'c>,
dimensions: &[u64],
type: Self
) -> Option<Self>
pub fn vector_checked( location: Location<'c>, dimensions: &[u64], type: Self ) -> Option<Self>
Creates a vector type with diagnostics.
Trait Implementations§
source§impl<'c> PartialEq<Type<'c>> for Type<'c>
impl<'c> PartialEq<Type<'c>> for Type<'c>
source§impl<'c> TypeLike<'c> for Type<'c>
impl<'c> TypeLike<'c> for Type<'c>
source§fn context(&self) -> ContextRef<'c>
fn context(&self) -> ContextRef<'c>
Gets a context.
source§fn is_integer(&self) -> bool
fn is_integer(&self) -> bool
Returns
true
if a type is integer.source§fn is_bfloat16(&self) -> bool
fn is_bfloat16(&self) -> bool
Returns
true
if a type is bfloat16.source§fn is_float16(&self) -> bool
fn is_float16(&self) -> bool
Returns
true
if a type is float16.source§fn is_float32(&self) -> bool
fn is_float32(&self) -> bool
Returns
true
if a type is float32.source§fn is_float64(&self) -> bool
fn is_float64(&self) -> bool
Returns
true
if a type is float64.source§fn is_function(&self) -> bool
fn is_function(&self) -> bool
Returns
true
if a type is a function.source§fn is_mem_ref(&self) -> bool
fn is_mem_ref(&self) -> bool
Returns
true
if a type is a memory reference.