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/dataflow | |
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/dataflow')
-rw-r--r-- | src/dataflow/graph.h | 4 | ||||
-rw-r--r-- | src/dataflow/node.h | 2 | ||||
-rw-r--r-- | src/dataflow/utils.h | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/dataflow/graph.h b/src/dataflow/graph.h index 2d9b87873..873c4f218 100644 --- a/src/dataflow/graph.h +++ b/src/dataflow/graph.h @@ -547,7 +547,7 @@ struct Graph : public UnifiedExpressionVisitor<Graph, Node*> { opposite = LeUInt64; break; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected op"); } auto* ret = visitBinary(builder.makeBinary(opposite, curr->right, curr->left)); @@ -783,7 +783,7 @@ struct Graph : public UnifiedExpressionVisitor<Graph, Node*> { // variable value. return Builder(*module).makeCall(FAKE_CALL, {}, node->wasmType); } else { - WASM_UNREACHABLE(); // TODO + WASM_UNREACHABLE("unexpected node type"); // TODO } } diff --git a/src/dataflow/node.h b/src/dataflow/node.h index 2966034ac..612a2f613 100644 --- a/src/dataflow/node.h +++ b/src/dataflow/node.h @@ -165,7 +165,7 @@ struct Node { case Bad: return unreachable; default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid node type"); } } diff --git a/src/dataflow/utils.h b/src/dataflow/utils.h index 2d32dbeac..436ccc4d8 100644 --- a/src/dataflow/utils.h +++ b/src/dataflow/utils.h @@ -67,8 +67,6 @@ inline std::ostream& dump(Node* node, std::ostream& o, size_t indent = 0) { case Node::Type::Bad: o << "bad"; break; - default: - WASM_UNREACHABLE(); } if (!node->values.empty()) { o << '\n'; |