/src/WasmEdge/lib/loader/serialize/serial_expression.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | // SPDX-License-Identifier: Apache-2.0 |
2 | | // SPDX-FileCopyrightText: 2019-2024 Second State INC |
3 | | |
4 | | #include "loader/serialize.h" |
5 | | |
6 | | namespace WasmEdge { |
7 | | namespace Loader { |
8 | | |
9 | | // Serialize expression. See "include/loader/serialize.h". |
10 | | Expect<void> |
11 | | Serializer::serializeExpression(const AST::Expression &Expr, |
12 | 0 | std::vector<uint8_t> &OutVec) const noexcept { |
13 | | // Expression: instr*. |
14 | 0 | for (const auto &Instr : Expr.getInstrs()) { |
15 | 0 | EXPECTED_TRY(serializeInstruction(Instr, OutVec).map_error([](auto E) { |
16 | 0 | spdlog::error(ErrInfo::InfoAST(ASTNodeAttr::Expression)); |
17 | 0 | return E; |
18 | 0 | })); |
19 | 0 | } |
20 | 0 | return {}; |
21 | 0 | } |
22 | | |
23 | | } // namespace Loader |
24 | | } // namespace WasmEdge |