mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-18 11:24:01 +00:00
PR12696: Attribute bits above 1<<30 are not encoded in bitcode
Attribute bits above 1<<30 are now encoded correctly. Additionally, the encoding/decoding functionality has been hoisted to helper functions in Attributes.h in an effort to help the encoding/decoding to stay in sync with the Attribute bitcode definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157581 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -463,20 +463,8 @@ bool BitcodeReader::ParseAttributeBlock() {
|
||||
return Error("Invalid ENTRY record");
|
||||
|
||||
for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
|
||||
// FIXME: remove in LLVM 3.0
|
||||
// The alignment is stored as a 16-bit raw value from bits 31--16.
|
||||
// We shift the bits above 31 down by 11 bits.
|
||||
|
||||
unsigned Alignment = (Record[i+1] & (0xffffull << 16)) >> 16;
|
||||
if (Alignment && !isPowerOf2_32(Alignment))
|
||||
return Error("Alignment is not a power of two.");
|
||||
|
||||
Attributes ReconstitutedAttr(Record[i+1] & 0xffff);
|
||||
if (Alignment)
|
||||
ReconstitutedAttr |= Attribute::constructAlignmentFromInt(Alignment);
|
||||
ReconstitutedAttr |=
|
||||
Attributes((Record[i+1] & (0xffffull << 32)) >> 11);
|
||||
|
||||
Attributes ReconstitutedAttr =
|
||||
Attribute::decodeLLVMAttributesForBitcode(Record[i+1]);
|
||||
Record[i+1] = ReconstitutedAttr.Raw();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user