Struct melior_next::Context
source · pub struct Context { /* private fields */ }
Expand description
A context of IR, dialects, and passes.
Contexts own various objects, such as types, locations, and dialect instances.
Implementations§
source§impl Context
impl Context
sourcepub fn registered_dialect_count(&self) -> usize
pub fn registered_dialect_count(&self) -> usize
Gets a number of registered dialects.
sourcepub fn loaded_dialect_count(&self) -> usize
pub fn loaded_dialect_count(&self) -> usize
Gets a number of loaded dialects.
sourcepub fn get_or_load_dialect(&self, name: &str) -> Dialect<'_>
pub fn get_or_load_dialect(&self, name: &str) -> Dialect<'_>
Gets or loads a dialect.
sourcepub fn append_dialect_registry(&self, registry: &Registry)
pub fn append_dialect_registry(&self, registry: &Registry)
Appends a dialect registry.
sourcepub fn load_all_available_dialects(&self)
pub fn load_all_available_dialects(&self)
Loads all available dialects.
sourcepub fn enable_multi_threading(&self, enabled: bool)
pub fn enable_multi_threading(&self, enabled: bool)
Enables multi-threading.
sourcepub fn allow_unregistered_dialects(&self) -> bool
pub fn allow_unregistered_dialects(&self) -> bool
Returns true
if unregistered dialects are allowed.
sourcepub fn set_allow_unregistered_dialects(&self, allowed: bool)
pub fn set_allow_unregistered_dialects(&self, allowed: bool)
Set if unregistered dialects are allowed.
sourcepub fn is_registered_operation(&self, name: &str) -> bool
pub fn is_registered_operation(&self, name: &str) -> bool
Returns true
if a given operation is registered in a context.
source§impl Context
impl Context
sourcepub fn attach_diagnostic_handler<F>(&self, handler: F) -> DiagnosticHandlerwhere
F: FnMut(Diagnostic<'_>) -> LogicalResult,
pub fn attach_diagnostic_handler<F>(&self, handler: F) -> DiagnosticHandlerwhere F: FnMut(Diagnostic<'_>) -> LogicalResult,
Attach a diagnostic handler to the context.