diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2018-11-27 15:12:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 15:12:21 -0800 |
commit | 5d92d866d8326b1908328485cccd2f8ebe57ac75 (patch) | |
tree | 6f34e8815437b66c0ee083a61c1147a4257b68c6 /src/ir/ExpressionAnalyzer.cpp | |
parent | 70b949ffdc3e5f3fa83dd4044f632c95159674cf (diff) | |
download | binaryen-5d92d866d8326b1908328485cccd2f8ebe57ac75.tar.gz binaryen-5d92d866d8326b1908328485cccd2f8ebe57ac75.tar.bz2 binaryen-5d92d866d8326b1908328485cccd2f8ebe57ac75.zip |
Remove default cases (#1757)
Where reasonable from a readability perspective, remove default cases
in switches over types and instructions. This makes future feature
additions easier by making the compiler complain about each location
where new types and instructions are not yet handled.
Diffstat (limited to 'src/ir/ExpressionAnalyzer.cpp')
-rw-r--r-- | src/ir/ExpressionAnalyzer.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ir/ExpressionAnalyzer.cpp b/src/ir/ExpressionAnalyzer.cpp index f9b981129..7788f7cde 100644 --- a/src/ir/ExpressionAnalyzer.cpp +++ b/src/ir/ExpressionAnalyzer.cpp @@ -294,7 +294,10 @@ bool ExpressionAnalyzer::flexibleEqual(Expression* left, Expression* right, Expr case Expression::Id::UnreachableId: { break; } - default: WASM_UNREACHABLE(); + case Expression::Id::InvalidId: + case Expression::Id::NumExpressionIds: { + WASM_UNREACHABLE(); + } } #undef CHECK #undef PUSH @@ -544,7 +547,10 @@ HashType ExpressionAnalyzer::hash(Expression* curr) { case Expression::Id::UnreachableId: { break; } - default: WASM_UNREACHABLE(); + case Expression::Id::InvalidId: + case Expression::Id::NumExpressionIds: { + WASM_UNREACHABLE(); + } } #undef HASH #undef PUSH |