================
@@ -110,6 +110,19 @@ DeclBindingInfo 
*ResourceBindings::addDeclBindingInfo(const VarDecl *VD,
                                                       ResourceClass ResClass) {
   assert(getDeclBindingInfo(VD, ResClass) == nullptr &&
          "DeclBindingInfo already added");
+#ifndef NDEBUG
+  // Verify that existing bindings for this decl are stored sequentially
+  // and at the end of the BindingsList
+  auto I = DeclToBindingListIndex.find(VD);
+  if (I != DeclToBindingListIndex.end()) {
+    for (unsigned Index = I->getSecond(); Index < BindingsList.size(); ++Index)
+      assert(BindingsList[Index].Decl == VD);
+  }
+#endif
----------------
hekota wrote:

Shoot! I have completed this PR before realizing I did not push this change up.
Here is a separate PR: https://github.com/llvm/llvm-project/pull/112661

https://github.com/llvm/llvm-project/pull/111203
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to