Skip to content

Commit f3e3b3f

Browse files
committed
format
1 parent 2039b3b commit f3e3b3f

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

llvm/lib/Analysis/DXILResource.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ DXILBindingMap::findByUse(const Value *Key) const {
776776
if (Phi) {
777777
SmallVector<dxil::ResourceBindingInfo> Children;
778778
for (const Value *V : Phi->operands()) {
779-
Children.append(findByUse(V));
779+
Children.append(findByUse(V));
780780
}
781781
return Children;
782782
}
@@ -786,19 +786,19 @@ DXILBindingMap::findByUse(const Value *Key) const {
786786
return {};
787787
}
788788

789-
const Type* UseType = CI->getType();
789+
const Type *UseType = CI->getType();
790790

791791
switch (CI->getIntrinsicID()) {
792792
// Check if any of the parameters are the resource we are following. If so
793793
// keep searching
794794
case Intrinsic::not_intrinsic: {
795795
SmallVector<dxil::ResourceBindingInfo> Children;
796796
for (const Value *V : CI->args()) {
797-
if (V->getType() != UseType) {
798-
continue;
799-
}
797+
if (V->getType() != UseType) {
798+
continue;
799+
}
800800

801-
Children.append(findByUse(V));
801+
Children.append(findByUse(V));
802802
}
803803

804804
return Children;
@@ -807,7 +807,7 @@ DXILBindingMap::findByUse(const Value *Key) const {
807807
case Intrinsic::dx_resource_handlefrombinding:
808808
const auto *It = find(CI);
809809
if (It == Infos.end())
810-
return {};
810+
return {};
811811
return {*It};
812812
}
813813

llvm/unittests/Target/DirectX/UniqueResourceFromUseTests.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ namespace {
4141
class UniqueResourceFromUseTest : public testing::Test {
4242
protected:
4343
PassBuilder *PB;
44-
ModuleAnalysisManager* MAM;
44+
ModuleAnalysisManager *MAM;
4545

4646
virtual void SetUp() {
47-
MAM = new ModuleAnalysisManager();
48-
PB = new PassBuilder();
49-
PB->registerModuleAnalyses(*MAM);
50-
MAM->registerPass([&]{ return DXILResourceTypeAnalysis(); });
51-
MAM->registerPass([&] { return DXILResourceBindingAnalysis(); });
47+
MAM = new ModuleAnalysisManager();
48+
PB = new PassBuilder();
49+
PB->registerModuleAnalyses(*MAM);
50+
MAM->registerPass([&] { return DXILResourceTypeAnalysis(); });
51+
MAM->registerPass([&] { return DXILResourceBindingAnalysis(); });
5252
}
5353

54-
virtual void TearDown() {
54+
virtual void TearDown() {
5555
delete PB;
5656
delete MAM;
5757
}
@@ -91,7 +91,8 @@ declare void @a.func(target("dx.RawBuffer", float, 1, 0) %handle)
9191
const Value *Handle = CI->getArgOperand(0);
9292

9393
const auto Bindings = DBM.findByUse(Handle);
94-
ASSERT_EQ(Bindings.size(), 1u) << "Handle should resolve into one resource";
94+
ASSERT_EQ(Bindings.size(), 1u)
95+
<< "Handle should resolve into one resource";
9596

9697
auto Binding = Bindings[0].getBinding();
9798
EXPECT_EQ(0u, Binding.RecordID);
@@ -143,7 +144,8 @@ declare target("dx.RawBuffer", float, 1, 0) @ind.func(target("dx.RawBuffer", flo
143144
const Value *Handle = CI->getArgOperand(0);
144145

145146
const auto Bindings = DBM.findByUse(Handle);
146-
ASSERT_EQ(Bindings.size(), 1u) << "Handle should resolve into one resource";
147+
ASSERT_EQ(Bindings.size(), 1u)
148+
<< "Handle should resolve into one resource";
147149

148150
auto Binding = Bindings[0].getBinding();
149151
EXPECT_EQ(0u, Binding.RecordID);
@@ -198,7 +200,8 @@ declare target("dx.RawBuffer", float, 1, 0) @ind.func(target("dx.RawBuffer", flo
198200
const Value *Handle = CI->getArgOperand(0);
199201

200202
const auto Bindings = DBM.findByUse(Handle);
201-
ASSERT_EQ(Bindings.size(), 4u) << "Handle should resolve into four resources";
203+
ASSERT_EQ(Bindings.size(), 4u)
204+
<< "Handle should resolve into four resources";
202205

203206
auto Binding = Bindings[0].getBinding();
204207
EXPECT_EQ(0u, Binding.RecordID);
@@ -280,7 +283,8 @@ declare target("dx.RawBuffer", float, 1, 0) @ind.func(target("dx.RawBuffer", flo
280283
const Value *Handle = CI->getArgOperand(0);
281284

282285
const auto Bindings = DBM.findByUse(Handle);
283-
ASSERT_EQ(Bindings.size(), 2u) << "Handle should resolve into four resources";
286+
ASSERT_EQ(Bindings.size(), 2u)
287+
<< "Handle should resolve into four resources";
284288

285289
auto Binding = Bindings[0].getBinding();
286290
EXPECT_EQ(0u, Binding.RecordID);
@@ -302,4 +306,4 @@ declare target("dx.RawBuffer", float, 1, 0) @ind.func(target("dx.RawBuffer", flo
302306
}
303307
}
304308

305-
} // namespace
309+
} // namespace

0 commit comments

Comments
 (0)