diff options
author | Sam Clegg <sbc@chromium.org> | 2019-12-05 13:09:21 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-05 13:09:21 -0600 |
commit | a28343a33ed28b4d5c83c37e350aceaf09b5246f (patch) | |
tree | 084a487cdf79e8025246d2a85d5578c113c9ad51 /src/passes/Souperify.cpp | |
parent | cbf121df96cfce5038f52ed04f9780e19ed3b762 (diff) | |
download | binaryen-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/Souperify.cpp')
-rw-r--r-- | src/passes/Souperify.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/passes/Souperify.cpp b/src/passes/Souperify.cpp index c5dca51fa..fb0a9d7b9 100644 --- a/src/passes/Souperify.cpp +++ b/src/passes/Souperify.cpp @@ -308,7 +308,7 @@ struct Trace { return nullptr; } default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected node type"); } // Assert on no cycles assert(addedNodes.find(node) == addedNodes.end()); @@ -344,7 +344,7 @@ struct Trace { } else if (curr == iff->ifFalse) { index = 1; } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid expr"); } auto* condition = conditions[index]; // Add the condition itself as an instruction in the trace - @@ -353,7 +353,7 @@ struct Trace { // Add it as a pc, which we will emit directly. pathConditions.push_back(condition); } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid expr"); } } @@ -501,11 +501,10 @@ struct Printer { break; } case Node::Type::Bad: { - std::cout << "!!!BAD!!!"; - WASM_UNREACHABLE(); + WASM_UNREACHABLE("!!!BAD!!!"); } default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpted type"); } if (node->isExpr() || node->isPhi()) { if (node->origin != trace.toInfer->origin && @@ -557,7 +556,7 @@ struct Printer { std::cout << "ctpop"; break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid op"); } std::cout << ' '; auto* value = node->getValue(0); @@ -649,7 +648,7 @@ struct Printer { std::cout << "ule"; break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid op"); } std::cout << ' '; auto* left = node->getValue(0); @@ -665,7 +664,7 @@ struct Printer { std::cout << ", "; printInternal(node->getValue(2)); } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexecpted node type"); } } |