summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorMeador Inge <meadori@gmail.com>2012-05-28 15:45:43 +0000
committerMeador Inge <meadori@gmail.com>2012-05-28 15:45:43 +0000
commite17b69a3734ea08677684bf0e66003552f2e06f4 (patch)
tree333a2bdb7854e8104c4d77859c2dfaf3e5b71b42 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentdb892de5816789614e864503aa296a9c76c344b6 (diff)
downloadbcm5719-llvm-e17b69a3734ea08677684bf0e66003552f2e06f4.tar.gz
bcm5719-llvm-e17b69a3734ea08677684bf0e66003552f2e06f4.zip
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. llvm-svn: 157581
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 2b98f01e583..0e78dce6afe 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -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();
}
OpenPOWER on IntegriCloud