Handle fallthrough, kill and nop in type determination.

These statements have no expressions to determine so they just return
true.

Bug: tint:5
Change-Id: I639bce9c254c12357ac3a1d2a9cfaaee437716c0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/18833
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair 2020-04-07 12:54:59 +00:00 committed by dan sinclair
parent 0cf685f728
commit 1913fc9d3b
1 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,15 @@ bool TypeDeterminer::DetermineResultType(ast::Statement* stmt) {
return DetermineResultType(e->condition()) &&
DetermineResultType(e->body());
}
if (stmt->IsFallthrough()) {
return true;
}
if (stmt->IsKill()) {
return true;
}
if (stmt->IsNop()) {
return true;
}
error_ = "unknown statement type for type determination";
return false;