Skip to main content

reach

Function reach 

Source
pub fn reach(
    func: &Func,
    addresses: &[(Inst, usize)],
    count: usize,
    insts: &FrameInsts,
    names: &mut Interner,
) -> Reach
Expand description

Follows the address of every local of a function as far as it goes.

addresses is the list crate::lower built and crate::fold rewrote, which says which instruction carries the address of which local. count is how many locals there are, since a local nothing on that list names is one this has no account of rather than one nothing touches.

Run after the fold and before allocation. After the fold because an address that ended up inside its reader is an address no value holds and this has to see it that way. Before allocation because every answer here is about a virtual register, and the rewrite the allocator ends with is what stops there being one.