diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-12-19 09:38:31 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-12-19 09:38:31 +0000 |
commit | 8d69f488331dbfebdb425d9ef3c03ab9bc655143 (patch) | |
tree | e1cac432682cf043d9c6768b1c5aada4a359f2a6 /llvm/lib/Bitcode/Reader | |
parent | 2abb108f1b92ffa60dd8a89d3c90eddabb5ea76f (diff) | |
download | bcm5719-llvm-8d69f488331dbfebdb425d9ef3c03ab9bc655143.tar.gz bcm5719-llvm-8d69f488331dbfebdb425d9ef3c03ab9bc655143.zip |
Commit missed files from nocapture change.
llvm-svn: 61240
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index f06c61de415..2d994d4b13d 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -362,6 +362,20 @@ bool BitcodeReader::ParseAttributeBlock() { Attributes RetAttribute = Attribute::None; Attributes FnAttribute = Attribute::None; 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 |= (Record[i+1] & (0xffffull << 32)) >> 11; + Record[i+1] = ReconstitutedAttr; + if (Record[i] == 0) RetAttribute = Record[i+1]; else if (Record[i] == ~0U) |