Struct melior::dialect::ods::pdl_interp::SwitchTypeOperation
source · pub struct SwitchTypeOperation<'c> { /* private fields */ }
Expand description
A switch_type
operation. Switch on a Type
value.
pdl_interp.switch_type
operations compare a type with a set of statically
known types. If the value matches one of the provided case values the
destination for that case value is taken, otherwise the default destination
is taken.
Example:
pdl_interp.switch_type %type to [i32, i64] -> ^i32Dest, ^i64Dest, ^defaultDest
Implementations§
source§impl<'c> SwitchTypeOperation<'c>
impl<'c> SwitchTypeOperation<'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>
) -> SwitchTypeOperationBuilder<'c, Unset, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> SwitchTypeOperationBuilder<'c, Unset, Unset, Unset, Unset>
Creates a builder.
pub fn value(&self) -> Result<Value<'c, '_>, Error>
pub fn default_dest(&self) -> Result<BlockRef<'c, '_>, Error>
pub fn cases(&self) -> impl Iterator<Item = BlockRef<'c, '_>>
pub fn case_values(&self) -> Result<ArrayAttribute<'c>, Error>
pub fn set_case_values(&mut self, value: ArrayAttribute<'c>)
Trait Implementations§
source§impl<'c> From<SwitchTypeOperation<'c>> for Operation<'c>
impl<'c> From<SwitchTypeOperation<'c>> for Operation<'c>
source§fn from(operation: SwitchTypeOperation<'c>) -> Self
fn from(operation: SwitchTypeOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for SwitchTypeOperation<'c>
impl<'c> !Send for SwitchTypeOperation<'c>
impl<'c> !Sync for SwitchTypeOperation<'c>
impl<'c> Unpin for SwitchTypeOperation<'c>
impl<'c> UnwindSafe for SwitchTypeOperation<'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