Struct melior_next::ir::block::Block
source · pub struct Block<'c> { /* private fields */ }
Expand description
A block.
Implementations§
source§impl<'c> Block<'c>
impl<'c> Block<'c>
sourcepub fn argument(&self, position: usize) -> Result<Argument<'_>, Error>
pub fn argument(&self, position: usize) -> Result<Argument<'_>, Error>
Gets an argument at a position.
sourcepub fn argument_count(&self) -> usize
pub fn argument_count(&self) -> usize
Gets a number of arguments.
sourcepub fn first_operation(&self) -> Option<OperationRef<'_>>
pub fn first_operation(&self) -> Option<OperationRef<'_>>
Gets the first operation.
sourcepub fn terminator(&self) -> Option<OperationRef<'_>>
pub fn terminator(&self) -> Option<OperationRef<'_>>
Gets a terminator operation.
sourcepub fn parent_region(&self) -> Option<RegionRef<'_>>
pub fn parent_region(&self) -> Option<RegionRef<'_>>
Gets a parent region.
sourcepub fn parent_operation(&self) -> Option<OperationRef<'_>>
pub fn parent_operation(&self) -> Option<OperationRef<'_>>
Gets a parent operation.
sourcepub fn add_argument(&self, type: Type<'c>, location: Location<'c>) -> Value<'_>
pub fn add_argument(&self, type: Type<'c>, location: Location<'c>) -> Value<'_>
Adds an argument.
sourcepub fn append_operation(&self, operation: Operation<'_>) -> OperationRef<'_>
pub fn append_operation(&self, operation: Operation<'_>) -> OperationRef<'_>
Appends an operation.
sourcepub fn insert_operation(
&self,
position: usize,
operation: Operation<'_>
) -> OperationRef<'_>
pub fn insert_operation( &self, position: usize, operation: Operation<'_> ) -> OperationRef<'_>
Inserts an operation.
sourcepub fn insert_operation_after(
&self,
one: OperationRef<'_>,
other: Operation<'_>
) -> OperationRef<'_>
pub fn insert_operation_after( &self, one: OperationRef<'_>, other: Operation<'_> ) -> OperationRef<'_>
Inserts an operation after another.
sourcepub fn insert_operation_before(
&self,
one: OperationRef<'_>,
other: Operation<'_>
) -> OperationRef<'_>
pub fn insert_operation_before( &self, one: OperationRef<'_>, other: Operation<'_> ) -> OperationRef<'_>
Inserts an operation before another.
sourcepub unsafe fn detach(&self) -> Option<Block<'_>>
pub unsafe fn detach(&self) -> Option<Block<'_>>
Detaches a block from a region and assumes its ownership.
Safety
This function might invalidate existing references to the block if you drop it too early.
sourcepub fn next_in_region(&self) -> Option<BlockRef<'_>>
pub fn next_in_region(&self) -> Option<BlockRef<'_>>
Gets a next block in a region.