Skip to content

Commit 99230c8

Browse files
committed
docs
1 parent 3ffd775 commit 99230c8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/utils/wasm_engine.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,19 @@ class WasmEngine
6161
virtual Result execute(FuncRef func_ref, const std::vector<uint64_t>& args) = 0;
6262
};
6363

64+
/// Throws exception if the signature is non-conformant.
65+
///
66+
/// A function signature consist of input and output types delimited by a colon. Zero number of
67+
/// types is allowed. A type is represented with a single character, where `i` means i32, and
68+
/// `I` means i64.
69+
///
70+
/// As an example `iI:i` translates to `(i32, i64) -> (i32)`, `I:` to `(i64) -> void`, etc.
6471
void validate_function_signature(std::string_view signature);
6572

73+
/// Parses a validated signature and returns a pair of input and output type vectors of type
74+
/// `ValueType`.
75+
///
76+
/// Note that calling `validate_function_signature` first is advised for better error reporting.
6677
template <typename ValueType, ValueType i32_type, ValueType i64_type>
6778
std::pair<std::vector<ValueType>, std::vector<ValueType>> translate_function_signature(
6879
std::string_view signature)

0 commit comments

Comments
 (0)