[llvm-commits] [llvm] r119122 - /llvm/trunk/lib/MC/MCAsmStreamer.cpp
Chris Lattner
sabre at nondot.org
Sun Nov 14 21:56:20 PST 2010
Author: lattner
Date: Sun Nov 14 23:56:19 2010
New Revision: 119122
URL: http://llvm.org/viewvc/llvm-project?rev=119122&view=rev
Log:
correct the fixup comment printer to work on big endian platforms.
Modified:
llvm/trunk/lib/MC/MCAsmStreamer.cpp
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=119122&r1=119121&r2=119122&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Sun Nov 14 23:56:19 2010
@@ -692,7 +692,14 @@
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
More information about the llvm-commits
mailing list