Skip to content

Commit 78a6a34

Browse files
committed
Improve overlap reporting related comments
1 parent 453db9e commit 78a6a34

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/Frontend/HLSL/HLSLBinding.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ BindingInfo BindingInfoBuilder::calculateBindingInfo(
9999
S = &BS->Spaces.emplace_back(B.Space);
100100

101101
// The space is full - there are no free slots left, or the rest of the
102-
// slots are taken by an unbounded array. Set flag to report overlapping
103-
// binding later.
102+
// slots are taken by an unbounded array. Report the overlapping to the
103+
// caller.
104104
if (S->FreeRanges.empty() || S->FreeRanges.back().UpperBound < ~0u) {
105105
ReportOverlap(*this, B);
106106
continue;
@@ -117,6 +117,8 @@ BindingInfo BindingInfoBuilder::calculateBindingInfo(
117117
if (B.UpperBound < ~0u)
118118
S->FreeRanges.emplace_back(B.UpperBound + 1, ~0u);
119119
} else {
120+
// We don't have room here. Report the overlapping binding to the caller
121+
// and mark any extra space this binding would use as unavailable.
120122
ReportOverlap(*this, B);
121123
if (B.UpperBound < ~0u)
122124
LastFreeRange.LowerBound =

0 commit comments

Comments
 (0)