Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75670 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
index 55f3378..719c2586 100644
--- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
@@ -39,8 +39,8 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/Support/raw_ostream.h"
 #include <cctype>
 
 using namespace llvm;
@@ -51,7 +51,7 @@
   class VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter {
     const MipsSubtarget *Subtarget;
   public:
-    explicit MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM, 
+    explicit MipsAsmPrinter(formatted_raw_ostream &O, MipsTargetMachine &TM, 
                             const TargetAsmInfo *T, bool V)
       : AsmPrinter(O, TM, T, V) {
       Subtarget = &TM.getSubtarget<MipsSubtarget>();
@@ -91,7 +91,7 @@
 /// assembly code for a MachineFunction to the given output stream,
 /// using the given target machine description.  This should work
 /// regardless of whether the function is in SSA form.
-FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o,
+FunctionPass *llvm::createMipsCodePrinterPass(formatted_raw_ostream &o,
                                               MipsTargetMachine &tm,
                                               bool verbose) {
   return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose);
diff --git a/lib/Target/Mips/Mips.h b/lib/Target/Mips/Mips.h
index 9b22a91..c1d6fdd 100644
--- a/lib/Target/Mips/Mips.h
+++ b/lib/Target/Mips/Mips.h
@@ -21,11 +21,11 @@
   class MipsTargetMachine;
   class FunctionPass;
   class MachineCodeEmitter;
-  class raw_ostream;
+  class formatted_raw_ostream;
 
   FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
   FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
-  FunctionPass *createMipsCodePrinterPass(raw_ostream &OS, 
+  FunctionPass *createMipsCodePrinterPass(formatted_raw_ostream &OS, 
                                           MipsTargetMachine &TM,
                                           bool Verbose);
 } // end namespace llvm;
diff --git a/lib/Target/Mips/MipsTargetMachine.cpp b/lib/Target/Mips/MipsTargetMachine.cpp
index 4675536..1e6add4 100644
--- a/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/lib/Target/Mips/MipsTargetMachine.cpp
@@ -131,7 +131,7 @@
 // true if AssemblyEmitter is supported
 bool MipsTargetMachine::
 addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel, 
-                   bool Verbose, raw_ostream &Out)  {
+                   bool Verbose, formatted_raw_ostream &Out)  {
   // Output assembly language.
   assert(AsmPrinterCtor && "AsmPrinter was not linked in");
   PM.add(AsmPrinterCtor(Out, *this, Verbose));
diff --git a/lib/Target/Mips/MipsTargetMachine.h b/lib/Target/Mips/MipsTargetMachine.h
index 95e5be4..7dd8d2b 100644
--- a/lib/Target/Mips/MipsTargetMachine.h
+++ b/lib/Target/Mips/MipsTargetMachine.h
@@ -22,7 +22,7 @@
 #include "llvm/Target/TargetFrameInfo.h"
 
 namespace llvm {
-  class raw_ostream;
+  class formatted_raw_ostream;
   
   class MipsTargetMachine : public LLVMTargetMachine {
     MipsSubtarget       Subtarget;
@@ -37,7 +37,7 @@
     // To avoid having target depend on the asmprinter stuff libraries,
     // asmprinter set this functions to ctor pointer at startup time if they are
     // linked in.
-    typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
+    typedef FunctionPass *(*AsmPrinterCtorFn)(formatted_raw_ostream &o,
                                               MipsTargetMachine &tm,
                                               bool verbose);
     static AsmPrinterCtorFn AsmPrinterCtor;
@@ -75,7 +75,7 @@
                                 CodeGenOpt::Level OptLevel);
     virtual bool addAssemblyEmitter(PassManagerBase &PM,
                                     CodeGenOpt::Level OptLevel,
-                                    bool Verbose, raw_ostream &Out);
+                                    bool Verbose, formatted_raw_ostream &Out);
   };
 
 /// MipselTargetMachine - Mipsel target machine.