Skip to main content

blocks

Function blocks 

Source
pub fn blocks(
    func: &mut Func,
    insts: &BranchInsts,
    names: &mut Interner,
    fusable: &HashSet<Inst>,
    reorder: bool,
)
Expand description

Puts a function’s blocks in an order and writes the jumps that order needs.

Run last, after crate::finish.

§Panics

Panics on a block with more than two successors that does not end in the jump through a register, which is the only thing that lowers to one, and on a block with two whose last instruction is not the conditional branch the target named. Both are a function that was built wrongly somewhere earlier, and both are worth finding here rather than as a jump to the wrong place.