summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Function.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-11-20 14:09:29 +0000
committerDuncan Sands <baldrick@free.fr>2007-11-20 14:09:29 +0000
commit04eb67e69abe9b03295d092add225e65fee04ed9 (patch)
treee0341d9e5f1aad887661a49a33195ba1c09cf116 /llvm/lib/VMCore/Function.cpp
parent74a26e375076e35ef02790c1c417689e1c6b1eba (diff)
downloadbcm5719-llvm-04eb67e69abe9b03295d092add225e65fee04ed9.tar.gz
bcm5719-llvm-04eb67e69abe9b03295d092add225e65fee04ed9.zip
In order for parameter attribute uniquing to make
any sense it is important that ParamAttr::None gets treated the same as not supplying an attribute at all. Rather than stripping ParamAttr::None out of the list of attributes, assert if ParamAttr::None is seen. Fix up the bitcode reader which liked to insert ParamAttr::None all over the place. Patch based on one by Török Edwin. llvm-svn: 44250
Diffstat (limited to 'llvm/lib/VMCore/Function.cpp')
-rw-r--r--llvm/lib/VMCore/Function.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index 3256d5b9f63..a011aaea338 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -129,8 +129,12 @@ 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!");
+ for (unsigned i = 0, e = attrVec.size(); i < e; ++i) {
+ assert(attrVec[i].attrs != ParamAttr::None
+ && "Pointless parameter attribute!");
+ assert((!i || attrVec[i-1].index < attrVec[i].index)
+ && "Misordered ParamAttrsList!");
+ }
#endif
ParamAttrsList key(attrVec);
FoldingSetNodeID ID;
OpenPOWER on IntegriCloud