aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-09-11 14:40:04 +0000
committerDuncan Sands <baldrick@free.fr>2007-09-11 14:40:04 +0000
commit7843d819815679d25b0a6072c1285d7377f4e324 (patch)
treed5ca2c0d5f0f4d8abea82103da0b5a85d8ca285b /lib
parentcf7ecaaf8fb86d7c108a283f792aaf65ed68f69b (diff)
downloadexternal_llvm-7843d819815679d25b0a6072c1285d7377f4e324.zip
external_llvm-7843d819815679d25b0a6072c1285d7377f4e324.tar.gz
external_llvm-7843d819815679d25b0a6072c1285d7377f4e324.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Function.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index a4bc69b4..3582b32 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -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);