ast: Remove statement constructors that don't take a Source
Parsers need fixing up.
Bug: tint:396
Bug: tint:390
Change-Id: I137f1017ca56125cf3d52ecbef2ff46d0574338b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35161
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/src/writer/hlsl/generator_impl_if_test.cc b/src/writer/hlsl/generator_impl_if_test.cc
index 6da8512..664a76a 100644
--- a/src/writer/hlsl/generator_impl_if_test.cc
+++ b/src/writer/hlsl/generator_impl_if_test.cc
@@ -29,7 +29,7 @@
TEST_F(HlslGeneratorImplTest_If, Emit_If) {
auto* cond = create<ast::IdentifierExpression>(
Source{}, mod.RegisterSymbol("cond"), "cond");
- auto* body = create<ast::BlockStatement>();
+ auto* body = create<ast::BlockStatement>(Source{});
body->append(create<ast::ReturnStatement>(Source{}));
ast::IfStatement i(Source{}, cond, body, ast::ElseStatementList{});
@@ -45,16 +45,17 @@
TEST_F(HlslGeneratorImplTest_If, Emit_IfWithElseIf) {
auto* else_cond = create<ast::IdentifierExpression>(
Source{}, mod.RegisterSymbol("else_cond"), "else_cond");
- auto* else_body = create<ast::BlockStatement>();
+ auto* else_body = create<ast::BlockStatement>(Source{});
else_body->append(create<ast::ReturnStatement>(Source{}));
auto* cond = create<ast::IdentifierExpression>(
Source{}, mod.RegisterSymbol("cond"), "cond");
- auto* body = create<ast::BlockStatement>();
+ auto* body = create<ast::BlockStatement>(Source{});
body->append(create<ast::ReturnStatement>(Source{}));
- ast::IfStatement i(Source{}, cond, body,
- {create<ast::ElseStatement>(else_cond, else_body)});
+ ast::IfStatement i(
+ Source{}, cond, body,
+ {create<ast::ElseStatement>(Source{}, else_cond, else_body)});
gen.increment_indent();
@@ -70,16 +71,17 @@
}
TEST_F(HlslGeneratorImplTest_If, Emit_IfWithElse) {
- auto* else_body = create<ast::BlockStatement>();
+ auto* else_body = create<ast::BlockStatement>(Source{});
else_body->append(create<ast::ReturnStatement>(Source{}));
auto* cond = create<ast::IdentifierExpression>(
Source{}, mod.RegisterSymbol("cond"), "cond");
- auto* body = create<ast::BlockStatement>();
+ auto* body = create<ast::BlockStatement>(Source{});
body->append(create<ast::ReturnStatement>(Source{}));
- ast::IfStatement i(Source{}, cond, body,
- {create<ast::ElseStatement>(else_body)});
+ ast::IfStatement i(
+ Source{}, cond, body,
+ {create<ast::ElseStatement>(Source{}, nullptr, else_body)});
gen.increment_indent();
@@ -96,22 +98,23 @@
auto* else_cond = create<ast::IdentifierExpression>(
Source{}, mod.RegisterSymbol("else_cond"), "else_cond");
- auto* else_body = create<ast::BlockStatement>();
+ auto* else_body = create<ast::BlockStatement>(Source{});
else_body->append(create<ast::ReturnStatement>(Source{}));
- auto* else_body_2 = create<ast::BlockStatement>();
+ auto* else_body_2 = create<ast::BlockStatement>(Source{});
else_body_2->append(create<ast::ReturnStatement>(Source{}));
auto* cond = create<ast::IdentifierExpression>(
Source{}, mod.RegisterSymbol("cond"), "cond");
- auto* body = create<ast::BlockStatement>();
+ auto* body = create<ast::BlockStatement>(Source{});
body->append(create<ast::ReturnStatement>(Source{}));
- ast::IfStatement i(Source{}, cond, body,
- {
- create<ast::ElseStatement>(else_cond, else_body),
- create<ast::ElseStatement>(else_body_2),
- });
+ ast::IfStatement i(
+ Source{}, cond, body,
+ {
+ create<ast::ElseStatement>(Source{}, else_cond, else_body),
+ create<ast::ElseStatement>(Source{}, nullptr, else_body_2),
+ });
gen.increment_indent();