Convert vectors to list aliases
This CL converts a few more std::vector<std::unique_ptr<foo>>'s to
FooList aliases.
Change-Id: If0dd672f11beaeabd9e89e82903c2174b11be6e1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19103
Reviewed-by: David Neto <dneto@google.com>
diff --git a/src/reader/spirv/function.cc b/src/reader/spirv/function.cc
index 94520c4..97626f8 100644
--- a/src/reader/spirv/function.cc
+++ b/src/reader/spirv/function.cc
@@ -92,7 +92,7 @@
<< function_.result_id();
}
- std::vector<std::unique_ptr<ast::Variable>> ast_params;
+ ast::VariableList ast_params;
function_.ForEachParam(
[this, &ast_params](const spvtools::opt::Instruction* param) {
auto* ast_type = parser_impl_.ConvertType(param->type_id());
diff --git a/src/reader/spirv/function.h b/src/reader/spirv/function.h
index 9e6a809..2b7e58d 100644
--- a/src/reader/spirv/function.h
+++ b/src/reader/spirv/function.h
@@ -53,9 +53,7 @@
bool failed() const { return !success(); }
/// @returns the body of the function.
- const std::vector<std::unique_ptr<ast::Statement>>& ast_body() {
- return ast_body_;
- }
+ const ast::StatementList& ast_body() { return ast_body_; }
/// Records failure.
/// @returns a FailStream on which to emit diagnostics.
@@ -91,7 +89,7 @@
FailStream& fail_stream_;
Namer& namer_;
const spvtools::opt::Function& function_;
- std::vector<std::unique_ptr<ast::Statement>> ast_body_;
+ ast::StatementList ast_body_;
};
} // namespace spirv
diff --git a/src/reader/spirv/parser_impl_test_helper.h b/src/reader/spirv/parser_impl_test_helper.h
index 7c5f15f..e6cb026 100644
--- a/src/reader/spirv/parser_impl_test_helper.h
+++ b/src/reader/spirv/parser_impl_test_helper.h
@@ -66,8 +66,7 @@
/// Returns the string dump of a function body.
/// @param body the statement in the body
/// @returnss the string dump of a function body.
-inline std::string ToString(
- const std::vector<std::unique_ptr<ast::Statement>>& body) {
+inline std::string ToString(const ast::StatementList& body) {
std::ostringstream outs;
for (const auto& stmt : body) {
stmt->to_str(outs, 0);