ast: Remove no-arg constructor for ast::LoopStatement

In a near-future change, AST nodes, such as ast::BlockStatement will no longer
be std::unique_ptrs, and will have to be constructed and owned by an external
class. This means AST nodes can no longer allocate default child nodes.

Bug: tint:322
Change-Id: I3db9b3c037896f07b84b14b7b8d4da0f066b69b0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32679
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2020-11-14 09:52:25 +00:00
committed by Commit Bot service account
parent b29b09fba6
commit 6a788df30e
5 changed files with 7 additions and 10 deletions

View File

@@ -2207,7 +2207,10 @@ bool FunctionEmitter::EmitSwitchStart(const BlockInfo& block_info) {
}
bool FunctionEmitter::EmitLoopStart(const Construct* construct) {
auto* loop = AddStatement(std::make_unique<ast::LoopStatement>())->AsLoop();
auto* loop = AddStatement(std::make_unique<ast::LoopStatement>(
std::make_unique<ast::BlockStatement>(),
std::make_unique<ast::BlockStatement>()))
->AsLoop();
PushNewStatementBlock(
construct, construct->end_id,
[loop](StatementBlock* s) { loop->set_body(std::move(s->statements_)); });