Let the runtime provide the number of imported functions.

This obviates the need to keep a separate running total of the number of
functions seen.
This commit is contained in:
Dan Gohman
2017-10-09 11:41:01 -07:00
parent e74bc06380
commit 2c9d03f9bd
4 changed files with 10 additions and 5 deletions

View File

@@ -146,6 +146,10 @@ impl WasmRuntime for DummyRuntime {
self.imported_funcs.push(ir::FunctionName::new(name));
}
fn get_num_func_imports(&self) -> usize {
self.imported_funcs.len()
}
fn declare_func_type(&mut self, sig_index: SignatureIndex) {
self.func_types.push(sig_index);
}