From a28343a33ed28b4d5c83c37e350aceaf09b5246f Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 5 Dec 2019 13:09:21 -0600 Subject: Add string parameter to WASM_UNREACHABLE (#2499) This works more like llvm's unreachable handler in that is preserves information even in release builds. --- src/tools/wasm-reduce.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/tools/wasm-reduce.cpp') diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 0fe15b444..3e1e464f8 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -581,7 +581,7 @@ struct Reducer case i32: { switch (child->type) { case i32: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); case i64: fixed = builder->makeUnary(WrapInt64, child); break; @@ -597,7 +597,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -607,7 +607,7 @@ struct Reducer fixed = builder->makeUnary(ExtendSInt32, child); break; case i64: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); case f32: fixed = builder->makeUnary(TruncSFloat32ToInt64, child); break; @@ -620,7 +620,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -633,7 +633,7 @@ struct Reducer fixed = builder->makeUnary(ConvertSInt64ToFloat32, child); break; case f32: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); case f64: fixed = builder->makeUnary(DemoteFloat64, child); break; @@ -643,7 +643,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -659,14 +659,14 @@ struct Reducer fixed = builder->makeUnary(PromoteFloat32, child); break; case f64: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); case v128: case anyref: case exnref: continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } break; } @@ -676,7 +676,7 @@ struct Reducer continue; // not implemented yet case none: case unreachable: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } assert(fixed->type == curr->type); if (tryToReplaceCurrent(fixed)) { -- cgit v1.2.3