Skip to content

Commit c8ce514

Browse files
committed
formating 1
1 parent 263ced2 commit c8ce514

File tree

4 files changed

+26
-29
lines changed

4 files changed

+26
-29
lines changed

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,15 +1144,14 @@ struct PerVisibilityBindingChecker {
11441144
bool HadOverlap = false;
11451145

11461146
using llvm::hlsl::BindingInfoBuilder;
1147-
auto ReportOverlap = [this, &HadOverlap](
1148-
const BindingInfoBuilder &Builder,
1149-
const llvm::hlsl::Binding &Reported) {
1147+
auto ReportOverlap = [this,
1148+
&HadOverlap](const BindingInfoBuilder &Builder,
1149+
const llvm::hlsl::Binding &Reported) {
11501150
HadOverlap = true;
11511151

11521152
const auto *Elem =
11531153
static_cast<const hlsl::RootSignatureElement *>(Reported.Cookie);
1154-
const llvm::hlsl::Binding &Previous =
1155-
Builder.findOverlapping(Reported);
1154+
const llvm::hlsl::Binding &Previous = Builder.findOverlapping(Reported);
11561155
const auto *PrevElem =
11571156
static_cast<const hlsl::RootSignatureElement *>(Previous.Cookie);
11581157

llvm/include/llvm/Frontend/HLSL/HLSLBinding.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,25 @@ struct Binding {
107107
uint32_t UpperBound;
108108
const void *Cookie;
109109

110-
Binding(dxil::ResourceClass RC, uint32_t Space, uint32_t LowerBound,
111-
uint32_t UpperBound, const void *Cookie)
112-
: RC(RC), Space(Space), LowerBound(LowerBound), UpperBound(UpperBound),
113-
Cookie(Cookie) {}
110+
Binding(dxil::ResourceClass RC, uint32_t Space, uint32_t LowerBound,
111+
uint32_t UpperBound, const void *Cookie)
112+
: RC(RC), Space(Space), LowerBound(LowerBound), UpperBound(UpperBound),
113+
Cookie(Cookie) {}
114114

115-
bool isUnbounded() const { return UpperBound == ~0U; }
115+
bool isUnbounded() const { return UpperBound == ~0U; }
116116

117-
bool operator==(const Binding &RHS) const {
118-
return std::tie(RC, Space, LowerBound, UpperBound, Cookie) ==
119-
std::tie(RHS.RC, RHS.Space, RHS.LowerBound, RHS.UpperBound,
120-
RHS.Cookie);
121-
}
122-
bool operator!=(const Binding &RHS) const { return !(*this == RHS); }
117+
bool operator==(const Binding &RHS) const {
118+
return std::tie(RC, Space, LowerBound, UpperBound, Cookie) ==
119+
std::tie(RHS.RC, RHS.Space, RHS.LowerBound, RHS.UpperBound,
120+
RHS.Cookie);
121+
}
122+
bool operator!=(const Binding &RHS) const { return !(*this == RHS); }
123123

124-
bool operator<(const Binding &RHS) const {
125-
return std::tie(RC, Space, LowerBound) <
126-
std::tie(RHS.RC, RHS.Space, RHS.LowerBound);
127-
}
128-
};
124+
bool operator<(const Binding &RHS) const {
125+
return std::tie(RC, Space, LowerBound) <
126+
std::tie(RHS.RC, RHS.Space, RHS.LowerBound);
127+
}
128+
};
129129
class BoundRegs {
130130
SmallVector<Binding> Bindings;
131131

@@ -171,7 +171,7 @@ class BindingInfoBuilder {
171171
[&HasOverlap](auto, auto) { HasOverlap = true; });
172172
}
173173

174-
LLVM_ABI BoundRegs getBoundRegs(){
174+
LLVM_ABI BoundRegs getBoundRegs() {
175175
assert(std::is_sorted(Bindings.begin(), Bindings.end()) &&
176176
"Bindings must be sorted");
177177
return BoundRegs(std::move(Bindings));

llvm/lib/Frontend/HLSL/HLSLBinding.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ BindingInfo BindingInfoBuilder::calculateBindingInfo(
131131
return Info;
132132
}
133133

134-
const Binding &BindingInfoBuilder::findOverlapping(
135-
const Binding &ReportedBinding) const {
134+
const Binding &
135+
BindingInfoBuilder::findOverlapping(const Binding &ReportedBinding) const {
136136
for (const Binding &Other : Bindings)
137137
if (ReportedBinding.LowerBound <= Other.UpperBound &&
138138
Other.LowerBound <= ReportedBinding.UpperBound)

llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,8 @@ static void reportOverlappingBinding(Module &M, DXILResourceMap &DRM) {
118118
"true, yet no overlapping binding was found");
119119
}
120120

121-
static void
122-
reportOverlappingRegisters(Module &M,
123-
const llvm::hlsl::Binding &R1,
124-
const llvm::hlsl::Binding &R2) {
121+
static void reportOverlappingRegisters(Module &M, const llvm::hlsl::Binding &R1,
122+
const llvm::hlsl::Binding &R2) {
125123
SmallString<128> Message;
126124

127125
raw_svector_ostream OS(Message);
@@ -239,7 +237,7 @@ static void validateRootSignature(Module &M,
239237
const ResourceInfo::ResourceBinding &Binding = RI.getBinding();
240238
ResourceClass RC = DRTM[RI.getHandleTy()].getResourceClass();
241239
if (!BoundRegs.isBound(RC, Binding.Space, Binding.LowerBound,
242-
Binding.LowerBound + Binding.Size - 1))
240+
Binding.LowerBound + Binding.Size - 1))
243241
reportRegNotBound(M, RC, Binding);
244242
}
245243
}

0 commit comments

Comments
 (0)