Skip to content

Commit f35a14d

Browse files
authored
[HLSL] Simplify debug check in ResourceBindings::addDeclBindingInfo (#112661)
Follow-up for #111203 (review).
1 parent 03888a9 commit f35a14d

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,7 @@ DeclBindingInfo *ResourceBindings::addDeclBindingInfo(const VarDecl *VD,
110110
ResourceClass ResClass) {
111111
assert(getDeclBindingInfo(VD, ResClass) == nullptr &&
112112
"DeclBindingInfo already added");
113-
#ifndef NDEBUG
114-
// Verify that existing bindings for this decl are stored sequentially
115-
// and at the end of the BindingsList
116-
auto I = DeclToBindingListIndex.find(VD);
117-
if (I != DeclToBindingListIndex.end()) {
118-
for (unsigned Index = I->getSecond(); Index < BindingsList.size(); ++Index)
119-
assert(BindingsList[Index].Decl == VD);
120-
}
121-
#endif
113+
assert(!hasBindingInfoForDecl(VD) || BindingsList.back().Decl == VD);
122114
// VarDecl may have multiple entries for different resource classes.
123115
// DeclToBindingListIndex stores the index of the first binding we saw
124116
// for this decl. If there are any additional ones then that index

0 commit comments

Comments
 (0)