diff --git a/src/tint/resolver/resolver_test_helper.h b/src/tint/resolver/resolver_test_helper.h index 1afa838ef5..ac1b9e7121 100644 --- a/src/tint/resolver/resolver_test_helper.h +++ b/src/tint/resolver/resolver_test_helper.h @@ -97,11 +97,11 @@ class TestHelper : public ProgramBuilder { /// @return true if all users are as expected bool CheckVarUsers(const ast::Variable* var, utils::VectorRef expected_users) { - auto& var_users = Sem().Get(var)->Users(); - if (var_users.size() != expected_users.Length()) { + auto var_users = Sem().Get(var)->Users(); + if (var_users.Length() != expected_users.Length()) { return false; } - for (size_t i = 0; i < var_users.size(); i++) { + for (size_t i = 0; i < var_users.Length(); i++) { if (var_users[i]->Declaration() != expected_users[i]) { return false; } diff --git a/src/tint/sem/variable.h b/src/tint/sem/variable.h index 647a77b13c..7e70ca3d78 100644 --- a/src/tint/sem/variable.h +++ b/src/tint/sem/variable.h @@ -91,10 +91,10 @@ class Variable : public Castable { void SetInitializer(const ValueExpression* initializer) { initializer_ = initializer; } /// @returns the expressions that use the variable - const std::vector& Users() const { return users_; } + utils::VectorRef Users() const { return users_; } /// @param user the user to add - void AddUser(const VariableUser* user) { users_.emplace_back(user); } + void AddUser(const VariableUser* user) { users_.Push(user); } private: const ast::Variable* const declaration_; @@ -104,7 +104,7 @@ class Variable : public Castable { const builtin::Access access_; const constant::Value* constant_value_; const ValueExpression* initializer_ = nullptr; - std::vector users_; + utils::Vector users_; }; /// LocalVariable is a function-scope variable