mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 23:56:16 +00:00
ast: Remove Struct constructors that don't take a Source
And swap the `decorations` and `members` parameters, as decorations come last for other constructors. Parsers need fixing up. Bug: tint:396 Bug: tint:390 Change-Id: Ie9b814c1de24b6c987f0fbb9e6f92da7c352caa2 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/35163 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
4543d1a232
commit
bcf37549c8
@@ -56,7 +56,7 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsLast_Pass) {
|
||||
}
|
||||
ast::StructDecorationList decos;
|
||||
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
|
||||
auto* st = create<ast::Struct>(decos, members);
|
||||
auto* st = create<ast::Struct>(Source{}, members, decos);
|
||||
ast::type::Struct struct_type("Foo", st);
|
||||
|
||||
mod()->AddConstructedType(&struct_type);
|
||||
@@ -82,7 +82,7 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsLastNoBlock_Fail) {
|
||||
Source{Source::Location{12, 34}}, "rt", &arr, deco));
|
||||
}
|
||||
ast::StructDecorationList decos;
|
||||
auto* st = create<ast::Struct>(decos, members);
|
||||
auto* st = create<ast::Struct>(Source{}, members, decos);
|
||||
ast::type::Struct struct_type("Foo", st);
|
||||
|
||||
mod()->AddConstructedType(&struct_type);
|
||||
@@ -113,7 +113,7 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsNotLast_Fail) {
|
||||
}
|
||||
ast::StructDecorationList decos;
|
||||
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
|
||||
auto* st = create<ast::Struct>(decos, members);
|
||||
auto* st = create<ast::Struct>(Source{}, members, decos);
|
||||
ast::type::Struct struct_type("Foo", st);
|
||||
|
||||
mod()->AddConstructedType(&struct_type);
|
||||
@@ -148,7 +148,7 @@ TEST_F(ValidatorTypeTest, AliasRuntimeArrayIsNotLast_Fail) {
|
||||
|
||||
ast::StructDecorationList decos;
|
||||
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
|
||||
auto* st = create<ast::Struct>(decos, members);
|
||||
auto* st = create<ast::Struct>(Source{}, members, decos);
|
||||
ast::type::Struct struct_type("s", st);
|
||||
mod()->AddConstructedType(&struct_type);
|
||||
EXPECT_FALSE(v()->ValidateConstructedTypes(mod()->constructed_types()));
|
||||
@@ -181,7 +181,7 @@ TEST_F(ValidatorTypeTest, AliasRuntimeArrayIsLast_Pass) {
|
||||
}
|
||||
ast::StructDecorationList decos;
|
||||
decos.push_back(create<ast::StructBlockDecoration>(Source{}));
|
||||
auto* st = create<ast::Struct>(decos, members);
|
||||
auto* st = create<ast::Struct>(Source{}, members, decos);
|
||||
ast::type::Struct struct_type("s", st);
|
||||
mod()->AddConstructedType(&struct_type);
|
||||
EXPECT_TRUE(v()->ValidateConstructedTypes(mod()->constructed_types()));
|
||||
|
||||
Reference in New Issue
Block a user