MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / registerModule

Method registerModule

lib/executor/executor.cpp:30–41  ·  view source on GitHub ↗

Register a named WASM module. See "include/executor/executor.h".

Source from the content-addressed store, hash-verified

28
29/// Register a named WASM module. See "include/executor/executor.h".
30Expect<std::unique_ptr<Runtime::Instance::ModuleInstance>>
31Executor::registerModule(Runtime::StoreManager &StoreMgr,
32 const AST::Module &Mod, std::string_view Name) {
33 return instantiate(StoreMgr, Mod, Name).map_error([this](auto E) {
34 // If statistics are enabled, dump them here.
35 // When an error occurs, subsequent execution will not run.
36 if (Stat) {
37 Stat->dumpToLog(Conf);
38 }
39 return E;
40 });
41}
42
43/// Register an instantiated module. See "include/executor/executor.h".
44Expect<void>

Calls 3

InfoASTClass · 0.85
dumpToLogMethod · 0.80
errorFunction · 0.50

Tested by

no test coverage detected