midenc-hir 0.7.2

High-level Intermediate Representation for Miden Assembly
mod instance;
mod interface;
mod memory;
mod speculation;

use core::fmt;

pub use self::{instance::EffectInstance, interface::*, memory::*, speculation::*};
use crate::{DynPartialEq, any::AsAny, eq::PartialEqable};

pub trait Effect: AsAny + fmt::Debug {}

pub trait Resource: AsAny + PartialEqable + DynPartialEq + fmt::Debug {
    fn name(&self) -> &'static str;
}

/// A conservative default resource kind
#[derive(Debug, Default, PartialEq, Eq)]
pub struct DefaultResource;
impl Resource for DefaultResource {
    fn name(&self) -> &'static str {
        "default"
    }
}

/// An automatic allocation-scope resource that is valid in the context of a parent
/// AutomaticAllocationScope trait.
#[derive(Debug, Default, PartialEq, Eq)]
pub struct AutomaticAllocationScopeResource;
impl Resource for AutomaticAllocationScopeResource {
    fn name(&self) -> &'static str {
        "automatic-allocation-scope"
    }
}

/// An operation trait for ops that are always speculatable and have no memory effects
pub trait Pure: AlwaysSpeculatable + MemoryEffectOpInterface {}