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/DataFlowOpts.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/passes/DataFlowOpts.cpp') diff --git a/src/passes/DataFlowOpts.cpp b/src/passes/DataFlowOpts.cpp index dc8f6ca94..d4a3cc087 100644 --- a/src/passes/DataFlowOpts.cpp +++ b/src/passes/DataFlowOpts.cpp @@ -215,7 +215,7 @@ struct DataFlowOpts : public WalkerPass> { break; } default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected dataflow node type"); } } // No one is a user of this node after we replaced all the uses. @@ -234,9 +234,8 @@ struct DataFlowOpts : public WalkerPass> { return &binary->left; } else if (index == 1) { return &binary->right; - } else { - WASM_UNREACHABLE(); } + WASM_UNREACHABLE("unexpected index"); } else if (auto* select = expr->dynCast