aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-12-15 07:29:55 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-12-15 07:29:55 +0000
commit8d2ea18346b1f6aef13410424f2a686ffc631108 (patch)
tree952fd307c7be6f05e2687dc7c07058e726d5c215 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentac4e120912ebcc3a1eeebaabaf4d4b842431142c (diff)
downloadllvm-8d2ea18346b1f6aef13410424f2a686ffc631108.zip
llvm-8d2ea18346b1f6aef13410424f2a686ffc631108.tar.gz
llvm-8d2ea18346b1f6aef13410424f2a686ffc631108.tar.bz2
It turns out that "align 1" and unaligned are different. Add a bias to the
alignment attribute such that 0 means unaligned. This will probably require a rebuild of llvm-gcc because of the change to Attributes.h. If you see many test failures on "make check", please rebuild your llvm-gcc. llvm-svn: 61030
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 0555ed9..adf49a52 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -128,7 +128,8 @@ static void WriteAttributeTable(const ValueEnumerator &VE,
// 5-bit log2 encoded value. Shift the bits above the alignment up by
// 11 bits.
uint64_t FauxAttr = PAWI.Attrs & 0xffff;
- FauxAttr |= (1ull<<16)<<((PAWI.Attrs & Attribute::Alignment) >> 16);
+ if (PAWI.Attrs & Attribute::Alignment)
+ FauxAttr |= (1ull<<16)<<(((PAWI.Attrs & Attribute::Alignment)-1) >> 16);
FauxAttr |= (PAWI.Attrs & (0x3FFull << 21)) << 11;
Record.push_back(FauxAttr);