Skip to content

Commit 28aad01

Browse files
author
joaosaffran
committed
clean up
1 parent b9be921 commit 28aad01

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

llvm/include/llvm/MC/DXContainerRootSignature.h

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ struct RootParameterInfo {
2929
: Header(H), Location(L) {}
3030
};
3131

32-
using RootDescriptor = std::variant<dxbc::RST0::v0::RootDescriptor*,
33-
dxbc::RST0::v1::RootDescriptor*>;
34-
using ParametersView =
35-
std::variant<const dxbc::RootConstants*, const dxbc::RST0::v0::RootDescriptor*,
36-
const dxbc::RST0::v1::RootDescriptor*>;
32+
using RootDescriptor = std::variant<dxbc::RST0::v0::RootDescriptor *,
33+
dxbc::RST0::v1::RootDescriptor *>;
34+
using ParametersView = std::variant<const dxbc::RootConstants *,
35+
const dxbc::RST0::v0::RootDescriptor *,
36+
const dxbc::RST0::v1::RootDescriptor *>;
3737
struct RootParametersContainer {
3838
SmallVector<RootParameterInfo> ParametersInfo;
3939

@@ -69,10 +69,10 @@ struct RootParametersContainer {
6969
case llvm::to_underlying(dxbc::RootParameterType::SRV):
7070
case llvm::to_underlying(dxbc::RootParameterType::UAV):
7171
RootDescriptor VersionedParam = Descriptors[H->Location];
72-
if (std::holds_alternative<dxbc::RST0::v0::RootDescriptor*>(
72+
if (std::holds_alternative<dxbc::RST0::v0::RootDescriptor *>(
7373
VersionedParam))
74-
return std::get<dxbc::RST0::v0::RootDescriptor*>(VersionedParam);
75-
return std::get<dxbc::RST0::v1::RootDescriptor*>(VersionedParam);
74+
return std::get<dxbc::RST0::v0::RootDescriptor *>(VersionedParam);
75+
return std::get<dxbc::RST0::v1::RootDescriptor *>(VersionedParam);
7676
}
7777

7878
return std::nullopt;
@@ -86,11 +86,6 @@ struct RootParametersContainer {
8686
SmallVector<RootParameterInfo>::const_iterator end() const {
8787
return ParametersInfo.end();
8888
}
89-
90-
llvm::iterator_range<SmallVector<RootParameterInfo>::const_iterator>
91-
getInfo() const {
92-
return llvm::make_range(begin(), end());
93-
}
9489
};
9590
struct RootSignatureDesc {
9691

llvm/include/llvm/ObjectYAML/DXContainerYAML.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct RootParameterYamlDesc {
9595
uint32_t Type;
9696
uint32_t Visibility;
9797
uint32_t Offset;
98-
RootParameterYamlDesc() {};
98+
RootParameterYamlDesc(){};
9999
RootParameterYamlDesc(uint32_t T) : Type(T) {
100100
switch (T) {
101101

llvm/lib/MC/DXContainerRootSignature.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,24 @@ void RootSignatureDesc::write(raw_ostream &OS) const {
8080
auto P = ParametersContainer.getParameter(H);
8181
if (!P)
8282
continue;
83-
if (std::holds_alternative<const dxbc::RootConstants*>(*P)) {
84-
auto* Constants = std::get<const dxbc::RootConstants*>(*P);
83+
if (std::holds_alternative<const dxbc::RootConstants *>(*P)) {
84+
auto *Constants = std::get<const dxbc::RootConstants *>(*P);
8585
support::endian::write(BOS, Constants->ShaderRegister,
8686
llvm::endianness::little);
8787
support::endian::write(BOS, Constants->RegisterSpace,
8888
llvm::endianness::little);
8989
support::endian::write(BOS, Constants->Num32BitValues,
9090
llvm::endianness::little);
91-
} else if (std::holds_alternative<const dxbc::RST0::v0::RootDescriptor*>(*P)) {
92-
auto* Descriptor = std::get<const dxbc::RST0::v0::RootDescriptor*>(*P);
91+
} else if (std::holds_alternative<const dxbc::RST0::v0::RootDescriptor *>(
92+
*P)) {
93+
auto *Descriptor = std::get<const dxbc::RST0::v0::RootDescriptor *>(*P);
9394
support::endian::write(BOS, Descriptor->ShaderRegister,
9495
llvm::endianness::little);
9596
support::endian::write(BOS, Descriptor->RegisterSpace,
9697
llvm::endianness::little);
97-
} else if (std::holds_alternative<const dxbc::RST0::v1::RootDescriptor*>(*P)) {
98-
auto* Descriptor = std::get<const dxbc::RST0::v1::RootDescriptor*>(*P);
98+
} else if (std::holds_alternative<const dxbc::RST0::v1::RootDescriptor *>(
99+
*P)) {
100+
auto *Descriptor = std::get<const dxbc::RST0::v1::RootDescriptor *>(*P);
99101

100102
support::endian::write(BOS, Descriptor->ShaderRegister,
101103
llvm::endianness::little);

llvm/lib/Target/DirectX/DXILRootSignature.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ PreservedAnalyses RootSignatureAnalysisPrinter::run(Module &M,
301301
RS.ParametersContainer.getParameter(&Info);
302302
if (!P)
303303
continue;
304-
if (std::holds_alternative<const dxbc::RootConstants*>(*P)) {
305-
auto* Constants = std::get<const dxbc::RootConstants*>(*P);
306-
OS << indent(Space + 2) << "Register Space: " << Constants->RegisterSpace
307-
<< "\n";
304+
if (std::holds_alternative<const dxbc::RootConstants *>(*P)) {
305+
auto *Constants = std::get<const dxbc::RootConstants *>(*P);
306+
OS << indent(Space + 2)
307+
<< "Register Space: " << Constants->RegisterSpace << "\n";
308308
OS << indent(Space + 2)
309309
<< "Shader Register: " << Constants->ShaderRegister << "\n";
310310
OS << indent(Space + 2)

0 commit comments

Comments
 (0)