Author: baldrick Date: Tue Sep 11 09:40:04 2007 New Revision: 41845 URL: http://llvm.org/viewvc/llvm-project?rev=41845&view=rev Log: Two ParamAttrsVectors which differ by a permutation of their elements do not yield the same ParamAttrsList, though they should. On the other hand, everyone seems to pass such vectors with elements ordered by increasing index, so rather than sorting the elements simply assert that the elements are ordered in this way.
Modified: llvm/trunk/lib/VMCore/Function.cpp Modified: llvm/trunk/lib/VMCore/Function.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=41845&r1=41844&r2=41845&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Function.cpp (original) +++ llvm/trunk/lib/VMCore/Function.cpp Tue Sep 11 09:40:04 2007 @@ -124,6 +124,10 @@ 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); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits