[PATCH] Make .bc en/decoding of AttrKind stable

Tobias Grosser tobias at grosser.es
Tue Jul 23 14:06:49 PDT 2013


On 07/17/2013 03:54 PM, Tobias Grosser wrote:
> Hi,
>
> I would like to commit the following patch:
>
> ----------------------
> Make .bc en/decoding of AttrKind stable
>
> 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.
>
> 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.
>
> Bonus: Dropping bitcode attributes from AttrKind is now easy, as old
> AttrKinds do not need to be kept to support the Bitcode reader.
> ----------------------
>
> I also considered assigning fixed numbers directly in the AttrKind enum
> (or keeping the enum stable), but convinced myself that the bitcode
> encoding should really not part of the IR interface.
>
> OK to commit?

Ping.

Bill, this addresses a problem that was introduced with your attribute 
refactoring. Would you mind having a look at this patch?

Thanks,
Tobias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-.bc-en-decoding-of-AttrKind-stable.patch
Type: text/x-diff
Size: 18434 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130723/a629b00c/attachment.patch>


More information about the llvm-commits mailing list