| 1899 | // >>>>>>>> WasmEdge AOT compiler functions >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
| 1900 | |
| 1901 | WASMEDGE_CAPI_EXPORT WasmEdge_CompilerContext * |
| 1902 | WasmEdge_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 | |
| 1926 | WASMEDGE_CAPI_EXPORT WasmEdge_Result |
| 1927 | WasmEdge_CompilerCompile(WasmEdge_CompilerContext *Cxt [[maybe_unused]], |