aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-01-13 21:45:26 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-01-13 21:45:26 +0000
commit82caf1a867852010ae70dee04989609e25e72856 (patch)
tree6e31e609926d95ccabeb7fe3c400cda20dfac59b /lib/MC
parenta6ada9f725b0015c419a7ef661e833f9e9b26ff8 (diff)
downloadexternal_llvm-82caf1a867852010ae70dee04989609e25e72856.zip
external_llvm-82caf1a867852010ae70dee04989609e25e72856.tar.gz
external_llvm-82caf1a867852010ae70dee04989609e25e72856.tar.bz2
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCAsmStreamer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index f8c3a8a..1095724 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -824,8 +824,12 @@ void MCAsmStreamer::AddEncodingComment(const MCInst &Inst) {
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.