From 5d92d866d8326b1908328485cccd2f8ebe57ac75 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Tue, 27 Nov 2018 15:12:21 -0800 Subject: 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. --- src/ir/ExpressionAnalyzer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ir/ExpressionAnalyzer.cpp') 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 -- cgit v1.2.3