add support for instruction predicates.
authorChris Lattner <sabre@nondot.org>
Tue, 20 Oct 2009 00:42:49 +0000 (00:42 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 20 Oct 2009 00:42:49 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84575 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
lib/Target/ARM/AsmPrinter/ARMInstPrinter.h

index abb0399fa456590dced56748f78f47f7cc2377e8..65c541472874236354a2d101f9c08f9c6a708a1b 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #define DEBUG_TYPE "asm-printer"
+#include "ARM.h" // FIXME: FACTOR ENUMS BETTER.
 #include "ARMInstPrinter.h"
 #include "ARMAddressingModes.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCExpr.h"
 #include "llvm/Support/raw_ostream.h"
-#include "ARMGenInstrNames.inc"
-#include "ARMGenRegisterNames.inc"
 using namespace llvm;
 
 // Include the auto-generated portion of the assembly writer.
@@ -181,6 +180,12 @@ void ARMInstPrinter::printRegisterList(const MCInst *MI, unsigned OpNum) {
   O << "}";
 }
 
+void ARMInstPrinter::printPredicateOperand(const MCInst *MI, unsigned OpNum) {
+  ARMCC::CondCodes CC = (ARMCC::CondCodes)MI->getOperand(OpNum).getImm();
+  if (CC != ARMCC::AL)
+    O << ARMCondCodeToString(CC);
+}
+
 
 void ARMInstPrinter::printCPInstOperand(const MCInst *MI, unsigned OpNum,
                                         const char *Modifier) {
index 99388e0d6c567098696b357e56751b7a6b7db604..332addea921a7140a5ac40423f1e031ca8cb6edb 100644 (file)
@@ -68,7 +68,7 @@ public:
   void printT2AddrModeImm8OffsetOperand(const MCInst *MI, unsigned OpNum) {}
   void printT2AddrModeSoRegOperand(const MCInst *MI, unsigned OpNum) {}
   
-  void printPredicateOperand(const MCInst *MI, unsigned OpNum) {}
+  void printPredicateOperand(const MCInst *MI, unsigned OpNum);
   void printSBitModifierOperand(const MCInst *MI, unsigned OpNum) {}
   void printRegisterList(const MCInst *MI, unsigned OpNum);
   void printCPInstOperand(const MCInst *MI, unsigned OpNum,