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/wasm/wasm.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/wasm/wasm.cpp')
-rw-r--r-- | src/wasm/wasm.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 72fc3b202..1554ded62 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -102,8 +102,9 @@ const char* getExpressionName(Expression* curr) { case Expression::Id::AtomicRMWId: return "atomic_rmw"; case Expression::Id::AtomicWaitId: return "atomic_wait"; case Expression::Id::AtomicWakeId: return "atomic_wake"; - default: WASM_UNREACHABLE(); + case Expression::Id::NumExpressionIds: WASM_UNREACHABLE(); } + WASM_UNREACHABLE(); } // core AST type checking @@ -480,7 +481,7 @@ void Unary::finalize() { case ConvertUInt32ToFloat64: case ConvertSInt64ToFloat64: case ConvertUInt64ToFloat64: type = f64; break; - default: std::cerr << "waka " << op << '\n'; WASM_UNREACHABLE(); + case InvalidUnary: WASM_UNREACHABLE(); } } @@ -565,7 +566,6 @@ void Host::finalize() { } break; } - default: WASM_UNREACHABLE(); } } |