Hi Nuno,<div><br></div><div>Would you please revert this change as well?</div><div><br></div><div>Thanks,</div><div>Steve<br><br><div class="gmail_quote">On Tue, May 8, 2012 at 10:07 AM, Nuno Lopes <span dir="ltr"><<a href="mailto:nunoplopes@sapo.pt" target="_blank">nunoplopes@sapo.pt</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: nlopes<br>
Date: Tue May  8 12:07:35 2012<br>
New Revision: 156387<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=156387&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=156387&view=rev</a><br>
Log:<br>
remove autoupgrade code for old function attributes format.<br>
I still left another fixme regarding alignment, because I'm unsure how to remove that code without breaking things<br>
<br>
Modified:<br>
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
<br>
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=156387&r1=156386&r2=156387&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=156387&r1=156386&r2=156387&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)<br>
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue May  8 12:07:35 2012<br>
@@ -458,12 +458,6 @@<br>
       if (Record.size() & 1)<br>
         return Error("Invalid ENTRY record");<br>
<br>
-      // FIXME : Remove this autoupgrade code in LLVM 3.0.<br>
-      // If Function attributes are using index 0 then transfer them<br>
-      // to index ~0. Index 0 is used for return value attributes but used to be<br>
-      // used for function attributes.<br>
-      Attributes RetAttribute;<br>
-      Attributes FnAttribute;<br>
       for (unsigned i = 0, e = Record.size(); i != e; i += 2) {<br>
         // FIXME: remove in LLVM 3.0<br>
         // The alignment is stored as a 16-bit raw value from bits 31--16.<br>
@@ -480,34 +474,10 @@<br>
             Attributes((Record[i+1] & (0xffffull << 32)) >> 11);<br>
<br>
         Record[i+1] = ReconstitutedAttr.Raw();<br>
-        if (Record[i] == 0)<br>
-          RetAttribute = ReconstitutedAttr;<br>
-        else if (Record[i] == ~0U)<br>
-          FnAttribute = ReconstitutedAttr;<br>
-      }<br>
-<br>
-      Attributes OldRetAttrs = (Attribute::NoUnwind|Attribute::NoReturn|<br>
-                              Attribute::ReadOnly|Attribute::ReadNone);<br>
-<br>
-      if (FnAttribute == Attribute::None && RetAttribute != Attribute::None &&<br>
-          (RetAttribute & OldRetAttrs)) {<br>
-        if (FnAttribute == Attribute::None) { // add a slot so they get added.<br>
-          Record.push_back(~0U);<br>
-          Record.push_back(0);<br>
-        }<br>
-<br>
-        FnAttribute  |= RetAttribute & OldRetAttrs;<br>
-        RetAttribute &= ~OldRetAttrs;<br>
       }<br>
<br>
       for (unsigned i = 0, e = Record.size(); i != e; i += 2) {<br>
-        if (Record[i] == 0) {<br>
-          if (RetAttribute != Attribute::None)<br>
-            Attrs.push_back(AttributeWithIndex::get(0, RetAttribute));<br>
-        } else if (Record[i] == ~0U) {<br>
-          if (FnAttribute != Attribute::None)<br>
-            Attrs.push_back(AttributeWithIndex::get(~0U, FnAttribute));<br>
-        } else if (Attributes(Record[i+1]) != Attribute::None)<br>
+        if (Attributes(Record[i+1]) != Attribute::None)<br>
           Attrs.push_back(AttributeWithIndex::get(Record[i],<br>
                                                   Attributes(Record[i+1])));<br>
       }<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>