Trait Pass

Source
pub trait Pass {
    type Input;
    type Output;

    const NAME: &str;

    // Required method
    fn do_pass(
        input: Self::Input,
        state: &mut CompilerState,
    ) -> Result<Self::Output>;
}
Expand description

A compiler pass.

Every pass has access to CompilerState, and may also specify an Input and Output.

Required Associated Constants§

Source

const NAME: &str

Required Associated Types§

Required Methods§

Source

fn do_pass( input: Self::Input, state: &mut CompilerState, ) -> Result<Self::Output>

Runs the compiler pass.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Pass for CodeGenerating

Source§

const NAME: &str = "CodeGenerating"

Source§

type Input = ()

Source§

type Output = String

Source§

impl Pass for ConstPropagation

Source§

const NAME: &str = "ConstPropagation"

Source§

type Input = ()

Source§

type Output = ConstPropagationOutput

Source§

impl Pass for ConstPropagationAndUnrolling

Source§

const NAME: &str = "ConstPropagationAndUnrolling"

Source§

type Input = TypeCheckingInput

Source§

type Output = ()

Source§

impl Pass for DeadCodeEliminating

Source§

const NAME: &str = "DeadCodeEliminating"

Source§

type Input = ()

Source§

type Output = DeadCodeEliminatingOutput

Source§

impl Pass for Destructuring

Source§

const NAME: &str = "Destructuring"

Source§

type Input = ()

Source§

type Output = ()

Source§

impl Pass for Flattening

Source§

const NAME: &str = "Flattening"

Source§

type Input = ()

Source§

type Output = ()

Source§

impl Pass for FunctionInlining

Source§

const NAME: &str = "FunctionInlining"

Source§

type Input = ()

Source§

type Output = ()

Source§

impl Pass for Monomorphization

Source§

const NAME: &str = "Monomorphization"

Source§

type Input = ()

Source§

type Output = MonomorphizationOutput

Source§

impl Pass for ProcessingScript

Source§

const NAME: &'static str = "ProcessingScript"

Source§

type Input = ()

Source§

type Output = ()

Source§

impl Pass for SsaForming

Source§

const NAME: &str = "SsaForming"

Source§

type Input = SsaFormingInput

Source§

type Output = ()

Source§

impl Pass for StaticAnalyzing

Source§

const NAME: &str = "StaticAnalyzing"

Source§

type Input = ()

Source§

type Output = ()

Source§

impl Pass for SymbolTableCreation

Source§

const NAME: &'static str = "SymbolTableCreation"

Source§

type Input = ()

Source§

type Output = ()

Source§

impl Pass for TypeChecking

Source§

const NAME: &'static str = "TypeChecking"

Source§

type Input = TypeCheckingInput

Source§

type Output = ()

Source§

impl Pass for Unrolling

Source§

impl Pass for WriteTransforming

Source§

const NAME: &str = "WriteTransforming"

Source§

type Input = ()

Source§

type Output = ()