RewriterBase

Struct RewriterBase 

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

Source

pub unsafe fn from_raw(raw: MlirRewriterBase) -> Self

Creates a rewriter base from a raw object.

§Safety

A raw object must be valid.

Source

pub fn context(&self) -> ContextRef<'c>

Returns the context.

Source

pub fn clear_insertion_point(&self)

Clears the insertion point.

Source

pub fn set_insertion_point_before(&self, op: OperationRef<'_, '_>)

Sets the insertion point before the given operation.

Source

pub fn set_insertion_point_after(&self, op: OperationRef<'_, '_>)

Sets the insertion point after the given operation.

Source

pub fn set_insertion_point_to_start(&self, block: BlockRef<'_, '_>)

Sets the insertion point to the start of the given block.

Source

pub fn set_insertion_point_to_end(&self, block: BlockRef<'_, '_>)

Sets the insertion point to the end of the given block.

Source

pub fn insertion_block(&self) -> BlockRef<'c, '_>

Returns the block the insertion point belongs to.

Source

pub fn block(&self) -> BlockRef<'c, '_>

Returns the current block.

Source

pub fn insert(&self, op: Operation<'c>) -> OperationRef<'c, '_>

Inserts the operation at the current insertion point and returns a reference to it.

Source

pub fn clone_op<'b>(&self, op: OperationRef<'c, 'b>) -> OperationRef<'c, 'b>

Creates a deep copy of the operation.

Source

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.

Source

pub fn clone_region_before( &self, region: RegionRef<'_, '_>, before: BlockRef<'_, '_>, )

Clones the blocks of the region before the given block.

Source

pub fn inline_region_before( &self, region: RegionRef<'_, '_>, before: BlockRef<'_, '_>, )

Moves the blocks of the region before the given block.

Source

pub fn replace_op_with_values( &self, op: OperationRef<'_, '_>, values: &[Value<'_, '_>], )

Replaces the results of the operation with the given values. Erases the op.

Source

pub fn replace_op_with_operation( &self, op: OperationRef<'_, '_>, new_op: OperationRef<'_, '_>, )

Replaces the operation with another operation. Erases the original op.

Source

pub fn erase_op(&self, op: OperationRef<'_, '_>)

Erases the operation. The operation must have no uses.

Source

pub fn erase_block(&self, block: BlockRef<'_, '_>)

Erases the block along with all its operations.

Source

pub fn move_op_before( &self, op: OperationRef<'_, '_>, existing_op: OperationRef<'_, '_>, )

Moves the operation immediately before the existing operation.

Source

pub fn move_op_after( &self, op: OperationRef<'_, '_>, existing_op: OperationRef<'_, '_>, )

Moves the operation immediately after the existing operation.

Source

pub fn move_block_before( &self, block: BlockRef<'_, '_>, existing_block: BlockRef<'_, '_>, )

Moves the block immediately before the existing block.

Source

pub fn start_op_modification(&self, op: OperationRef<'_, '_>)

Signals the start of an in-place modification of the operation.

Source

pub fn finalize_op_modification(&self, op: OperationRef<'_, '_>)

Signals the end of an in-place modification of the operation.

Source

pub fn cancel_op_modification(&self, op: OperationRef<'_, '_>)

Cancels a pending in-place modification of the operation.

Source

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>

Source§

fn clone(&self) -> RewriterBase<'c, 'a>

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<'c, 'a> Copy for RewriterBase<'c, 'a>

Auto Trait Implementations§

§

impl<'c, 'a> Freeze for RewriterBase<'c, 'a>

§

impl<'c, 'a> RefUnwindSafe for RewriterBase<'c, 'a>

§

impl<'c, 'a> !Send for RewriterBase<'c, 'a>

§

impl<'c, 'a> !Sync for RewriterBase<'c, 'a>

§

impl<'c, 'a> Unpin for RewriterBase<'c, 'a>

§

impl<'c, 'a> UnwindSafe for RewriterBase<'c, 'a>

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, 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.