Skip to main content

switches

Function switches 

Source
pub fn switches(func: &mut Func)
Expand description

Rewrites every switch in the function into branches, and leaves everything else alone.

The function is changed in place, which is what makes this the last thing that reads the IR as the front end built it. --emit=ir prints before this runs, and nothing after this asks what the program said, only what the machine has to do.