From d5dea224e09ff598436753154e26222100b7aed9 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 8 Apr 2020 19:58:28 +0000 Subject: [PATCH] Convert vectors to list aliases This CL converts a few more std::vector>'s to FooList aliases. Change-Id: If0dd672f11beaeabd9e89e82903c2174b11be6e1 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19103 Reviewed-by: David Neto --- src/reader/spirv/function.cc | 2 +- src/reader/spirv/function.h | 6 ++---- src/reader/spirv/parser_impl_test_helper.h | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/reader/spirv/function.cc b/src/reader/spirv/function.cc index 94520c48b7..97626f884a 100644 --- a/src/reader/spirv/function.cc +++ b/src/reader/spirv/function.cc @@ -92,7 +92,7 @@ bool FunctionEmitter::EmitFunctionDeclaration() { << function_.result_id(); } - std::vector> 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 9e6a809e37..2b7e58de3a 100644 --- a/src/reader/spirv/function.h +++ b/src/reader/spirv/function.h @@ -53,9 +53,7 @@ class FunctionEmitter { bool failed() const { return !success(); } /// @returns the body of the function. - const std::vector>& 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 @@ class FunctionEmitter { FailStream& fail_stream_; Namer& namer_; const spvtools::opt::Function& function_; - std::vector> 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 7c5f15f60c..e6cb026baa 100644 --- a/src/reader/spirv/parser_impl_test_helper.h +++ b/src/reader/spirv/parser_impl_test_helper.h @@ -66,8 +66,7 @@ class SpvParserTest : public testing::Test { /// 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>& body) { +inline std::string ToString(const ast::StatementList& body) { std::ostringstream outs; for (const auto& stmt : body) { stmt->to_str(outs, 0);