summaryrefslogtreecommitdiff
path: root/src/passes/Print.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/passes/Print.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/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index e35d9b57e..a8d9383bf 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -205,7 +205,7 @@ struct PrintExpressionContents
} else if (bytes == 4) {
o << "32";
} else {
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("invalid RMW byte length");
}
}
o << '.';
@@ -757,7 +757,7 @@ struct PrintExpressionContents
o << "i32x4.widen_high_i16x8_u";
break;
case InvalidUnary:
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("unvalid unary operator");
}
}
void visitBinary(Binary* curr) {
@@ -1287,7 +1287,7 @@ struct PrintExpressionContents
break;
case InvalidBinary:
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("unvalid binary operator");
}
restoreNormalColor(o);
}
@@ -1901,7 +1901,7 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> {
o << "event";
break;
case ExternalKind::Invalid:
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("invalid ExternalKind");
}
o << ' ';
printName(curr->value, o) << "))";
@@ -2389,7 +2389,7 @@ WasmPrinter::printStackInst(StackInst* inst, std::ostream& o, Function* func) {
break;
}
default:
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("unexpeted op");
}
return o;
}
@@ -2446,7 +2446,7 @@ WasmPrinter::printStackIR(StackIR* ir, std::ostream& o, Function* func) {
break;
}
default:
- WASM_UNREACHABLE();
+ WASM_UNREACHABLE("unexpeted op");
}
std::cout << '\n';
}