Index: src/wasm/wasm-opcodes.cc |
diff --git a/src/wasm/wasm-opcodes.cc b/src/wasm/wasm-opcodes.cc |
index 736c4d960926bdedd1ef144b2d9b77660d484b19..8b79b0cd69c78f8b8bab63b9d350f419741fec44 100644 |
--- a/src/wasm/wasm-opcodes.cc |
+++ b/src/wasm/wasm-opcodes.cc |
@@ -24,6 +24,18 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) { |
return "Unknown"; |
} |
+const char* WasmOpcodes::ShortOpcodeName(WasmOpcode opcode) { |
+ switch (opcode) { |
+#define DECLARE_NAME_CASE(name, opcode, sig) \ |
+ case kExpr##name: \ |
+ return #name; |
+ FOREACH_OPCODE(DECLARE_NAME_CASE) |
+#undef DECLARE_NAME_CASE |
+ default: |
+ break; |
+ } |
+ return "Unknown"; |
+} |
std::ostream& operator<<(std::ostream& os, const FunctionSig& sig) { |
if (sig.return_count() == 0) os << "v"; |