mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
ast: Add body parameter to ast::Function constructors
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: Iddb5605b9bc0de80ad2710ced0e429f89410af2f Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32675 Commit-Queue: dan sinclair <dsinclair@chromium.org> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
9a31c641e2
commit
b29b09fba6
@@ -646,7 +646,8 @@ bool FunctionEmitter::EmitFunctionDeclaration() {
|
||||
}
|
||||
|
||||
auto ast_fn =
|
||||
std::make_unique<ast::Function>(name, std::move(ast_params), ret_ty);
|
||||
std::make_unique<ast::Function>(name, std::move(ast_params), ret_ty,
|
||||
std::make_unique<ast::BlockStatement>());
|
||||
|
||||
if (ep_info_ != nullptr) {
|
||||
ast_fn->add_decoration(
|
||||
|
||||
@@ -1231,8 +1231,9 @@ Maybe<std::unique_ptr<ast::Function>> ParserImpl::function_header() {
|
||||
if (errored)
|
||||
return Failure::kErrored;
|
||||
|
||||
return std::make_unique<ast::Function>(source, name.value,
|
||||
std::move(params.value), type.value);
|
||||
return std::make_unique<ast::Function>(
|
||||
source, name.value, std::move(params.value), type.value,
|
||||
std::make_unique<ast::BlockStatement>());
|
||||
}
|
||||
|
||||
// param_list
|
||||
|
||||
Reference in New Issue
Block a user