Helper function to register AST module.
| 404 | |
| 405 | // Helper function to register AST module. |
| 406 | WasmEdge_ModuleInstanceContext * |
| 407 | registerModule(const WasmEdge_ConfigureContext *Conf, |
| 408 | WasmEdge_StoreContext *Store, |
| 409 | const WasmEdge_ASTModuleContext *Mod, std::string_view Name) { |
| 410 | WasmEdge_ExecutorContext *ExecCxt = WasmEdge_ExecutorCreate(Conf, nullptr); |
| 411 | WasmEdge_String ModName = |
| 412 | WasmEdge_StringWrap(Name.data(), static_cast<uint32_t>(Name.length())); |
| 413 | WasmEdge_ModuleInstanceContext *ResMod = nullptr; |
| 414 | WasmEdge_ExecutorRegister(ExecCxt, &ResMod, Store, Mod, ModName); |
| 415 | WasmEdge_ExecutorDelete(ExecCxt); |
| 416 | return ResMod; |
| 417 | } |
| 418 | |
| 419 | // Helper function to register existing host module. |
| 420 | bool registerModule(const WasmEdge_ConfigureContext *Conf, |
no test coverage detected