Skip to main content

compile

Function compile 

Source
pub fn compile(
    source: &mut Func,
    names: &mut Interner,
    machine: &Machine,
    flags: Flags,
) -> Result<Func, Unsupported>
Expand description

Compiles one function, from the IR the middle end produced to machine instructions.

The function is taken by reference that can be written through, because the first pass is an IR to IR rewrite: a construct whose lowering is a new shape of control flow cannot be a rule, since a rule replaces a term with a term and has nowhere to put a block. So the IR that reaches selection is not quite the IR the middle end produced, and this is the only place that is true. --emit=ir prints before any of this runs.

ยงErrors

The first thing in it this cannot lower, which is what lower::func reports and is the only pass here that can refuse a function. Everything after lowering works on machine instructions that exist, so it either runs or it is a bug in this crate.