From 98432956087f564dd39fe8d76aa6bc5fc09e079b Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Thu, 3 Jan 2019 22:59:59 +0000 Subject: [WebAssembly] Made InstPrinter more robust Summary: Instead of asserting on certain kinds of malformed instructions, it now still print, but instead adds an annotation indicating the problem, and/or indicates invalid_type etc. We're using the InstPrinter from many contexts that can't always guarantee values are within range (e.g. the disassembler), where having output is more valueable than asserting. Reviewers: dschuff, aheejin Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D56223 llvm-svn: 350365 --- llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h') diff --git a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h index fd968bc9ea3..5ad45c7d5c7 100644 --- a/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h +++ b/llvm/lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.h @@ -56,7 +56,8 @@ public: namespace WebAssembly { -const char *TypeToString(wasm::ValType Ty); +const char *typeToString(wasm::ValType Ty); +const char *anyTypeToString(unsigned Ty); } // end namespace WebAssembly -- cgit v1.2.3