Skip to content

Commit 7070ca0

Browse files
committed
clang-format
1 parent 81692d6 commit 7070ca0

File tree

2 files changed

+64
-65
lines changed

2 files changed

+64
-65
lines changed

llvm/lib/Frontend/HLSL/HLSLRootSignature.cpp

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace llvm {
1717
namespace hlsl {
1818
namespace rootsig {
1919

20-
static void dumpRegType(raw_ostream& OS, RegisterType Type) {
20+
static void dumpRegType(raw_ostream &OS, RegisterType Type) {
2121
switch (Type) {
2222
case RegisterType::BReg:
2323
OS << "b";
@@ -41,30 +41,30 @@ void Register::dump(raw_ostream &OS) const {
4141

4242
static void dumpVisibility(raw_ostream &OS, ShaderVisibility Visibility) {
4343
switch (Visibility) {
44-
case ShaderVisibility::All:
45-
OS << "All";
46-
break;
47-
case ShaderVisibility::Vertex:
48-
OS << "Vertex";
49-
break;
50-
case ShaderVisibility::Hull:
51-
OS << "Hull";
52-
break;
53-
case ShaderVisibility::Domain:
54-
OS << "Domain";
55-
break;
56-
case ShaderVisibility::Geometry:
57-
OS << "Geometry";
58-
break;
59-
case ShaderVisibility::Pixel:
60-
OS << "Pixel";
61-
break;
62-
case ShaderVisibility::Amplification:
63-
OS << "Amplification";
64-
break;
65-
case ShaderVisibility::Mesh:
66-
OS << "Mesh";
67-
break;
44+
case ShaderVisibility::All:
45+
OS << "All";
46+
break;
47+
case ShaderVisibility::Vertex:
48+
OS << "Vertex";
49+
break;
50+
case ShaderVisibility::Hull:
51+
OS << "Hull";
52+
break;
53+
case ShaderVisibility::Domain:
54+
OS << "Domain";
55+
break;
56+
case ShaderVisibility::Geometry:
57+
OS << "Geometry";
58+
break;
59+
case ShaderVisibility::Pixel:
60+
OS << "Pixel";
61+
break;
62+
case ShaderVisibility::Amplification:
63+
OS << "Amplification";
64+
break;
65+
case ShaderVisibility::Mesh:
66+
OS << "Mesh";
67+
break;
6868
}
6969
}
7070

@@ -75,7 +75,7 @@ void DescriptorTable::dump(raw_ostream &OS) const {
7575
OS << ")";
7676
}
7777

78-
static void dumpClauseType(raw_ostream& OS, ClauseType Type) {
78+
static void dumpClauseType(raw_ostream &OS, ClauseType Type) {
7979
switch (Type) {
8080
case ClauseType::CBuffer:
8181
OS << "CBV";
@@ -94,28 +94,29 @@ static void dumpClauseType(raw_ostream& OS, ClauseType Type) {
9494

9595
static void dumpDescriptorRangeFlag(raw_ostream &OS, unsigned Bit) {
9696
switch (static_cast<DescriptorRangeFlags>(Bit)) {
97-
case DescriptorRangeFlags::DescriptorsVolatile:
98-
OS << "DescriptorsVolatile";
99-
break;
100-
case DescriptorRangeFlags::DataVolatile:
101-
OS << "DataVolatile";
102-
break;
103-
case DescriptorRangeFlags::DataStaticWhileSetAtExecute:
104-
OS << "DataStaticWhileSetAtExecute";
105-
break;
106-
case DescriptorRangeFlags::DataStatic:
107-
OS << "DataStatic";
108-
break;
109-
case DescriptorRangeFlags::DescriptorsStaticKeepingBufferBoundsChecks:
110-
OS << "DescriptorsStaticKeepingBufferBoundsChecks";
111-
break;
112-
default:
113-
OS << "invalid: " << Bit;
114-
break;
97+
case DescriptorRangeFlags::DescriptorsVolatile:
98+
OS << "DescriptorsVolatile";
99+
break;
100+
case DescriptorRangeFlags::DataVolatile:
101+
OS << "DataVolatile";
102+
break;
103+
case DescriptorRangeFlags::DataStaticWhileSetAtExecute:
104+
OS << "DataStaticWhileSetAtExecute";
105+
break;
106+
case DescriptorRangeFlags::DataStatic:
107+
OS << "DataStatic";
108+
break;
109+
case DescriptorRangeFlags::DescriptorsStaticKeepingBufferBoundsChecks:
110+
OS << "DescriptorsStaticKeepingBufferBoundsChecks";
111+
break;
112+
default:
113+
OS << "invalid: " << Bit;
114+
break;
115115
}
116116
}
117117

118-
static void dumpDescriptorRangeFlags(raw_ostream &OS, DescriptorRangeFlags Flags) {
118+
static void dumpDescriptorRangeFlags(raw_ostream &OS,
119+
DescriptorRangeFlags Flags) {
119120
bool FlagSet = false;
120121
unsigned Remaining = llvm::to_underlying(Flags);
121122
while (Remaining) {

llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,24 @@ namespace {
1616
TEST(HLSLRootSignatureTest, DescriptorCBVClauseDump) {
1717
DescriptorTableClause Clause;
1818
Clause.Type = ClauseType::CBuffer;
19-
Clause.Reg = { RegisterType::BReg, 0 };
19+
Clause.Reg = {RegisterType::BReg, 0};
2020
Clause.setDefaultFlags();
2121

2222
std::string Out;
2323
llvm::raw_string_ostream OS(Out);
2424
Clause.dump(OS);
2525
OS.flush();
2626

27-
std::string Expected =
28-
"CBV(b0, numDescriptors = 1, space = 0, "
29-
"offset = DescriptorTableOffsetAppend, "
30-
"flags = DataStaticWhileSetAtExecute)";
27+
std::string Expected = "CBV(b0, numDescriptors = 1, space = 0, "
28+
"offset = DescriptorTableOffsetAppend, "
29+
"flags = DataStaticWhileSetAtExecute)";
3130
EXPECT_EQ(Out, Expected);
3231
}
3332

3433
TEST(HLSLRootSignatureTest, DescriptorSRVClauseDump) {
3534
DescriptorTableClause Clause;
3635
Clause.Type = ClauseType::SRV;
37-
Clause.Reg = { RegisterType::TReg, 0 };
36+
Clause.Reg = {RegisterType::TReg, 0};
3837
Clause.NumDescriptors = 2;
3938
Clause.Space = 42;
4039
Clause.Offset = 3;
@@ -46,15 +45,14 @@ TEST(HLSLRootSignatureTest, DescriptorSRVClauseDump) {
4645
OS.flush();
4746

4847
std::string Expected =
49-
"SRV(t0, numDescriptors = 2, space = 42, offset = 3, flags = None)";
48+
"SRV(t0, numDescriptors = 2, space = 42, offset = 3, flags = None)";
5049
EXPECT_EQ(Out, Expected);
5150
}
5251

53-
5452
TEST(HLSLRootSignatureTest, DescriptorUAVClauseDump) {
5553
DescriptorTableClause Clause;
5654
Clause.Type = ClauseType::UAV;
57-
Clause.Reg = { RegisterType::UReg, 92374 };
55+
Clause.Reg = {RegisterType::UReg, 92374};
5856
Clause.NumDescriptors = 3298;
5957
Clause.Space = 932847;
6058
Clause.Offset = 1;
@@ -66,19 +64,19 @@ TEST(HLSLRootSignatureTest, DescriptorUAVClauseDump) {
6664
OS.flush();
6765

6866
std::string Expected =
69-
"UAV(u92374, numDescriptors = 3298, space = 932847, offset = 1, flags = "
70-
"DescriptorsVolatile | "
71-
"DataVolatile | "
72-
"DataStaticWhileSetAtExecute | "
73-
"DataStatic | "
74-
"DescriptorsStaticKeepingBufferBoundsChecks)";
67+
"UAV(u92374, numDescriptors = 3298, space = 932847, offset = 1, flags = "
68+
"DescriptorsVolatile | "
69+
"DataVolatile | "
70+
"DataStaticWhileSetAtExecute | "
71+
"DataStatic | "
72+
"DescriptorsStaticKeepingBufferBoundsChecks)";
7573
EXPECT_EQ(Out, Expected);
7674
}
7775

7876
TEST(HLSLRootSignatureTest, DescriptorSamplerClauseDump) {
7977
DescriptorTableClause Clause;
8078
Clause.Type = ClauseType::Sampler;
81-
Clause.Reg = { RegisterType::SReg, 0 };
79+
Clause.Reg = {RegisterType::SReg, 0};
8280
Clause.NumDescriptors = 2;
8381
Clause.Space = 42;
8482
Clause.Offset = DescriptorTableOffsetAppend;
@@ -89,9 +87,9 @@ TEST(HLSLRootSignatureTest, DescriptorSamplerClauseDump) {
8987
Clause.dump(OS);
9088
OS.flush();
9189

92-
std::string Expected =
93-
"Sampler(s0, numDescriptors = 2, space = 42, offset = DescriptorTableOffsetAppend, "
94-
"flags = DescriptorsVolatile)";
90+
std::string Expected = "Sampler(s0, numDescriptors = 2, space = 42, offset = "
91+
"DescriptorTableOffsetAppend, "
92+
"flags = DescriptorsVolatile)";
9593
EXPECT_EQ(Out, Expected);
9694
}
9795

@@ -106,7 +104,7 @@ TEST(HLSLRootSignatureTest, DescriptorTableDump) {
106104
OS.flush();
107105

108106
std::string Expected =
109-
"DescriptorTable(numClauses = 4, visibility = Geometry)";
107+
"DescriptorTable(numClauses = 4, visibility = Geometry)";
110108
EXPECT_EQ(Out, Expected);
111109
}
112110

0 commit comments

Comments
 (0)