pub struct RewriterBase<'c, 'a> { /* private fields */ }Expand description
A non-owning reference to a rewriter base.
Implementations§
Source§impl<'c, 'a> RewriterBase<'c, 'a>
impl<'c, 'a> RewriterBase<'c, 'a>
Sourcepub unsafe fn from_raw(raw: MlirRewriterBase) -> Self
pub unsafe fn from_raw(raw: MlirRewriterBase) -> Self
Sourcepub fn context(&self) -> ContextRef<'c>
pub fn context(&self) -> ContextRef<'c>
Returns the context.
Sourcepub fn clear_insertion_point(&self)
pub fn clear_insertion_point(&self)
Clears the insertion point.
Sourcepub fn set_insertion_point_before(&self, op: OperationRef<'_, '_>)
pub fn set_insertion_point_before(&self, op: OperationRef<'_, '_>)
Sets the insertion point before the given operation.
Sourcepub fn set_insertion_point_after(&self, op: OperationRef<'_, '_>)
pub fn set_insertion_point_after(&self, op: OperationRef<'_, '_>)
Sets the insertion point after the given operation.
Sourcepub fn set_insertion_point_to_start(&self, block: BlockRef<'_, '_>)
pub fn set_insertion_point_to_start(&self, block: BlockRef<'_, '_>)
Sets the insertion point to the start of the given block.
Sourcepub fn set_insertion_point_to_end(&self, block: BlockRef<'_, '_>)
pub fn set_insertion_point_to_end(&self, block: BlockRef<'_, '_>)
Sets the insertion point to the end of the given block.
Sourcepub fn insertion_block(&self) -> BlockRef<'c, '_>
pub fn insertion_block(&self) -> BlockRef<'c, '_>
Returns the block the insertion point belongs to.
Sourcepub fn insert(&self, op: Operation<'c>) -> OperationRef<'c, '_>
pub fn insert(&self, op: Operation<'c>) -> OperationRef<'c, '_>
Inserts the operation at the current insertion point and returns a reference to it.
Sourcepub fn clone_op<'b>(&self, op: OperationRef<'c, 'b>) -> OperationRef<'c, 'b>
pub fn clone_op<'b>(&self, op: OperationRef<'c, 'b>) -> OperationRef<'c, 'b>
Creates a deep copy of the operation.
Sourcepub fn clone_op_without_regions<'b>(
&self,
op: OperationRef<'c, 'b>,
) -> OperationRef<'c, 'b>
pub fn clone_op_without_regions<'b>( &self, op: OperationRef<'c, 'b>, ) -> OperationRef<'c, 'b>
Creates a deep copy of the operation without its regions.
Sourcepub fn clone_region_before(
&self,
region: RegionRef<'_, '_>,
before: BlockRef<'_, '_>,
)
pub fn clone_region_before( &self, region: RegionRef<'_, '_>, before: BlockRef<'_, '_>, )
Clones the blocks of the region before the given block.
Sourcepub fn inline_region_before(
&self,
region: RegionRef<'_, '_>,
before: BlockRef<'_, '_>,
)
pub fn inline_region_before( &self, region: RegionRef<'_, '_>, before: BlockRef<'_, '_>, )
Moves the blocks of the region before the given block.
Sourcepub fn replace_op_with_values(
&self,
op: OperationRef<'_, '_>,
values: &[Value<'_, '_>],
)
pub fn replace_op_with_values( &self, op: OperationRef<'_, '_>, values: &[Value<'_, '_>], )
Replaces the results of the operation with the given values. Erases the op.
Sourcepub fn replace_op_with_operation(
&self,
op: OperationRef<'_, '_>,
new_op: OperationRef<'_, '_>,
)
pub fn replace_op_with_operation( &self, op: OperationRef<'_, '_>, new_op: OperationRef<'_, '_>, )
Replaces the operation with another operation. Erases the original op.
Sourcepub fn erase_op(&self, op: OperationRef<'_, '_>)
pub fn erase_op(&self, op: OperationRef<'_, '_>)
Erases the operation. The operation must have no uses.
Sourcepub fn erase_block(&self, block: BlockRef<'_, '_>)
pub fn erase_block(&self, block: BlockRef<'_, '_>)
Erases the block along with all its operations.
Sourcepub fn move_op_before(
&self,
op: OperationRef<'_, '_>,
existing_op: OperationRef<'_, '_>,
)
pub fn move_op_before( &self, op: OperationRef<'_, '_>, existing_op: OperationRef<'_, '_>, )
Moves the operation immediately before the existing operation.
Sourcepub fn move_op_after(
&self,
op: OperationRef<'_, '_>,
existing_op: OperationRef<'_, '_>,
)
pub fn move_op_after( &self, op: OperationRef<'_, '_>, existing_op: OperationRef<'_, '_>, )
Moves the operation immediately after the existing operation.
Sourcepub fn move_block_before(
&self,
block: BlockRef<'_, '_>,
existing_block: BlockRef<'_, '_>,
)
pub fn move_block_before( &self, block: BlockRef<'_, '_>, existing_block: BlockRef<'_, '_>, )
Moves the block immediately before the existing block.
Sourcepub fn start_op_modification(&self, op: OperationRef<'_, '_>)
pub fn start_op_modification(&self, op: OperationRef<'_, '_>)
Signals the start of an in-place modification of the operation.
Sourcepub fn finalize_op_modification(&self, op: OperationRef<'_, '_>)
pub fn finalize_op_modification(&self, op: OperationRef<'_, '_>)
Signals the end of an in-place modification of the operation.
Sourcepub fn cancel_op_modification(&self, op: OperationRef<'_, '_>)
pub fn cancel_op_modification(&self, op: OperationRef<'_, '_>)
Cancels a pending in-place modification of the operation.
Sourcepub fn replace_all_uses_with(&self, from: Value<'_, '_>, to: Value<'_, '_>)
pub fn replace_all_uses_with(&self, from: Value<'_, '_>, to: Value<'_, '_>)
Replaces all uses of from with to.
Trait Implementations§
Source§impl<'c, 'a> Clone for RewriterBase<'c, 'a>
impl<'c, 'a> Clone for RewriterBase<'c, 'a>
Source§fn clone(&self) -> RewriterBase<'c, 'a>
fn clone(&self) -> RewriterBase<'c, 'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more