Add continue statement type determination.
This CL adds type determination for the continue statement.
Bug: tint:5
Change-Id: Ie63994146978d8783f131299b576fc46a10878ad
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/18831
Reviewed-by: David Neto <dneto@google.com>
diff --git a/src/type_determiner.cc b/src/type_determiner.cc
index 8418998..2e8ffbd 100644
--- a/src/type_determiner.cc
+++ b/src/type_determiner.cc
@@ -17,6 +17,7 @@
#include "src/ast/assignment_statement.h"
#include "src/ast/break_statement.h"
#include "src/ast/case_statement.h"
+#include "src/ast/continue_statement.h"
#include "src/ast/scalar_constructor_expression.h"
#include "src/ast/type_constructor_expression.h"
@@ -85,6 +86,10 @@
auto c = stmt->AsCase();
return DetermineResultType(c->body());
}
+ if (stmt->IsContinue()) {
+ auto c = stmt->AsContinue();
+ return DetermineResultType(c->conditional());
+ }
error_ = "unknown statement type for type determination";
return false;