validator: add IsStorable helper function

Bug: tint:419
Change-Id: Ib15aa819a032d8412fb3bc162b29a02c331f56b8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37960
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: David Neto <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
This commit is contained in:
David Neto
2021-01-18 19:45:24 +00:00
committed by Commit Bot service account
parent d7335fa974
commit 20f4d1daca
3 changed files with 115 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "src/ast/assignment_statement.h"
@@ -147,6 +148,12 @@ class ValidatorImpl {
bool ValidateConstructedTypes(
const std::vector<ast::type::Type*>& constructed_types);
/// Returns true if the given type is storable. This uses and
/// updates `storable_` and `not_storable_`.
/// @param type the given type
/// @returns true if the given type is storable.
bool IsStorable(ast::type::Type* type);
private:
const ast::Module& module_;
diag::List diags_;