mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
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:
committed by
Commit Bot service account
parent
b29b09fba6
commit
6a788df30e
@@ -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_)); });
|
||||
|
||||
Reference in New Issue
Block a user