Enum BtType

pub enum BtType {
Show 14 variants Void, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Float32, Float64, Array { element_type: Box<BtType>, count: usize, }, Pointer, Function,
}
Expand description

A data type in the BlueTac IR.

Variants§

§

Void

§

Int8

§

Int16

§

Int32

§

Int64

§

UInt8

§

UInt16

§

UInt32

§

UInt64

§

Float32

§

Float64

§

Array

Fields

§element_type: Box<BtType>
§count: usize
§

Pointer

§

Function

Implementations§

§

impl BtType

pub fn get_const_default_value(&self) -> BtConstantValue

Creates a BtConstantValue for the current BtType with a default zero value.

pub fn bits(&self) -> usize

The size of the type in bits.

pub fn is_arithmetic(&self) -> bool

Is this type an arithmetic type (integer or floating-point)?

pub fn is_integer(&self) -> bool

Is this type an integer (signed or unsigned) type?

pub fn is_floating_point(&self) -> bool

Is this type a floating-point type?

pub fn is_signed_integer(&self) -> bool

Is this type a signed integer?

pub fn is_unsigned_integer(&self) -> bool

Is this type an unsigned integer?

pub fn is_character(&self) -> bool

Is this type a character (8-bit integer) type?

pub fn is_pointer(&self) -> bool

Is this type a pointer type?

pub fn is_array(&self) -> bool

Is this type an array type?

pub fn is_character_array(&self) -> bool

Is this type a character array type?

pub fn is_function(&self) -> bool

Is this type a function type?

pub fn get_innermost_scalar_type(&self) -> &BtType

Gets the type’s inner-most scalar type.

For an aggregate type, recurses into the type until a scalar type is found.

BtType::Array { BtType::Array { BtType::Int8 } } —> BtType::Int8

pub fn to_printer(&self) -> String

Converts the BtType to a string suitable for the IR printer.

Trait Implementations§

§

impl Clone for BtType

§

fn clone(&self) -> BtType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for BtType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Display for BtType

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl From<&AstType> for BtType

§

fn from(ast_type: &AstType) -> Self

Converts to this type from the input type.
§

impl From<AstType> for BtType

§

fn from(ast_type: AstType) -> Self

Converts to this type from the input type.
§

impl PartialEq for BtType

§

fn eq(&self, other: &BtType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Eq for BtType

§

impl StructuralPartialEq for BtType

Auto Trait Implementations§

§

impl Freeze for BtType

§

impl RefUnwindSafe for BtType

§

impl Send for BtType

§

impl Sync for BtType

§

impl Unpin for BtType

§

impl UnwindSafe for BtType

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.