Sink COFF.h MC include into .cpp files
[oota-llvm.git] / lib / MC / MCInst.cpp
index ec97acc554f5786c85263523a67f4ecd58a02bf8..7ef69be66df64e07dd2f6ad20174b0ffd62d23fe 100644 (file)
@@ -15,7 +15,7 @@
 
 using namespace llvm;
 
-void MCOperand::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
+void MCOperand::print(raw_ostream &OS) const {
   OS << "<MCOperand ";
   if (!isValid())
     OS << "INVALID";
@@ -25,37 +25,30 @@ void MCOperand::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
     OS << "Imm:" << getImm();
   else if (isExpr()) {
     OS << "Expr:(" << *getExpr() << ")";
+  } else if (isInst()) {
+    OS << "Inst:(" << *getInst() << ")";
   } else
     OS << "UNDEFINED";
   OS << ">";
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void MCOperand::dump() const {
-  print(dbgs(), 0);
+  print(dbgs());
   dbgs() << "\n";
 }
+#endif
 
-void MCInst::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
+void MCInst::print(raw_ostream &OS) const {
   OS << "<MCInst " << getOpcode();
   for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
     OS << " ";
-    getOperand(i).print(OS, MAI);
+    getOperand(i).print(OS);
   }
-
-  if (getNumAnnotations()) {
-    OS << " # Annots: ";
-    for (unsigned i = 0, e = getNumAnnotations(); i != e; ++i) {
-      OS << " \"";
-      OS << getAnnotation(i);
-      OS << '"';
-    }
-  }
-
   OS << ">";
 }
 
-void MCInst::dump_pretty(raw_ostream &OS, const MCAsmInfo *MAI,
-                         const MCInstPrinter *Printer,
+void MCInst::dump_pretty(raw_ostream &OS, const MCInstPrinter *Printer,
                          StringRef Separator) const {
   OS << "<MCInst #" << getOpcode();
 
@@ -65,23 +58,14 @@ void MCInst::dump_pretty(raw_ostream &OS, const MCAsmInfo *MAI,
 
   for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
     OS << Separator;
-    getOperand(i).print(OS, MAI);
+    getOperand(i).print(OS);
   }
-
-  if (getNumAnnotations()) {
-    OS << " # Annots: ";
-    for (unsigned i = 0, e = getNumAnnotations(); i != e; ++i) {
-      OS << Separator;
-      OS << '"';
-      OS << getAnnotation(i);
-      OS << '"';
-    }
-  }
-
   OS << ">";
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
 void MCInst::dump() const {
-  print(dbgs(), 0);
+  print(dbgs());
   dbgs() << "\n";
 }
+#endif