[llvm-commits] [llvm] r123403 - /llvm/trunk/lib/MC/MCAsmStreamer.cpp

Evan Cheng evan.cheng at apple.com
Thu Jan 13 13:45:26 PST 2011


Author: evancheng
Date: Thu Jan 13 15:45:26 2011
New Revision: 123403

URL: http://llvm.org/viewvc/llvm-project?rev=123403&view=rev
Log:
Relax an assertion. On archs like ARM, an immediate field may be scattered. So it's possible for some bits of every 8 bits to be encoded already, and the rest still needs to be fixed up.

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=123403&r1=123402&r2=123403&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Thu Jan 13 15:45:26 2011
@@ -824,8 +824,12 @@
       if (MapEntry == 0) {
         OS << format("0x%02x", uint8_t(Code[i]));
       } else {
-        assert(Code[i] == 0 && "Encoder wrote into fixed up bit!");
-        OS << char('A' + MapEntry - 1);
+        if (Code[i]) {
+          // some of the 8 bits require fix up.
+          OS << format("0x%02x", uint8_t(Code[i])) << '\''
+             << char('A' + MapEntry - 1) << '\'';
+        } else
+          OS << char('A' + MapEntry - 1);
       }
     } else {
       // Otherwise, write out in binary.





More information about the llvm-commits mailing list