From 71847813bc419f7a0667468136a07429c6d9f164 Mon Sep 17 00:00:00 2001 From: David Greene Date: Tue, 14 Jul 2009 20:18:05 +0000 Subject: 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 --- lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp | 6 +++--- lib/Target/Mips/Mips.h | 4 ++-- lib/Target/Mips/MipsTargetMachine.cpp | 2 +- lib/Target/Mips/MipsTargetMachine.h | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/Target/Mips') diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp index 55f3378b9f..719c258647 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 using namespace llvm; @@ -51,7 +51,7 @@ namespace { 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(); @@ -91,7 +91,7 @@ namespace { /// 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 9b22a91b16..c1d6fdda51 100644 --- a/lib/Target/Mips/Mips.h +++ b/lib/Target/Mips/Mips.h @@ -21,11 +21,11 @@ namespace llvm { 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 4675536ce2..1e6add4a54 100644 --- a/lib/Target/Mips/MipsTargetMachine.cpp +++ b/lib/Target/Mips/MipsTargetMachine.cpp @@ -131,7 +131,7 @@ addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel) // 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 95e5be40f7..7dd8d2befa 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 @@ namespace llvm { // 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 @@ namespace llvm { 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. -- cgit v1.2.3