Index: src/wasm/wasm-opcodes.cc |
diff --git a/src/wasm/wasm-opcodes.cc b/src/wasm/wasm-opcodes.cc |
index 25eef034d7f3e7b86d6d9c78d52b14fdc83c38c9..a609e032611ce8633ee5c148882dfb0df9503e50 100644 |
--- a/src/wasm/wasm-opcodes.cc |
+++ b/src/wasm/wasm-opcodes.cc |
@@ -25,6 +25,20 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) { |
} |
+std::ostream& operator<<(std::ostream& os, const FunctionSig& sig) { |
+ if (sig.return_count() == 0) os << "v"; |
+ for (size_t i = 0; i < sig.return_count(); i++) { |
+ os << WasmOpcodes::ShortNameOf(sig.GetReturn(i)); |
+ } |
+ os << "_"; |
+ if (sig.parameter_count() == 0) os << "v"; |
+ for (size_t i = 0; i < sig.parameter_count(); i++) { |
+ os << WasmOpcodes::ShortNameOf(sig.GetParam(i)); |
+ } |
+ return os; |
+} |
+ |
+ |
#define DECLARE_SIG_ENUM(name, ...) kSigEnum_##name, |