From 04eb67e69abe9b03295d092add225e65fee04ed9 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 20 Nov 2007 14:09:29 +0000 Subject: =?UTF-8?q?In=20order=20for=20parameter=20attribute=20uniquing=20t?= =?UTF-8?q?o=20make=20any=20sense=20it=20is=20important=20that=20ParamAttr?= =?UTF-8?q?::None=20gets=20treated=20the=20same=20as=20not=20supplying=20a?= =?UTF-8?q?n=20attribute=20at=20all.=20=20Rather=20than=20stripping=20Para?= =?UTF-8?q?mAttr::None=20out=20of=20the=20list=20of=20attributes,=20assert?= =?UTF-8?q?=20if=20ParamAttr::None=20is=20seen.=20=20Fix=20up=20the=20bitc?= =?UTF-8?q?ode=20reader=20which=20liked=20to=20insert=20ParamAttr::None=20?= =?UTF-8?q?all=20over=20the=20place.=20=20Patch=20based=20on=20one=20by=20?= =?UTF-8?q?T=C3=B6r=C3=B6k=20Edwin.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit llvm-svn: 44250 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index aa78e7c..119a583 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; } - } + } } } -- cgit v1.1