summaryrefslogtreecommitdiff
path: root/src/tools/wasm-reduce.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-12-05 13:09:21 -0600
committerGitHub <noreply@github.com>2019-12-05 13:09:21 -0600
commita28343a33ed28b4d5c83c37e350aceaf09b5246f (patch)
tree084a487cdf79e8025246d2a85d5578c113c9ad51 /src/tools/wasm-reduce.cpp
parentcbf121df96cfce5038f52ed04f9780e19ed3b762 (diff)
downloadbinaryen-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/tools/wasm-reduce.cpp')
-rw-r--r--src/tools/wasm-reduce.cpp18
1 files changed, 9 insertions, 9 deletions
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)) {