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

Function WasmEdge_CompilerCreate

lib/api/wasmedge.cpp:1901–1924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1899// >>>>>>>> WasmEdge AOT compiler functions >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1900
1901WASMEDGE_CAPI_EXPORT WasmEdge_CompilerContext *
1902WasmEdge_CompilerCreate(const WasmEdge_ConfigureContext *ConfCxt
1903 [[maybe_unused]]) noexcept {
1904#ifdef WASMEDGE_USE_LLVM
1905 try {
1906 // Set force interpreter here to load instructions of function body
1907 // forcibly.
1908 if (ConfCxt) {
1909 WasmEdge::Configure CopyConf(ConfCxt->Conf);
1910 CopyConf.getRuntimeConfigure().setRunMode(WasmEdge::RunMode::Interpreter);
1911 return new WasmEdge_CompilerContext(CopyConf);
1912 } else {
1913 WasmEdge::Configure CopyConf;
1914 CopyConf.getRuntimeConfigure().setRunMode(WasmEdge::RunMode::Interpreter);
1915 return new WasmEdge_CompilerContext(CopyConf);
1916 }
1917 } catch (...) {
1918 handleCAPIError();
1919 return nullptr;
1920 }
1921#else
1922 return nullptr;
1923#endif
1924}
1925
1926WASMEDGE_CAPI_EXPORT WasmEdge_Result
1927WasmEdge_CompilerCompile(WasmEdge_CompilerContext *Cxt [[maybe_unused]],

Callers 2

TestContextMethod · 0.85
TESTFunction · 0.85

Calls 2

handleCAPIErrorFunction · 0.85
setRunModeMethod · 0.80

Tested by 2

TestContextMethod · 0.68
TESTFunction · 0.68