diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-08 17:07:35 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-08 17:07:35 +0000 |
commit | 24ac479a7d0e583bb39295baf494f49cc9f1dac3 (patch) | |
tree | f30c7c8643cb6fae8e05b9058ffa20e0ea800d5c /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 9e5585dd82832edc0a8bc6835a272a77c1c16eef (diff) | |
download | bcm5719-llvm-24ac479a7d0e583bb39295baf494f49cc9f1dac3.tar.gz bcm5719-llvm-24ac479a7d0e583bb39295baf494f49cc9f1dac3.zip |
remove autoupgrade code for old function attributes format.
I still left another fixme regarding alignment, because I'm unsure how to remove that code without breaking things
llvm-svn: 156387
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 99542ec8bec..040f3438fe9 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -458,12 +458,6 @@ bool BitcodeReader::ParseAttributeBlock() { if (Record.size() & 1) return Error("Invalid ENTRY record"); - // FIXME : Remove this autoupgrade code in LLVM 3.0. - // If Function attributes are using index 0 then transfer them - // to index ~0. Index 0 is used for return value attributes but used to be - // used for function attributes. - Attributes RetAttribute; - Attributes FnAttribute; for (unsigned i = 0, e = Record.size(); i != e; i += 2) { // FIXME: remove in LLVM 3.0 // The alignment is stored as a 16-bit raw value from bits 31--16. @@ -480,34 +474,10 @@ bool BitcodeReader::ParseAttributeBlock() { Attributes((Record[i+1] & (0xffffull << 32)) >> 11); Record[i+1] = ReconstitutedAttr.Raw(); - if (Record[i] == 0) - RetAttribute = ReconstitutedAttr; - else if (Record[i] == ~0U) - FnAttribute = ReconstitutedAttr; - } - - Attributes OldRetAttrs = (Attribute::NoUnwind|Attribute::NoReturn| - Attribute::ReadOnly|Attribute::ReadNone); - - if (FnAttribute == Attribute::None && RetAttribute != Attribute::None && - (RetAttribute & OldRetAttrs)) { - if (FnAttribute == Attribute::None) { // add a slot so they get added. - Record.push_back(~0U); - Record.push_back(0); - } - - FnAttribute |= RetAttribute & OldRetAttrs; - RetAttribute &= ~OldRetAttrs; } for (unsigned i = 0, e = Record.size(); i != e; i += 2) { - if (Record[i] == 0) { - if (RetAttribute != Attribute::None) - Attrs.push_back(AttributeWithIndex::get(0, RetAttribute)); - } else if (Record[i] == ~0U) { - if (FnAttribute != Attribute::None) - Attrs.push_back(AttributeWithIndex::get(~0U, FnAttribute)); - } else if (Attributes(Record[i+1]) != Attribute::None) + if (Attributes(Record[i+1]) != Attribute::None) Attrs.push_back(AttributeWithIndex::get(Record[i], Attributes(Record[i+1]))); } |