Struct melior::dialect::ods::pdl_interp::CheckOperandCountOperation
source · pub struct CheckOperandCountOperation<'c> { /* private fields */ }
Expand description
A check_operand_count
operation. Check the number of operands of an Operation
.
pdl_interp.check_operand_count
operations compare the number of operands
of a given operation value with a constant. The comparison is either exact
or at_least, with the latter used to compare against a minimum number of
expected operands. On success, this operation branches to the true
destination, otherwise the false destination is taken.
Example:
// Check for exact equality.
pdl_interp.check_operand_count of %op is 2 -> ^matchDest, ^failureDest
// Check for at least N operands.
pdl_interp.check_operand_count of %op is at_least 2 -> ^matchDest, ^failureDest
Implementations§
source§impl<'c> CheckOperandCountOperation<'c>
impl<'c> CheckOperandCountOperation<'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>
) -> CheckOperandCountOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> CheckOperandCountOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn input_op(&self) -> Result<Value<'c, '_>, Error>
pub fn true_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn false_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn count(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_count(&mut self, value: IntegerAttribute<'c>)
pub fn compare_at_least(&self) -> Result<Attribute<'c>, Error>
pub fn set_compare_at_least(&mut self, value: Attribute<'c>)
pub fn remove_compare_at_least(&mut self) -> Result<(), Error>
Trait Implementations§
source§impl<'c> From<CheckOperandCountOperation<'c>> for Operation<'c>
impl<'c> From<CheckOperandCountOperation<'c>> for Operation<'c>
source§fn from(operation: CheckOperandCountOperation<'c>) -> Self
fn from(operation: CheckOperandCountOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for CheckOperandCountOperation<'c>
impl<'c> !Send for CheckOperandCountOperation<'c>
impl<'c> !Sync for CheckOperandCountOperation<'c>
impl<'c> Unpin for CheckOperandCountOperation<'c>
impl<'c> UnwindSafe for CheckOperandCountOperation<'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