mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
sem::StructType remove symbol()
The name now lives on the ast::Struct. Use that instead. Bug: tint:724 Change-Id: I4ee5e9b29973e468edd8df8c5448816b36f0fca6 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48384 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
8a8d26bbd9
commit
913a2f4b2a
@@ -133,7 +133,7 @@ TEST_P(ArrayDecorationTest, IsValid) {
|
||||
auto* s = create<ast::Struct>(
|
||||
Sym("mystruct"), members,
|
||||
ast::DecorationList{create<ast::StructBlockDecoration>()});
|
||||
auto* s_ty = ty.struct_("mystruct", s);
|
||||
auto* s_ty = ty.struct_(s);
|
||||
AST().AddConstructedType(s_ty);
|
||||
|
||||
WrapInFunction();
|
||||
@@ -170,7 +170,7 @@ TEST_P(StructDecorationTest, IsValid) {
|
||||
auto* s = create<ast::Struct>(Sym("mystruct"), ast::StructMemberList{},
|
||||
ast::DecorationList{createDecoration(
|
||||
Source{{12, 34}}, *this, params.kind)});
|
||||
auto* s_ty = ty.struct_("mystruct", s);
|
||||
auto* s_ty = ty.struct_(s);
|
||||
AST().AddConstructedType(s_ty);
|
||||
|
||||
WrapInFunction();
|
||||
@@ -210,7 +210,7 @@ TEST_P(StructMemberDecorationTest, IsValid) {
|
||||
createDecoration(Source{{12, 34}}, *this, params.kind)})};
|
||||
auto* s =
|
||||
create<ast::Struct>(Sym("mystruct"), members, ast::DecorationList{});
|
||||
auto* s_ty = ty.struct_("mystruct", s);
|
||||
auto* s_ty = ty.struct_(s);
|
||||
AST().AddConstructedType(s_ty);
|
||||
|
||||
WrapInFunction();
|
||||
|
||||
@@ -2009,12 +2009,12 @@ bool Resolver::ValidateStructure(const sem::StructType* st) {
|
||||
return false;
|
||||
}
|
||||
if (!st->IsBlockDecorated()) {
|
||||
diagnostics_.add_error("v-0015",
|
||||
"a struct containing a runtime-sized array "
|
||||
"requires the [[block]] attribute: '" +
|
||||
builder_->Symbols().NameFor(st->symbol()) +
|
||||
"'",
|
||||
member->source());
|
||||
diagnostics_.add_error(
|
||||
"v-0015",
|
||||
"a struct containing a runtime-sized array "
|
||||
"requires the [[block]] attribute: '" +
|
||||
builder_->Symbols().NameFor(st->impl()->name()) + "'",
|
||||
member->source());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -894,7 +894,7 @@ TEST_F(ResolverTest, Expr_MemberAccessor_Struct) {
|
||||
Member("second_member", ty.f32())},
|
||||
ast::DecorationList{});
|
||||
|
||||
auto* st = ty.struct_("S", strct);
|
||||
auto* st = ty.struct_(strct);
|
||||
Global("my_struct", st, ast::StorageClass::kInput);
|
||||
|
||||
auto* mem = MemberAccessor("my_struct", "second_member");
|
||||
@@ -924,7 +924,7 @@ TEST_F(ResolverTest, Expr_MemberAccessor_Struct_Alias) {
|
||||
Member("second_member", ty.f32())},
|
||||
ast::DecorationList{});
|
||||
|
||||
auto* st = ty.struct_("alias", strct);
|
||||
auto* st = ty.struct_(strct);
|
||||
auto* alias = ty.alias("alias", st);
|
||||
Global("my_struct", alias, ast::StorageClass::kInput);
|
||||
|
||||
@@ -1004,14 +1004,14 @@ TEST_F(ResolverTest, Expr_Accessor_MultiLevel) {
|
||||
auto* strctB = create<ast::Struct>(
|
||||
Sym("B"), ast::StructMemberList{Member("foo", ty.vec4<f32>())},
|
||||
ast::DecorationList{});
|
||||
auto* stB = ty.struct_("B", strctB);
|
||||
auto* stB = ty.struct_(strctB);
|
||||
|
||||
sem::Vector vecB(stB, 3);
|
||||
auto* strctA =
|
||||
create<ast::Struct>(Sym("A"), ast::StructMemberList{Member("mem", &vecB)},
|
||||
ast::DecorationList{});
|
||||
|
||||
auto* stA = ty.struct_("A", strctA);
|
||||
auto* stA = ty.struct_(strctA);
|
||||
Global("c", stA, ast::StorageClass::kInput);
|
||||
|
||||
auto* mem = MemberAccessor(
|
||||
@@ -1035,7 +1035,7 @@ TEST_F(ResolverTest, Expr_MemberAccessor_InBinaryOp) {
|
||||
Member("second_member", ty.f32())},
|
||||
ast::DecorationList{});
|
||||
|
||||
auto* st = ty.struct_("S", strct);
|
||||
auto* st = ty.struct_(strct);
|
||||
Global("my_struct", st, ast::StorageClass::kInput);
|
||||
|
||||
auto* expr = Add(MemberAccessor("my_struct", "first_member"),
|
||||
|
||||
@@ -320,7 +320,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayIsLast_Pass) {
|
||||
Member("rt", ty.array<f32>())},
|
||||
decos);
|
||||
|
||||
auto* struct_type = ty.struct_("Foo", st);
|
||||
auto* struct_type = ty.struct_(st);
|
||||
AST().AddConstructedType(struct_type);
|
||||
|
||||
WrapInFunction();
|
||||
@@ -341,7 +341,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayIsLastNoBlock_Fail) {
|
||||
Member(Source{{12, 34}}, "rt", ty.array<f32>())},
|
||||
decos);
|
||||
|
||||
auto* struct_type = ty.struct_("Foo", st);
|
||||
auto* struct_type = ty.struct_(st);
|
||||
AST().AddConstructedType(struct_type);
|
||||
|
||||
WrapInFunction();
|
||||
@@ -366,7 +366,7 @@ TEST_F(ResolverTypeValidationTest, RuntimeArrayIsNotLast_Fail) {
|
||||
auto* st = create<ast::Struct>(
|
||||
Sym("Foo"), ast::StructMemberList{rt, Member("vf", ty.f32())}, decos);
|
||||
|
||||
auto* struct_type = ty.struct_("Foo", st);
|
||||
auto* struct_type = ty.struct_(st);
|
||||
|
||||
AST().AddConstructedType(struct_type);
|
||||
|
||||
@@ -445,7 +445,7 @@ TEST_F(ResolverTypeValidationTest, AliasRuntimeArrayIsNotLast_Fail) {
|
||||
Member("a", ty.u32())},
|
||||
decos);
|
||||
|
||||
auto* struct_type = ty.struct_("s", st);
|
||||
auto* struct_type = ty.struct_(st);
|
||||
AST().AddConstructedType(struct_type);
|
||||
|
||||
WrapInFunction();
|
||||
@@ -473,7 +473,7 @@ TEST_F(ResolverTypeValidationTest, AliasRuntimeArrayIsLast_Pass) {
|
||||
Sym("s"),
|
||||
ast::StructMemberList{Member("a", ty.u32()), Member("b", alias)}, decos);
|
||||
|
||||
auto* struct_type = ty.struct_("s", st);
|
||||
auto* struct_type = ty.struct_(st);
|
||||
AST().AddConstructedType(struct_type);
|
||||
|
||||
WrapInFunction();
|
||||
|
||||
Reference in New Issue
Block a user