Remove {ast,sem}::Struct::IsBlockDecorated()
No code should rely on the presence of the block attribute, which will
soon be deprecated and removed.
Bug: tint:1324
Change-Id: I868d5e795e66a93bdf99b94389c07dec98cb0ec2
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/72084
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/ast/struct.cc b/src/ast/struct.cc
index 7868caa..a5f166f 100644
--- a/src/ast/struct.cc
+++ b/src/ast/struct.cc
@@ -44,10 +44,6 @@
Struct::~Struct() = default;
-bool Struct::IsBlockDecorated() const {
- return HasDecoration<StructBlockDecoration>(decorations);
-}
-
const Struct* Struct::Clone(CloneContext* ctx) const {
// Clone arguments outside of create() call to have deterministic ordering
auto src = ctx->Clone(source);
diff --git a/src/ast/struct.h b/src/ast/struct.h
index f3a08c9..dd3ffa2 100644
--- a/src/ast/struct.h
+++ b/src/ast/struct.h
@@ -44,9 +44,6 @@
~Struct() override;
- /// @returns true if the struct is block decorated
- bool IsBlockDecorated() const;
-
/// Clones this node and all transitive child nodes using the `CloneContext`
/// `ctx`.
/// @param ctx the clone context
diff --git a/src/inspector/inspector.cc b/src/inspector/inspector.cc
index 5fead48..c011a8e 100644
--- a/src/inspector/inspector.cc
+++ b/src/inspector/inspector.cc
@@ -318,7 +318,7 @@
auto* func_sem = program_->Sem().Get(func);
for (auto& ruv : func_sem->TransitivelyReferencedUniformVariables()) {
const sem::Struct* s = ruv.first->Type()->UnwrapRef()->As<sem::Struct>();
- if (s && s->IsBlockDecorated()) {
+ if (s) {
size += s->Size();
}
}
@@ -382,10 +382,6 @@
continue;
}
- if (!str->IsBlockDecorated()) {
- continue;
- }
-
ResourceBinding entry;
entry.resource_type = ResourceBinding::ResourceType::kUniformBuffer;
entry.bind_group = binding_info.group->value;
diff --git a/src/reader/wgsl/parser_impl_global_decl_test.cc b/src/reader/wgsl/parser_impl_global_decl_test.cc
index 97ec487..ff21c57 100644
--- a/src/reader/wgsl/parser_impl_global_decl_test.cc
+++ b/src/reader/wgsl/parser_impl_global_decl_test.cc
@@ -182,7 +182,6 @@
auto* str = t->As<ast::Struct>();
EXPECT_EQ(str->name, program.Symbols().Get("A"));
EXPECT_EQ(str->members.size(), 1u);
- EXPECT_FALSE(str->IsBlockDecorated());
const auto* ty = str->members[0]->type;
ASSERT_TRUE(ty->Is<ast::Array>());
@@ -209,7 +208,6 @@
auto* str = t->As<ast::Struct>();
EXPECT_EQ(str->name, program.Symbols().Get("A"));
EXPECT_EQ(str->members.size(), 1u);
- EXPECT_TRUE(str->IsBlockDecorated());
}
TEST_F(ParserImplTest, GlobalDecl_Struct_Invalid) {
diff --git a/src/sem/struct.h b/src/sem/struct.h
index 3e3b62d..d7eab4b 100644
--- a/src/sem/struct.h
+++ b/src/sem/struct.h
@@ -142,9 +142,6 @@
return pipeline_stage_uses_;
}
- /// @returns true if the struct has a block decoration
- bool IsBlockDecorated() const { return declaration_->IsBlockDecorated(); }
-
/// @returns the name for the type
std::string type_name() const override;