ICE macros: Use '<<' for error message

Lessens the friction of using these macros.
Also allows you to add a message to TINT_UNREACHABLE(), which you couldn't do before.

Change-Id: Ida4d63ec96e1d99af71503e8b80d7a5a712e6a47
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/42020
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2021-02-18 16:33:38 +00:00
committed by Commit Bot service account
parent 41085503e1
commit 3a9a55eec6
8 changed files with 78 additions and 48 deletions

View File

@@ -57,9 +57,8 @@ void Hlsl::PromoteArrayInitializerToConstVar(CloneContext& ctx) const {
if (auto* src_init = src_node->As<ast::TypeConstructorExpression>()) {
auto* src_sem_expr = ctx.src->Sem().Get(src_init);
if (!src_sem_expr) {
TINT_ICE(
ctx.dst->Diagnostics(),
"ast::TypeConstructorExpression has no semantic expression node");
TINT_ICE(ctx.dst->Diagnostics())
<< "ast::TypeConstructorExpression has no semantic expression node";
continue;
}
auto* src_sem_stmt = src_sem_expr->Stmt();