Skip to main content

finish

Function finish 

Source
pub fn finish(
    func: &mut Func,
    allocation: &Allocation,
    frame: &Frame,
    stack: &Stack,
    convention: Convention<'_>,
    names: &mut Interner,
) -> Moves
Expand description

Writes the moves, the prologue and the epilogue into a function the allocator has finished with.

Hands back which instruction each of the allocator’s moves became, for the one pass that is allowed to take one of them out again.

§Panics

Panics on a function with no blocks in it, on a frame whose slots or locals the allocation and the lowering do not match, and on a move of a class the target did not say how to move. All of them are the caller handing it a frame and a function that were not worked out from each other.