Skip to main content

booleanize

Function booleanize 

Source
pub fn booleanize(vt: &mut VarTable, body: &mut Stmt, ret_bool: bool) -> usize
Expand description

Boolean inference: vars only ever assigned 0/1/comparisons/booleans and read in conditions become boolean, with v != 0 → v in conditions. Returns the number of vars converted (0 = nothing changed — the caller skips the post-booleanize re-split, which only has work when a conversion exposed a mixed-kind register).