aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-12-19 09:38:31 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-12-19 09:38:31 +0000
commit4029a949f3175e30040f782baa2fc31480972b3c (patch)
tree0a97ae74fa5aeee55b2ec9bf7ef6c2296a8d94b5 /lib/Bitcode/Reader/BitcodeReader.cpp
parent40fb6f2871aa68ff706156328e48eddd121b9722 (diff)
downloadexternal_llvm-4029a949f3175e30040f782baa2fc31480972b3c.zip
external_llvm-4029a949f3175e30040f782baa2fc31480972b3c.tar.gz
external_llvm-4029a949f3175e30040f782baa2fc31480972b3c.tar.bz2
Commit missed files from nocapture change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index f06c61d..2d994d4 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/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)