Remove sem::AccessControl
In preparation for implementing
https://github.com/gpuweb/gpuweb/issues/1604, this change removes the
sem::AccessControl node. Instead, the ast::AccessControl::Access enum is
now on the sem::StorageTexture class, as well as on sem::Variable. For
sem::Variable, the field is set when the variable's type is either a
storage buffer or a storage texture.
Bug: tint:802
Change-Id: Id479af36b401d067b015027923f4e715f5f69f25
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51020
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/sem/variable.h b/src/sem/variable.h
index ba6118f..49f2340 100644
--- a/src/sem/variable.h
+++ b/src/sem/variable.h
@@ -17,6 +17,7 @@
#include <vector>
+#include "src/ast/access_control.h"
#include "src/ast/storage_class.h"
#include "src/sem/expression.h"
@@ -41,9 +42,11 @@
/// @param declaration the AST declaration node
/// @param type the variable type
/// @param storage_class the variable storage class
+ /// @param access_control the variable access control type
Variable(const ast::Variable* declaration,
const sem::Type* type,
- ast::StorageClass storage_class);
+ ast::StorageClass storage_class,
+ ast::AccessControl::Access access_control);
/// Constructor for overridable pipeline constants
/// @param declaration the AST declaration node
@@ -65,6 +68,9 @@
/// @returns the storage class for the variable
ast::StorageClass StorageClass() const { return storage_class_; }
+ /// @returns the access control for the variable
+ ast::AccessControl::Access AccessControl() const { return access_control_; }
+
/// @returns the expressions that use the variable
const std::vector<const VariableUser*>& Users() const { return users_; }
@@ -81,6 +87,7 @@
const ast::Variable* const declaration_;
const sem::Type* const type_;
ast::StorageClass const storage_class_;
+ ast::AccessControl::Access const access_control_;
std::vector<const VariableUser*> users_;
const bool is_pipeline_constant_;
const uint16_t constant_id_ = 0;