summaryrefslogtreecommitdiff
path: root/src/passes/OptimizeInstructions.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-12-05 13:09:21 -0600
committerGitHub <noreply@github.com>2019-12-05 13:09:21 -0600
commita28343a33ed28b4d5c83c37e350aceaf09b5246f (patch)
tree084a487cdf79e8025246d2a85d5578c113c9ad51 /src/passes/OptimizeInstructions.cpp
parentcbf121df96cfce5038f52ed04f9780e19ed3b762 (diff)
downloadbinaryen-a28343a33ed28b4d5c83c37e350aceaf09b5246f.tar.gz
binaryen-a28343a33ed28b4d5c83c37e350aceaf09b5246f.tar.bz2
binaryen-a28343a33ed28b4d5c83c37e350aceaf09b5246f.zip
Add string parameter to WASM_UNREACHABLE (#2499)
This works more like llvm's unreachable handler in that is preserves information even in release builds.
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
-rw-r--r--src/passes/OptimizeInstructions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index 64c49fc96..6de1d3d00 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -59,7 +59,7 @@ Index getMaxBits(Expression* curr, LocalInfoProvider* localInfoProvider) {
case i64:
return 64 - const_->value.countLeadingZeroes().geti64();
default:
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("invalid type");
}
} else if (auto* binary = curr->dynCast<Binary>()) {
switch (binary->op) {
@@ -186,7 +186,7 @@ Index getMaxBits(Expression* curr, LocalInfoProvider* localInfoProvider) {
case unreachable:
return 64; // not interesting, but don't crash
default:
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("invalid type");
}
}