mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Program: Remove deprecated constructed-type methods
Fixup all usages Bug: tint:390 Change-Id: I739a7625cd385cb889369ab7c766462fbcd7cf12 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38546 Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
@@ -375,7 +375,7 @@ TEST_F(ValidateControlBlockTest, SwitchCaseAlias_Pass) {
|
||||
create<ast::VariableDeclStatement>(var),
|
||||
create<ast::SwitchStatement>(Expr("a"), body),
|
||||
});
|
||||
mod->AddConstructedType(my_int);
|
||||
mod->AST().AddConstructedType(my_int);
|
||||
|
||||
EXPECT_TRUE(td()->DetermineStatements(block)) << td()->error();
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ bool ValidatorImpl::Validate() {
|
||||
if (!ValidateGlobalVariables(program_->AST().GlobalVariables())) {
|
||||
return false;
|
||||
}
|
||||
if (!ValidateConstructedTypes(program_->constructed_types())) {
|
||||
if (!ValidateConstructedTypes(program_->AST().ConstructedTypes())) {
|
||||
return false;
|
||||
}
|
||||
if (!ValidateFunctions(program_->Functions())) {
|
||||
|
||||
@@ -51,11 +51,11 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsLast_Pass) {
|
||||
|
||||
auto* struct_type = ty.struct_("Foo", st);
|
||||
|
||||
mod->AddConstructedType(struct_type);
|
||||
mod->AST().AddConstructedType(struct_type);
|
||||
|
||||
ValidatorImpl& v = Build();
|
||||
|
||||
EXPECT_TRUE(v.ValidateConstructedTypes(mod->constructed_types()));
|
||||
EXPECT_TRUE(v.ValidateConstructedTypes(mod->AST().ConstructedTypes()));
|
||||
}
|
||||
|
||||
TEST_F(ValidatorTypeTest, RuntimeArrayIsLastNoBlock_Fail) {
|
||||
@@ -71,11 +71,11 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsLastNoBlock_Fail) {
|
||||
decos);
|
||||
|
||||
auto* struct_type = ty.struct_("Foo", st);
|
||||
mod->AddConstructedType(struct_type);
|
||||
mod->AST().AddConstructedType(struct_type);
|
||||
|
||||
ValidatorImpl& v = Build();
|
||||
|
||||
EXPECT_FALSE(v.ValidateConstructedTypes(mod->constructed_types()));
|
||||
EXPECT_FALSE(v.ValidateConstructedTypes(mod->AST().ConstructedTypes()));
|
||||
EXPECT_EQ(v.error(),
|
||||
"v-0031: a struct containing a runtime-sized array must be "
|
||||
"in the 'storage' storage class: 'Foo'");
|
||||
@@ -99,11 +99,11 @@ TEST_F(ValidatorTypeTest, RuntimeArrayIsNotLast_Fail) {
|
||||
|
||||
auto* struct_type = ty.struct_("Foo", st);
|
||||
|
||||
mod->AddConstructedType(struct_type);
|
||||
mod->AST().AddConstructedType(struct_type);
|
||||
|
||||
ValidatorImpl& v = Build();
|
||||
|
||||
EXPECT_FALSE(v.ValidateConstructedTypes(mod->constructed_types()));
|
||||
EXPECT_FALSE(v.ValidateConstructedTypes(mod->AST().ConstructedTypes()));
|
||||
EXPECT_EQ(v.error(),
|
||||
"12:34 v-0015: runtime arrays may only appear as the last member "
|
||||
"of a struct");
|
||||
@@ -125,11 +125,11 @@ TEST_F(ValidatorTypeTest, AliasRuntimeArrayIsNotLast_Fail) {
|
||||
ast::StructMemberList{Member("b", alias), Member("a", ty.u32)}, decos);
|
||||
|
||||
auto* struct_type = ty.struct_("s", st);
|
||||
mod->AddConstructedType(struct_type);
|
||||
mod->AST().AddConstructedType(struct_type);
|
||||
|
||||
ValidatorImpl& v = Build();
|
||||
|
||||
EXPECT_FALSE(v.ValidateConstructedTypes(mod->constructed_types()));
|
||||
EXPECT_FALSE(v.ValidateConstructedTypes(mod->AST().ConstructedTypes()));
|
||||
EXPECT_EQ(v.error(),
|
||||
"v-0015: runtime arrays may only appear as the last member "
|
||||
"of a struct");
|
||||
@@ -151,11 +151,11 @@ TEST_F(ValidatorTypeTest, AliasRuntimeArrayIsLast_Pass) {
|
||||
ast::StructMemberList{Member("a", ty.u32), Member("b", alias)}, decos);
|
||||
|
||||
auto* struct_type = ty.struct_("s", st);
|
||||
mod->AddConstructedType(struct_type);
|
||||
mod->AST().AddConstructedType(struct_type);
|
||||
|
||||
ValidatorImpl& v = Build();
|
||||
|
||||
EXPECT_TRUE(v.ValidateConstructedTypes(mod->constructed_types()));
|
||||
EXPECT_TRUE(v.ValidateConstructedTypes(mod->AST().ConstructedTypes()));
|
||||
}
|
||||
|
||||
TEST_F(ValidatorTypeTest, RuntimeArrayInFunction_Fail) {
|
||||
|
||||
Reference in New Issue
Block a user