BasicBlock

Enum BasicBlock 

Source
pub enum BasicBlock<'blk> {
Show 16 variants Undefined, Root(&'blk BlockRoot<'blk>), Module(&'blk BlockModule<'blk>), Func(&'blk BlockFunc<'blk>), Call(&'blk BlockCall<'blk>), Enum(&'blk BlockEnum<'blk>), Class(&'blk BlockClass<'blk>), Trait(&'blk BlockTrait<'blk>), Interface(&'blk BlockInterface<'blk>), Impl(&'blk BlockImpl<'blk>), Const(&'blk BlockConst<'blk>), Field(&'blk BlockField<'blk>), Parameter(&'blk BlockParameter<'blk>), Return(&'blk BlockReturn<'blk>), Alias(&'blk BlockAlias<'blk>), Block,
}

Variants§

§

Undefined

§

Root(&'blk BlockRoot<'blk>)

§

Module(&'blk BlockModule<'blk>)

§

Func(&'blk BlockFunc<'blk>)

§

Call(&'blk BlockCall<'blk>)

§

Enum(&'blk BlockEnum<'blk>)

§

Class(&'blk BlockClass<'blk>)

§

Trait(&'blk BlockTrait<'blk>)

§

Interface(&'blk BlockInterface<'blk>)

§

Impl(&'blk BlockImpl<'blk>)

§

Const(&'blk BlockConst<'blk>)

§

Field(&'blk BlockField<'blk>)

§

Parameter(&'blk BlockParameter<'blk>)

§

Return(&'blk BlockReturn<'blk>)

§

Alias(&'blk BlockAlias<'blk>)

§

Block

Implementations§

Source§

impl<'blk> BasicBlock<'blk>

Source

pub fn format_block(&self, unit: CompileUnit<'blk>) -> String

Format the block label (content inside the parentheses) Delegates to each block type’s format method

Source

pub fn format_deps(&self, unit: CompileUnit<'blk>) -> Vec<String>

Format extra entries for dependencies (rendered as pseudo-children) Only applicable to Func and Class blocks, returns empty for others

Source

pub fn format_suffix(&self) -> Option<String>

Format the suffix to appear after the closing parenthesis (Currently unused - type info is now inline in format_block)

Source

pub fn id(&self) -> BlockId

Source

pub fn base(&self) -> Option<&BlockBase<'blk>>

Get the base block information regardless of variant

Source

pub fn block_id(&self) -> BlockId

Get the block ID

Source

pub fn kind(&self) -> BlockKind

Get the block kind

Source

pub fn node(&self) -> &HirNode<'blk>

Get the HIR node

Source

pub fn opt_node(&self) -> Option<&HirNode<'blk>>

Source

pub fn symbol(&self) -> Option<&'blk Symbol>

Get the symbol that defines this block (if any)

Source

pub fn children(&self) -> Vec<BlockId>

Get the children block IDs

Source

pub fn child_count(&self) -> usize

Source

pub fn is_kind(&self, kind: BlockKind) -> bool

Check if this is a specific kind of block

Source

pub fn as_root(&self) -> Option<&'blk BlockRoot<'blk>>

Get the inner BlockRoot if this is a Root block

Source

pub fn as_module(&self) -> Option<&'blk BlockModule<'blk>>

Get the inner BlockModule if this is a Module block

Source

pub fn as_func(&self) -> Option<&'blk BlockFunc<'blk>>

Get the inner BlockFunc if this is a Func or Method block

Source

pub fn as_class(&self) -> Option<&'blk BlockClass<'blk>>

Get the inner BlockClass if this is a Class block

Source

pub fn as_trait(&self) -> Option<&'blk BlockTrait<'blk>>

Get the inner BlockTrait if this is a Trait block

Source

pub fn as_interface(&self) -> Option<&'blk BlockInterface<'blk>>

Get the inner BlockInterface if this is an Interface block

Source

pub fn as_impl(&self) -> Option<&'blk BlockImpl<'blk>>

Get the inner BlockImpl if this is an Impl block

Source

pub fn as_enum(&self) -> Option<&'blk BlockEnum<'blk>>

Get the inner BlockEnum if this is an Enum block

Source

pub fn as_field(&self) -> Option<&'blk BlockField<'blk>>

Get the inner BlockField if this is a Field block

Source

pub fn as_call(&self) -> Option<&'blk BlockCall<'blk>>

Get the inner BlockCall if this is a Call block

Trait Implementations§

Source§

impl<'a> ArenaInsert<'a> for BasicBlock<'a>

Source§

fn insert_into(self, arena: &'a ArenaInner) -> &'a Self

Source§

impl<'a> ArenaInsertWithId<'a> for BasicBlock<'a>

Source§

fn insert_with_id(self, arena: &'a ArenaInner, id: usize) -> &'a Self

Source§

impl<'blk> Clone for BasicBlock<'blk>

Source§

fn clone(&self) -> BasicBlock<'blk>

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
Source§

impl<'blk> Debug for BasicBlock<'blk>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'blk> Freeze for BasicBlock<'blk>

§

impl<'blk> !RefUnwindSafe for BasicBlock<'blk>

§

impl<'blk> Send for BasicBlock<'blk>

§

impl<'blk> Sync for BasicBlock<'blk>

§

impl<'blk> Unpin for BasicBlock<'blk>

§

impl<'blk> !UnwindSafe for BasicBlock<'blk>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more