Add Symbol to struct type.

This CL adds a Symbol to the struct type along side the name. The name
will be removed in a future CL when the symbol is used everywhere.

Change-Id: I6c355908651ba0a155a1e0c9ed1192313a405568
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35620
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair
2020-12-14 16:01:37 +00:00
committed by Commit Bot service account
parent 2abecbba16
commit 24bbbbb25f
35 changed files with 201 additions and 166 deletions

View File

@@ -57,7 +57,7 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsLast_Pass) {
ast::StructDecorationList decos;
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
auto* st = create<ast::Struct>(Source{}, members, decos);
ast::type::Struct struct_type("Foo", st);
ast::type::Struct struct_type(mod()->RegisterSymbol("Foo"), "Foo", st);
mod()->AddConstructedType(&struct_type);
EXPECT_TRUE(v()->ValidateConstructedTypes(mod()->constructed_types()));
@@ -83,7 +83,7 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsLastNoBlock_Fail) {
}
ast::StructDecorationList decos;
auto* st = create<ast::Struct>(Source{}, members, decos);
ast::type::Struct struct_type("Foo", st);
ast::type::Struct struct_type(mod()->RegisterSymbol("Foo"), "Foo", st);
mod()->AddConstructedType(&struct_type);
EXPECT_FALSE(v()->ValidateConstructedTypes(mod()->constructed_types()));
@@ -114,7 +114,7 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsNotLast_Fail) {
ast::StructDecorationList decos;
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
auto* st = create<ast::Struct>(Source{}, members, decos);
ast::type::Struct struct_type("Foo", st);
ast::type::Struct struct_type(mod()->RegisterSymbol("Foo"), "Foo", st);
mod()->AddConstructedType(&struct_type);
EXPECT_FALSE(v()->ValidateConstructedTypes(mod()->constructed_types()));
@@ -149,7 +149,7 @@ TEST_F(ValidatorTypeTest, AliasRuntimeArrayIsNotLast_Fail) {
ast::StructDecorationList decos;
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
auto* st = create<ast::Struct>(Source{}, members, decos);
ast::type::Struct struct_type("s", st);
ast::type::Struct struct_type(mod()->RegisterSymbol("s"), "s", st);
mod()->AddConstructedType(&struct_type);
EXPECT_FALSE(v()->ValidateConstructedTypes(mod()->constructed_types()));
EXPECT_EQ(v()->error(),
@@ -182,7 +182,7 @@ TEST_F(ValidatorTypeTest, AliasRuntimeArrayIsLast_Pass) {
ast::StructDecorationList decos;
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
auto* st = create<ast::Struct>(Source{}, members, decos);
ast::type::Struct struct_type("s", st);
ast::type::Struct struct_type(mod()->RegisterSymbol("s"), "s", st);
mod()->AddConstructedType(&struct_type);
EXPECT_TRUE(v()->ValidateConstructedTypes(mod()->constructed_types()));
}