Skip to main content

air_mir/
codegen.rs

1/// This trait should be implemented on types which handle generating code from AirScript MIR
2pub trait CodeGenerator {
3    /// The type of the artifact produced by this codegen backend
4    type Output;
5
6    /// Generates code using this generator, consuming it in the process
7    fn generate(&self, ir: &crate::ir::Mir) -> anyhow::Result<Self::Output>;
8}