Skip to main content

Backend

Trait Backend 

Source
pub trait Backend {
    type Output;

    // Required methods
    fn name(&self) -> &str;
    fn lower_module(&mut self, module: &mut Module) -> Self::Output;
}
Expand description

A code generation backend that lowers MIR to a target artifact.

Required Associated Types§

Source

type Output

The artifact this backend produces from a module.

Required Methods§

Source

fn name(&self) -> &str

A short identifier for this backend, e.g. "evm".

Source

fn lower_module(&mut self, module: &mut Module) -> Self::Output

Lowers a module to this backend’s output artifact. Takes &mut so the backend can run its own target-specific passes over the MIR first.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§