mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
[ast] Change module dump order.
This CL changes the AST dumping order to emit alias types before global variables. This makes the output easier to read as the types come before the usages. Bug: tint:175 Change-Id: Ib7325384b910472e89d6d01853503be989ce4210 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/30281 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
481ecff293
commit
95dc655bf8
@@ -799,17 +799,17 @@ TEST_F(SpvParserTest, RemapStorageBuffer_TypesAndVarDeclarations) {
|
||||
<< assembly << p->error();
|
||||
const auto module_str = p->module().to_str();
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
RTArr -> __array__u32_stride_4
|
||||
S -> __struct_S
|
||||
Struct{
|
||||
[[block]]
|
||||
StructMember{[[ offset 0 ]] field0: __u32}
|
||||
StructMember{[[ offset 4 ]] field1: __alias_RTArr__array__u32_stride_4}
|
||||
}
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
})"));
|
||||
}
|
||||
|
||||
|
||||
@@ -1305,11 +1305,6 @@ TEST_F(SpvParserTest, ModuleScopeVar_NonReadableDecoration_DroppedForNow) {
|
||||
EXPECT_TRUE(p->error().empty());
|
||||
const auto module_str = p->module().to_str();
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
S -> __struct_S
|
||||
Struct{
|
||||
[[block]]
|
||||
@@ -1317,6 +1312,11 @@ TEST_F(SpvParserTest, ModuleScopeVar_NonReadableDecoration_DroppedForNow) {
|
||||
StructMember{field1: __f32}
|
||||
StructMember{field2: __array__u32_2}
|
||||
}
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
})")) << module_str;
|
||||
}
|
||||
|
||||
@@ -1333,11 +1333,6 @@ TEST_F(SpvParserTest, ModuleScopeVar_NonWritableDecoration_DroppedForNow) {
|
||||
EXPECT_TRUE(p->error().empty());
|
||||
const auto module_str = p->module().to_str();
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
S -> __struct_S
|
||||
Struct{
|
||||
[[block]]
|
||||
@@ -1345,6 +1340,11 @@ TEST_F(SpvParserTest, ModuleScopeVar_NonWritableDecoration_DroppedForNow) {
|
||||
StructMember{field1: __f32}
|
||||
StructMember{field2: __array__u32_2}
|
||||
}
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
})")) << module_str;
|
||||
}
|
||||
|
||||
@@ -1365,16 +1365,16 @@ TEST_F(SpvParserTest, ModuleScopeVar_ColMajorDecoration_Dropped) {
|
||||
EXPECT_TRUE(p->error().empty());
|
||||
const auto module_str = p->module().to_str();
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
S -> __struct_S
|
||||
Struct{
|
||||
[[block]]
|
||||
StructMember{field0: __mat_2_3__f32}
|
||||
}
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
})")) << module_str;
|
||||
}
|
||||
|
||||
@@ -1395,16 +1395,16 @@ TEST_F(SpvParserTest, ModuleScopeVar_MatrixStrideDecoration_Dropped) {
|
||||
EXPECT_TRUE(p->error().empty());
|
||||
const auto module_str = p->module().to_str();
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
S -> __struct_S
|
||||
Struct{
|
||||
[[block]]
|
||||
StructMember{field0: __mat_2_3__f32}
|
||||
}
|
||||
Variable{
|
||||
myvar
|
||||
storage_buffer
|
||||
__alias_S__struct_S
|
||||
}
|
||||
})")) << module_str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user