remove the MAI argument to MCExpr::print and switch overthing to use << when printing them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93699 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index 9e8c7ce..4768c62 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -118,9 +118,7 @@
   assert((Symbol->isUndefined() || Symbol->isAbsolute()) &&
          "Cannot define a symbol twice!");
 
-  OS << *Symbol << " = ";
-  Value->print(OS, &MAI);
-  OS << '\n';
+  OS << *Symbol << " = " << *Value << '\n';
 
   // FIXME: Lift context changes into super class.
   // FIXME: Set associated section.
@@ -194,9 +192,7 @@
   case 8: OS << ".quad"; break;
   }
 
-  OS << ' ';
-  truncateToSize(Value, Size)->print(OS, &MAI);
-  OS << '\n';
+  OS << ' ' << *truncateToSize(Value, Size) << '\n';
 }
 
 void MCAsmStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
@@ -250,9 +246,7 @@
 void MCAsmStreamer::EmitValueToOffset(const MCExpr *Offset,
                                       unsigned char Value) {
   // FIXME: Verify that Offset is associated with the current section.
-  OS << ".org ";
-  Offset->print(OS, &MAI);
-  OS << ", " << (unsigned) Value << '\n';
+  OS << ".org " << *Offset << ", " << (unsigned) Value << '\n';
 }
 
 void MCAsmStreamer::EmitInstruction(const MCInst &Inst) {
diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp
index 57d02c9..1ee1b1b 100644
--- a/lib/MC/MCExpr.cpp
+++ b/lib/MC/MCExpr.cpp
@@ -15,7 +15,7 @@
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
 
-void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
+void MCExpr::print(raw_ostream &OS) const {
   switch (getKind()) {
   case MCExpr::Constant:
     OS << cast<MCConstantExpr>(*this).getValue();
@@ -42,7 +42,7 @@
     case MCUnaryExpr::Not:   OS << '~'; break;
     case MCUnaryExpr::Plus:  OS << '+'; break;
     }
-    UE.getSubExpr()->print(OS, MAI);
+    OS << *UE.getSubExpr();
     return;
   }
 
@@ -51,11 +51,9 @@
     
     // Only print parens around the LHS if it is non-trivial.
     if (isa<MCConstantExpr>(BE.getLHS()) || isa<MCSymbolRefExpr>(BE.getLHS())) {
-      BE.getLHS()->print(OS, MAI);
+      OS << *BE.getLHS();
     } else {
-      OS << '(';
-      BE.getLHS()->print(OS, MAI);
-      OS << ')';
+      OS << '(' << *BE.getLHS() << ')';
     }
     
     switch (BE.getOpcode()) {
@@ -92,11 +90,9 @@
     
     // Only print parens around the LHS if it is non-trivial.
     if (isa<MCConstantExpr>(BE.getRHS()) || isa<MCSymbolRefExpr>(BE.getRHS())) {
-      BE.getRHS()->print(OS, MAI);
+      OS << *BE.getRHS();
     } else {
-      OS << '(';
-      BE.getRHS()->print(OS, MAI);
-      OS << ')';
+      OS << '(' << *BE.getRHS() << ')';
     }
     return;
   }
@@ -106,7 +102,7 @@
 }
 
 void MCExpr::dump() const {
-  print(dbgs(), 0);
+  print(dbgs());
   dbgs() << '\n';
 }
 
diff --git a/lib/MC/MCInst.cpp b/lib/MC/MCInst.cpp
index 7c7a644..0634c9f 100644
--- a/lib/MC/MCInst.cpp
+++ b/lib/MC/MCInst.cpp
@@ -23,9 +23,7 @@
   else if (isImm())
     OS << "Imm:" << getImm();
   else if (isExpr()) {
-    OS << "Expr:(";
-    getExpr()->print(OS, MAI);
-    OS << ")";
+    OS << "Expr:(" << *getExpr() << ")";
   } else
     OS << "UNDEFINED";
   OS << ">";