From 0613890eedd7e0226d917e8e5a2a660cd36de0ec Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 16 Nov 2020 16:24:37 +0000 Subject: [PATCH] Replace remaining std::make_unique -> create for ast::Nodes create() is currently just a simple forwarder to std::make_unique<>, but will be later replaced with a function that returns a raw pointer, and owned by the context. Bug: tint:322 Change-Id: I9d85e925538789d9b58f32c2bba32a05e22aea1c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32863 Commit-Queue: Ben Clayton Reviewed-by: dan sinclair --- src/ast/builder.cc | 2 +- src/writer/spirv/builder_if_test.cc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ast/builder.cc b/src/ast/builder.cc index 957ce17c9b..fce7b913ba 100644 --- a/src/ast/builder.cc +++ b/src/ast/builder.cc @@ -26,7 +26,7 @@ Builder::~Builder() = default; std::unique_ptr Builder::make_var(const std::string& name, ast::StorageClass storage, ast::type::Type* type) { - auto var = std::make_unique(name, storage, type); + auto var = create(name, storage, type); return var; } diff --git a/src/writer/spirv/builder_if_test.cc b/src/writer/spirv/builder_if_test.cc index e86a6ac4fd..0842d76e2c 100644 --- a/src/writer/spirv/builder_if_test.cc +++ b/src/writer/spirv/builder_if_test.cc @@ -618,12 +618,12 @@ TEST_F(BuilderTest, If_WithLoad_Bug327) { // } ast::type::BoolType bool_type; - auto var = std::make_unique("a", ast::StorageClass::kFunction, - &bool_type); + auto var = + create("a", ast::StorageClass::kFunction, &bool_type); td.RegisterVariableForTesting(var.get()); - ast::IfStatement expr(std::make_unique("a"), - std::make_unique()); + ast::IfStatement expr(create("a"), + create()); ASSERT_TRUE(td.DetermineResultType(&expr)) << td.error();