MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / add_fn

Method add_fn

cranelift/reader/src/parser.rs:374–386  ·  view source on GitHub ↗

Allocate a new external function.

(&mut self, fn_: FuncRef, data: ExtFuncData, loc: Location)

Source from the content-addressed store, hash-verified

372
373 // Allocate a new external function.
374 fn add_fn(&mut self, fn_: FuncRef, data: ExtFuncData, loc: Location) -> ParseResult<()> {
375 self.map.def_fn(fn_, loc)?;
376 while self.function.dfg.ext_funcs.next_key().index() <= fn_.index() {
377 self.function.import_function(ExtFuncData {
378 name: ExternalName::testcase(""),
379 signature: SigRef::reserved_value(),
380 colocated: false,
381 patchable: false,
382 });
383 }
384 self.function.dfg.ext_funcs[fn_] = data;
385 Ok(())
386 }
387
388 // Resolve a reference to a function.
389 fn check_fn(&self, fn_: FuncRef, loc: Location) -> ParseResult<()> {

Callers 1

parse_preambleMethod · 0.80

Calls 5

OkFunction · 0.85
def_fnMethod · 0.80
indexMethod · 0.45
next_keyMethod · 0.45
import_functionMethod · 0.45

Tested by

no test coverage detected