correct the fixup comment printer to work on big endian platforms.

llvm-svn: 119122
This commit is contained in:
Chris Lattner 2010-11-15 05:56:19 +00:00
parent 6eb2a0b277
commit 3b5f2a871a

View File

@ -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