Implement jump tables.
- Add a ir::jumptable module with a JumpTableData struct representing the vector of destinations. - Add an entity map of jump tables to the Function. - Parse and write jump tables in the function preamble. - Rewrite EBB references in jumptables after parsing.
This commit is contained in:
@@ -75,6 +75,11 @@ fn write_preamble(w: &mut Write, func: &Function) -> io::Result<bool> {
|
||||
try!(writeln!(w, " {} = {}", ss, func[ss]));
|
||||
}
|
||||
|
||||
for jt in func.jump_tables.keys() {
|
||||
any = true;
|
||||
try!(writeln!(w, " {} = {}", jt, func.jump_tables[jt]));
|
||||
}
|
||||
|
||||
Ok(any)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user