| 112 | }; |
| 113 | |
| 114 | bool compileModule(const WasmEdge::Configure &Conf, std::string_view InPath, |
| 115 | std::string_view OutPath) { |
| 116 | WasmEdge::Loader::Loader Load(Conf); |
| 117 | WasmEdge::Validator::Validator Valid(Conf); |
| 118 | WasmEdge::LLVM::Compiler Compiler(Conf); |
| 119 | WasmEdge::LLVM::CodeGen CodeGen(Conf); |
| 120 | |
| 121 | std::vector<WasmEdge::Byte> Data; |
| 122 | std::unique_ptr<WasmEdge::AST::Module> Module; |
| 123 | return Compiler.checkConfigure() |
| 124 | .and_then([&]() noexcept { return Load.loadFile(InPath); }) |
| 125 | .and_then([&](auto Result) noexcept { |
| 126 | Data = std::move(Result); |
| 127 | return Load.parseModule(InPath); |
| 128 | }) |
| 129 | .and_then([&](auto Result) noexcept { |
| 130 | Module = std::move(Result); |
| 131 | return Valid.validate(*Module); |
| 132 | }) |
| 133 | .and_then([&]() noexcept { return Compiler.compile(*Module); }) |
| 134 | .and_then([&](auto Result) noexcept { |
| 135 | return CodeGen.codegen(Data, std::move(Result), OutPath); |
| 136 | }) |
| 137 | .has_value(); |
| 138 | } |
| 139 | |
| 140 | TEST(MixCallTest, Call__InterpCallAOT) { |
| 141 | WasmEdge::Configure Conf; |
no test coverage detected