[llvm-commits] [llvm] r151844 - in /llvm/trunk: lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp test/MC/Disassembler/ARM/invalid-IT-CC15.txt
Kevin Enderby
enderby at apple.com
Thu Mar 1 14:13:02 PST 2012
Author: enderby
Date: Thu Mar 1 16:13:02 2012
New Revision: 151844
URL: http://llvm.org/viewvc/llvm-project?rev=151844&view=rev
Log:
Change ARMInstPrinter::printPredicateOperand() so it will not abort if it
runs into the undefined 15 condition code value.
Added:
llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt
Modified:
llvm/trunk/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
Modified: llvm/trunk/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp?rev=151844&r1=151843&r2=151844&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp Thu Mar 1 16:13:02 2012
@@ -692,7 +692,10 @@
void ARMInstPrinter::printPredicateOperand(const MCInst *MI, unsigned OpNum,
raw_ostream &O) {
ARMCC::CondCodes CC = (ARMCC::CondCodes)MI->getOperand(OpNum).getImm();
- if (CC != ARMCC::AL)
+ // Handle the undefined 15 CC value here for printing so we don't abort().
+ if ((unsigned)CC == 15)
+ O << "<und>";
+ else if (CC != ARMCC::AL)
O << ARMCondCodeToString(CC);
}
Added: llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt?rev=151844&view=auto
==============================================================================
--- llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt (added)
+++ llvm/trunk/test/MC/Disassembler/ARM/invalid-IT-CC15.txt Thu Mar 1 16:13:02 2012
@@ -0,0 +1,18 @@
+# RUN: llvm-mc --disassemble %s -triple=thumbv7-unknown-unknown |& grep und
+# rdar://10841671
+
+0xe3 0xbf
+0xdf 0xed 0x61 0x3b
+0x71 0xee 0xe0 0x1b
+0x72 0xee 0xa3 0x2b
+0xdf 0xed 0x60 0x0b
+
+# This is test is dealing with a undefined condition code value of 15 in the
+# above sequence of junk bytes and not allowing the disassembler to abort on
+# printing the final instruction in this list.
+#
+# ittte al
+# vldr d19, [pc, #388]
+# vsub.f64 d17, d17, d16
+# vadd.f64 d18, d18, d19
+# vldr<und> d16, [pc, #384]
More information about the llvm-commits
mailing list