diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-15 05:56:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-15 05:56:19 +0000 |
commit | 9e7d8c031323cd9ad89db69f0138ba6f979e47cb (patch) | |
tree | 21527b8ac0ae263955a9ab657981e4f8345ce933 /llvm/lib | |
parent | d6a07ccd10191c7060ebc04e53371bb383dc5863 (diff) | |
download | bcm5719-llvm-9e7d8c031323cd9ad89db69f0138ba6f979e47cb.tar.gz bcm5719-llvm-9e7d8c031323cd9ad89db69f0138ba6f979e47cb.zip |
correct the fixup comment printer to work on big endian platforms.
llvm-svn: 119122
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index 4f7e199507a..021873c2dba 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/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 |