Add signatures and ext_funcs tables to DataFlowGraph.

These two tables are used to keep track of type signatures of function
calls as well as external function references used in direct function
calls.

Also add an ExtFuncData struct representing an external function that
can be called directly.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-18 10:07:44 -07:00
parent e4e1c30f87
commit c961e89fdc
4 changed files with 41 additions and 3 deletions

View File

@@ -43,6 +43,17 @@ fn write_preamble(w: &mut Write, func: &Function) -> result::Result<bool, Error>
try!(writeln!(w, " {} = {}", ss, func.stack_slots[ss]));
}
// Write out all signatures before functions since function decls can refer to signatures.
for sig in func.dfg.signatures.keys() {
any = true;
try!(writeln!(w, " {} = signature{}", sig, func.dfg.signatures[sig]));
}
for fnref in func.dfg.ext_funcs.keys() {
any = true;
try!(writeln!(w, " {} = {}", fnref, func.dfg.ext_funcs[fnref]));
}
for jt in func.jump_tables.keys() {
any = true;
try!(writeln!(w, " {} = {}", jt, func.jump_tables[jt]));