Replace all uses of assert() with TINT_ICE macros

Use TINT_ICE() where we have diagnostics, TINT_ASSERT() where we do not.

Change-Id: Ic6e842a7afdd957654c3461e5d03ecec7332e6f9
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/46444
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton
2021-03-31 20:43:26 +00:00
committed by Commit Bot service account
parent dba65b7a34
commit 90f43cf87f
23 changed files with 118 additions and 84 deletions

View File

@@ -55,7 +55,10 @@ Module* Module::Clone(CloneContext* ctx) const {
void Module::Copy(CloneContext* ctx, const Module* src) {
for (auto* decl : ctx->Clone(src->global_declarations_)) {
assert(decl);
if (!decl) {
TINT_ICE(ctx->dst->Diagnostics()) << "src global declaration was nullptr";
continue;
}
if (auto* ty = decl->As<type::Type>()) {
AddConstructedType(ty);
} else if (auto* func = decl->As<Function>()) {