New Attribute Group broke bitcode compatibility

Hi Bill,

I just looked a little more into the above problem and it seems the bitcode writer support for the new attribute code produces unstable bitcode. The problem is in BitcodeWriter.cpp, where the new WriteAttributeGroupTable() writes out the attributes using this piece of code:

         if (Attr.isEnumAttribute()) {
         } else if (Attr.isAlignAttribute()) {

getKindAsEnum() returns the actual value of the enum, which is then stored in the bitcode. This direct connection makes the bitcode dependent of the order of elements in the enum, which causes changes
like the above to break bitcode compatibility. Specifically, bitcode from LLVM 3.3 is currently incompatible to bitcode from LLVM trunk.

Do you have any plans to fix this or should I give it a shot?