Struct melior::dialect::ods::pdl_interp::ApplyRewriteOperation
source · pub struct ApplyRewriteOperation<'c> { /* private fields */ }
Expand description
An apply_rewrite
operation. Invoke and apply an externally registered rewrite method.
pdl_interp.apply_rewrite
operations invoke an external rewriter that has
been registered with the interpreter to perform the rewrite after a
successful match. The rewrite is passed a set of positional arguments. The
rewrite function may return any number of results.
Example:
// Rewriter operating solely on the root operation.
pdl_interp.apply_rewrite "rewriter"(%root : !pdl.operation)
// Rewriter operating solely on the root operation and return an attribute.
%attr = pdl_interp.apply_rewrite "rewriter"(%root : !pdl.operation) : !pdl.attribute
// Rewriter operating on the root operation along with additional arguments
// from the matcher.
pdl_interp.apply_rewrite "rewriter"(%root : !pdl.operation, %value : !pdl.value)
Implementations§
source§impl<'c> ApplyRewriteOperation<'c>
impl<'c> ApplyRewriteOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> ApplyRewriteOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> ApplyRewriteOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.
pub fn results(&self) -> impl Iterator<Item = OperationResult<'c, '_>>
pub fn args(&self) -> impl Iterator<Item = Value<'c, '_>>
pub fn _name(&self) -> Result<StringAttribute<'c>, Error>
pub fn set_name(&mut self, value: StringAttribute<'c>)
Trait Implementations§
source§impl<'c> From<ApplyRewriteOperation<'c>> for Operation<'c>
impl<'c> From<ApplyRewriteOperation<'c>> for Operation<'c>
source§fn from(operation: ApplyRewriteOperation<'c>) -> Self
fn from(operation: ApplyRewriteOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for ApplyRewriteOperation<'c>
impl<'c> !Send for ApplyRewriteOperation<'c>
impl<'c> !Sync for ApplyRewriteOperation<'c>
impl<'c> Unpin for ApplyRewriteOperation<'c>
impl<'c> UnwindSafe for ApplyRewriteOperation<'c>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more