summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Function.cpp
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
commitd781335d3935d4d95ed24581abb26276bef6cce4 (patch)
tree20db45a9e1d27efd537a05bf95dec43e581c37f4 /llvm/lib/VMCore/Function.cpp
parent9204663bcb70cf60a9ef7ce4d29758401fe91288 (diff)
downloadbcm5719-llvm-d781335d3935d4d95ed24581abb26276bef6cce4.tar.gz
bcm5719-llvm-d781335d3935d4d95ed24581abb26276bef6cce4.zip
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. llvm-svn: 41845
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r--llvm/lib/VMCore/Function.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index a4bc69b4721..3582b321504 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud