Two ParamAttrsVectors which differ by a permutation
[oota-llvm.git] / lib / VMCore / Function.cpp
index a4bc69b4721d513648aeadf895ffee1cbee6b1b6..3582b321504f1e19ef94639817116d3195d6c5b7 100644 (file)
@@ -124,6 +124,10 @@ static ManagedStatic<FoldingSet<ParamAttrsList> > ParamAttrsLists;
 ParamAttrsList *
 ParamAttrsList::get(const ParamAttrsVector &attrVec) {
   assert(!attrVec.empty() && "Illegal to create empty ParamAttrsList");
+#ifndef NDEBUG
+  for (unsigned i = 1, e = attrVec.size(); i < e; ++i)
+    assert(attrVec[i-1].index < attrVec[i].index && "Misordered ParamAttrsList!");
+#endif
   ParamAttrsList key(attrVec);
   FoldingSetNodeID ID;
   key.Profile(ID);