summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.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/Bitcode/Reader/BitcodeReader.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/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index aa78e7c4dc0..119a583358e 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -232,17 +232,15 @@ bool BitcodeReader::ParseParamAttrBlock() {
if (Record.size() & 1)
return Error("Invalid ENTRY record");
- ParamAttrsWithIndex PAWI;
for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
- PAWI.index = Record[i];
- PAWI.attrs = Record[i+1];
- Attrs.push_back(PAWI);
+ if (Record[i+1] != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(Record[i], Record[i+1]));
}
- ParamAttrs.push_back(ParamAttrsList::get(Attrs));
+ ParamAttrs.push_back(Attrs.empty() ? NULL : ParamAttrsList::get(Attrs));
Attrs.clear();
break;
}
- }
+ }
}
}
OpenPOWER on IntegriCloud