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:
Jakob Stoklund Olesen
2016-07-22 11:41:30 -07:00
parent ba76f444ab
commit f054d32f50
7 changed files with 281 additions and 5 deletions

View File

@@ -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)
}