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

Function compileModule

test/mixcall/mixcallTest.cpp:114–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112};
113
114bool 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
140TEST(MixCallTest, Call__InterpCallAOT) {
141 WasmEdge::Configure Conf;

Callers 1

TESTFunction · 0.85

Calls 7

checkConfigureMethod · 0.80
parseModuleMethod · 0.80
codegenMethod · 0.80
has_valueMethod · 0.45
loadFileMethod · 0.45
validateMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected