reader/spirv: Don't create disjoint AST nodes

This is a waste of memory, and now fires a TINT_ASSERT() in the resolver.

Add some more information to the resolver assertion message so that its easier to identify the node. This is especially useful when there's no source information available.

Fixed: tint:740
Bug: tint:469
Change-Id: I0cd4529db7b3906e64da6ed7290163509eb0c3f2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48689
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-04-23 18:19:54 +00:00
committed by Commit Bot service account
parent ab215981fe
commit b205b872ae
3 changed files with 43 additions and 24 deletions

View File

@@ -272,7 +272,8 @@ bool Resolver::ResolveInternal() {
}
TINT_ICE(diagnostics_) << "AST node '" << node->TypeInfo().name
<< "' was not reached by the resolver\n"
<< "At: " << node->source();
<< "At: " << node->source() << "\n"
<< "Content: " << builder_->str(node);
}
}