Skip to content

Commit 2c30cd9

Browse files
author
joaosaffran
committed
addressing comments
1 parent 24040a0 commit 2c30cd9

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

llvm/lib/Target/DirectX/DXILPostOptimizationValidation.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,16 @@ static void reportInvalidHandleTy(
301301
&Resources) {
302302
for (auto Res = Resources.begin(), End = Resources.end(); Res != End; Res++) {
303303
llvm::dxil::ResourceInfo::ResourceBinding Binding = Res->getBinding();
304-
bool IsBound = false;
305304
for (const auto &RD : RDs) {
306305
if (Binding.overlapsWith(RD)) {
307-
IsBound = true;
308-
break;
306+
TargetExtType *Handle = Res->getHandleTy();
307+
auto *TypedBuffer = dyn_cast_or_null<TypedBufferExtType>(Handle);
308+
auto *Texture = dyn_cast_or_null<TextureExtType>(Handle);
309+
310+
if (TypedBuffer != nullptr || Texture != nullptr)
311+
reportInvalidHandleTyBoundInRs(M, Res->getName(), Res->getBinding());
309312
}
310313
}
311-
312-
if (!IsBound)
313-
continue;
314-
315-
TargetExtType *Handle = Res->getHandleTy();
316-
auto *TypedBuffer = dyn_cast_or_null<TypedBufferExtType>(Handle);
317-
auto *Texture = dyn_cast_or_null<TextureExtType>(Handle);
318-
319-
if (TypedBuffer != nullptr || Texture != nullptr)
320-
reportInvalidHandleTyBoundInRs(M, Res->getName(), Res->getBinding());
321314
}
322315
}
323316

0 commit comments

Comments
 (0)