[PATCH] Make .bc en/decoding of AttrKind stable
Tobias Grosser
tobias at grosser.es
Wed Jul 17 15:54:33 PDT 2013
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?
Cheers,
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/20130717/7e1a6c85/attachment.patch>
More information about the llvm-commits
mailing list