From 67beed1b94b148c72b74f703b0d5d3d4b9331c09 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 26 Jan 2021 20:18:51 +0000 Subject: [PATCH] Remove support for the set decoration. This CL removes the set decoration support, it has been replaced by the group decoration. Change-Id: Ib9ca94872d39e5da9dbe18bba3cae6d64320e55d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38824 Auto-Submit: dan sinclair Reviewed-by: Ben Clayton Commit-Queue: dan sinclair --- src/reader/wgsl/parser_impl.cc | 8 +++----- .../wgsl/parser_impl_variable_decoration_test.cc | 16 ---------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index 89cb4e956c..649589bf17 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -137,7 +137,6 @@ const char kBuiltinDecoration[] = "builtin"; const char kGroupDecoration[] = "group"; const char kLocationDecoration[] = "location"; const char kOffsetDecoration[] = "offset"; -const char kSetDecoration[] = "set"; const char kStageDecoration[] = "stage"; const char kStrideDecoration[] = "stride"; const char kWorkgroupSizeDecoration[] = "workgroup_size"; @@ -150,9 +149,8 @@ bool is_decoration(Token t) { return s == kAccessDecoration || s == kBindingDecoration || s == kBlockDecoration || s == kBuiltinDecoration || s == kLocationDecoration || s == kOffsetDecoration || - s == kSetDecoration || s == kGroupDecoration || - s == kStageDecoration || s == kStrideDecoration || - s == kWorkgroupSizeDecoration; + s == kGroupDecoration || s == kStageDecoration || + s == kStrideDecoration || s == kWorkgroupSizeDecoration; } /// Enter-exit counters for block token types. @@ -2937,7 +2935,7 @@ Maybe ParserImpl::decoration() { }); } - if (s == kSetDecoration || s == kGroupDecoration) { + if (s == kGroupDecoration) { const char* use = "group decoration"; return expect_paren_block(use, [&]() -> Result { auto val = expect_positive_sint(use); diff --git a/src/reader/wgsl/parser_impl_variable_decoration_test.cc b/src/reader/wgsl/parser_impl_variable_decoration_test.cc index 9cf65ab04f..128ec8aabe 100644 --- a/src/reader/wgsl/parser_impl_variable_decoration_test.cc +++ b/src/reader/wgsl/parser_impl_variable_decoration_test.cc @@ -236,22 +236,6 @@ TEST_F(ParserImplTest, VariableDecoration_Binding_MissingInvalid) { "1:9: expected signed integer literal for binding decoration"); } -// DEPRECATED -TEST_F(ParserImplTest, VariableDecoration_set) { - auto p = parser("set(4)"); - auto deco = p->decoration(); - EXPECT_TRUE(deco.matched); - EXPECT_FALSE(deco.errored); - ASSERT_NE(deco.value, nullptr); - auto* var_deco = deco.value->As(); - ASSERT_FALSE(p->has_error()); - ASSERT_NE(var_deco, nullptr); - ASSERT_TRUE(var_deco->Is()); - - auto* group = var_deco->As(); - EXPECT_EQ(group->value(), 4u); -} - TEST_F(ParserImplTest, VariableDecoration_group) { auto p = parser("group(4)"); auto deco = p->decoration();