From a28343a33ed28b4d5c83c37e350aceaf09b5246f Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 5 Dec 2019 13:09:21 -0600 Subject: Add string parameter to WASM_UNREACHABLE (#2499) This works more like llvm's unreachable handler in that is preserves information even in release builds. --- src/passes/Print.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index e35d9b57e..a8d9383bf 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -205,7 +205,7 @@ struct PrintExpressionContents } else if (bytes == 4) { o << "32"; } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid RMW byte length"); } } o << '.'; @@ -757,7 +757,7 @@ struct PrintExpressionContents o << "i32x4.widen_high_i16x8_u"; break; case InvalidUnary: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unvalid unary operator"); } } void visitBinary(Binary* curr) { @@ -1287,7 +1287,7 @@ struct PrintExpressionContents break; case InvalidBinary: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unvalid binary operator"); } restoreNormalColor(o); } @@ -1901,7 +1901,7 @@ struct PrintSExpression : public OverriddenVisitor { o << "event"; break; case ExternalKind::Invalid: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid ExternalKind"); } o << ' '; printName(curr->value, o) << "))"; @@ -2389,7 +2389,7 @@ WasmPrinter::printStackInst(StackInst* inst, std::ostream& o, Function* func) { break; } default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpeted op"); } return o; } @@ -2446,7 +2446,7 @@ WasmPrinter::printStackIR(StackIR* ir, std::ostream& o, Function* func) { break; } default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpeted op"); } std::cout << '\n'; } -- cgit v1.2.3