summaryrefslogtreecommitdiff
path: root/src/tools/spec-wrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/spec-wrapper.h')
-rw-r--r--src/tools/spec-wrapper.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/tools/spec-wrapper.h b/src/tools/spec-wrapper.h
index 77db8a0f4..516ce17a9 100644
--- a/src/tools/spec-wrapper.h
+++ b/src/tools/spec-wrapper.h
@@ -25,18 +25,31 @@ static std::string generateSpecWrapper(Module& wasm) {
std::string ret;
for (auto& exp : wasm.exports) {
auto* func = wasm.getFunctionOrNull(exp->value);
- if (!func) continue; // something exported other than a function
- ret += std::string("(invoke \"hangLimitInitializer\") (invoke \"") + exp->name.str + "\" ";
+ if (!func)
+ continue; // something exported other than a function
+ ret += std::string("(invoke \"hangLimitInitializer\") (invoke \"") +
+ exp->name.str + "\" ";
for (Type param : func->params) {
// zeros in arguments TODO more?
switch (param) {
- case i32: ret += "(i32.const 0)"; break;
- case i64: ret += "(i64.const 0)"; break;
- case f32: ret += "(f32.const 0)"; break;
- case f64: ret += "(f64.const 0)"; break;
- case v128: ret += "(v128.const i32x4 0 0 0 0)"; break;
+ case i32:
+ ret += "(i32.const 0)";
+ break;
+ case i64:
+ ret += "(i64.const 0)";
+ break;
+ case f32:
+ ret += "(f32.const 0)";
+ break;
+ case f64:
+ ret += "(f64.const 0)";
+ break;
+ case v128:
+ ret += "(v128.const i32x4 0 0 0 0)";
+ break;
case none:
- case unreachable: WASM_UNREACHABLE();
+ case unreachable:
+ WASM_UNREACHABLE();
}
ret += " ";
}