diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2008-12-15 07:29:55 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2008-12-15 07:29:55 +0000 |
| commit | 7ed87ee8dcf458e711fd71f38044100b195dd359 (patch) | |
| tree | 828ac242a7b39968f41a3bd9a76c0b5346eb12b0 /lib/Bitcode | |
| parent | 412f92f5180f1e49de0e7262ec1b7e97b2447c60 (diff) | |
| download | external_llvm-7ed87ee8dcf458e711fd71f38044100b195dd359.zip external_llvm-7ed87ee8dcf458e711fd71f38044100b195dd359.tar.gz external_llvm-7ed87ee8dcf458e711fd71f38044100b195dd359.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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
| -rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 0555ed9..adf49a5 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/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); |
