Struct orzir_core::Dialect
source · pub struct Dialect { /* private fields */ }Expand description
A dialect.
Dialects define the operations and types that are available in a specific language. This is the same as dialects in the MLIR, which make it possible to extend the framework with new operations and types.
Implementations§
source§impl Dialect
impl Dialect
sourcepub fn new(mnemonic: MnemonicSegment) -> Self
pub fn new(mnemonic: MnemonicSegment) -> Self
Create an empty dialect from a mnemonic.
sourcepub fn mnemonic(&self) -> MnemonicSegment
pub fn mnemonic(&self) -> MnemonicSegment
Get the mnemonic of the dialect.
sourcepub fn add_op(&mut self, mnemonic: Mnemonic, parse_fn: OpParseFn)
pub fn add_op(&mut self, mnemonic: Mnemonic, parse_fn: OpParseFn)
Add an operation and its parse function.
sourcepub fn add_ty(&mut self, mnemonic: Mnemonic, parse_fn: TyParseFn)
pub fn add_ty(&mut self, mnemonic: Mnemonic, parse_fn: TyParseFn)
Add a type and its parse function.
sourcepub fn get_op_parse_fn(&self, mnemonic: &Mnemonic) -> Option<&OpParseFn>
pub fn get_op_parse_fn(&self, mnemonic: &Mnemonic) -> Option<&OpParseFn>
Get the operation parse function.
sourcepub fn get_ty_parse_fn(&self, mnemonic: &Mnemonic) -> Option<&TyParseFn>
pub fn get_ty_parse_fn(&self, mnemonic: &Mnemonic) -> Option<&TyParseFn>
Get the type parse function.
Auto Trait Implementations§
impl Freeze for Dialect
impl RefUnwindSafe for Dialect
impl Send for Dialect
impl Sync for Dialect
impl Unpin for Dialect
impl UnwindSafe for Dialect
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.