aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-15 05:56:19 +0000
committerChris Lattner <sabre@nondot.org>2010-11-15 05:56:19 +0000
commit3170a3bc04deadfc0a4de5ff3cba7680be548f29 (patch)
tree6afd09a21d17f080223259b8e514fb18ca82484e /lib
parent7192eb873201ff201681fefd1f5bf6ca2b2bc98e (diff)
downloadexternal_llvm-3170a3bc04deadfc0a4de5ff3cba7680be548f29.zip
external_llvm-3170a3bc04deadfc0a4de5ff3cba7680be548f29.tar.gz
external_llvm-3170a3bc04deadfc0a4de5ff3cba7680be548f29.tar.bz2
correct the fixup comment printer to work on big endian platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MCAsmStreamer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index 4f7e199..021873c 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -692,7 +692,14 @@ void MCAsmStreamer::AddEncodingComment(const MCInst &Inst) {
OS << "0b";
for (unsigned j = 8; j--;) {
unsigned Bit = (Code[i] >> j) & 1;
- if (uint8_t MapEntry = FixupMap[i * 8 + j]) {
+
+ unsigned FixupBit;
+ if (IsLittleEndian)
+ FixupBit = i * 8 + j;
+ else
+ FixupBit = i * 8 + (7-j);
+
+ if (uint8_t MapEntry = FixupMap[FixupBit]) {
assert(Bit == 0 && "Encoder wrote into fixed up bit!");
OS << char('A' + MapEntry - 1);
} else