Index: src/wasm/wasm-opcodes.cc |
diff --git a/src/wasm/wasm-opcodes.cc b/src/wasm/wasm-opcodes.cc |
index 8336e2dea083f0858640b8ad69c9757d12a7ffec..152162d32c45fa9dd0b8dba3fcbef0e3ff597636 100644 |
--- a/src/wasm/wasm-opcodes.cc |
+++ b/src/wasm/wasm-opcodes.cc |
@@ -25,6 +25,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"; |