Remove ast::Variable::constant_id()
The backends now use sem::Variable::ConstantId() instead, since the
AST does not have the correct ID when the parameterless version of the
override attribute is used.
Change-Id: I816295c8b2e4baa1671c9d042920bf001b1b4336
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50845
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
diff --git a/src/ast/variable.cc b/src/ast/variable.cc
index 91a21ba..6bfe36f 100644
--- a/src/ast/variable.cc
+++ b/src/ast/variable.cc
@@ -62,14 +62,6 @@
return BindingPoint{group, binding};
}
-uint32_t Variable::constant_id() const {
- if (auto* cid = GetDecoration<OverrideDecoration>(decorations_)) {
- return cid->value();
- }
- TINT_ASSERT(false);
- return 0;
-}
-
Variable* Variable::Clone(CloneContext* ctx) const {
auto src = ctx->Clone(source());
auto sym = ctx->Clone(symbol());
diff --git a/src/ast/variable.h b/src/ast/variable.h
index 6e8069f..d91fea2 100644
--- a/src/ast/variable.h
+++ b/src/ast/variable.h
@@ -142,10 +142,6 @@
/// @returns the binding point information for the variable
BindingPoint binding_point() const;
- /// @returns the pipeline constant id value for the variable. Assumes that
- /// this variable has an override decoration.
- uint32_t constant_id() const;
-
/// Clones this node and all transitive child nodes using the `CloneContext`
/// `ctx`.
/// @param ctx the clone context
diff --git a/src/ast/variable_test.cc b/src/ast/variable_test.cc
index 9bb3afb..9967a20 100644
--- a/src/ast/variable_test.cc
+++ b/src/ast/variable_test.cc
@@ -169,15 +169,6 @@
EXPECT_EQ(var->binding_point().binding, nullptr);
}
-TEST_F(VariableTest, ConstantId) {
- auto* var = Var("my_var", ty.i32(), StorageClass::kFunction, nullptr,
- DecorationList{
- create<OverrideDecoration>(1200),
- });
-
- EXPECT_EQ(var->constant_id(), 1200u);
-}
-
TEST_F(VariableTest, Decorated_to_str) {
auto* var = Var("my_var", ty.f32(), StorageClass::kFunction, Expr("expr"),
DecorationList{