<div dir="ltr"><div>On 17 July 2013 15:54, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I would like to commit the following patch:<br>
<br>
----------------------<br>
Make .bc en/decoding of AttrKind stable<br>
<br>
The bitcode representation attribute kinds are encoded into / decoded from should be independent of the current set of LLVM attributes and their position in the AttrKind enum. This patch explicitly encodes attributes to fixed bitcode values.<br>


<br>
With this patch applied, LLVM does not silently misread attributes written by LLVM 3.3. We also enhance the decoding slightly such that an error message is printed if an unknown AttrKind encoding was dected.<br>
<br>
Bonus: Dropping bitcode attributes from AttrKind is now easy, as old AttrKinds do not need to be kept to support the Bitcode reader.<br>
----------------------<br>
<br>
I also considered assigning fixed numbers directly in the AttrKind enum (or keeping the enum stable), but convinced myself that the bitcode<br>
encoding should really not part of the IR interface.<br>
<br>
OK to commit?<br></blockquote><div><br></div><div>Thanks for working on this.</div><div><br></div><div><div>+  default:</div><div>+    return Error("Unknown attribute kind");</div></div><div><br></div><div>Any chance we could get the value of the attribute kind in there? I know, I know, but I forsee a future Nick debugging exactly this.</div>

<div><br></div><div>+; RUN:  llvm-dis < %s.bc| FileCheck %s<br></div><div><br></div><div>Space before pipe please. :)</div><div><br></div><div>LGTM. Thanks so much for the test, too!</div><div><br></div><div>Nick</div>

<div><br></div></div></div></div>