diff options
| author | David Greene <greened@obbligato.org> | 2009-07-14 20:18:05 +0000 |
|---|---|---|
| committer | David Greene <greened@obbligato.org> | 2009-07-14 20:18:05 +0000 |
| commit | 302008dbeae03364ffffc1bcf77d2eb28897d98a (patch) | |
| tree | 6cd09f8ff7f7b28b32c364fb6f63f44e85937880 /lib/Target/XCore | |
| parent | 6e30ad8ce7be319ef4f30bc9163e0b736537f846 (diff) | |
| download | external_llvm-302008dbeae03364ffffc1bcf77d2eb28897d98a.zip external_llvm-302008dbeae03364ffffc1bcf77d2eb28897d98a.tar.gz external_llvm-302008dbeae03364ffffc1bcf77d2eb28897d98a.tar.bz2 | |
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
Diffstat (limited to 'lib/Target/XCore')
| -rw-r--r-- | lib/Target/XCore/XCore.h | 4 | ||||
| -rw-r--r-- | lib/Target/XCore/XCoreAsmPrinter.cpp | 9 | ||||
| -rw-r--r-- | lib/Target/XCore/XCoreTargetMachine.cpp | 2 | ||||
| -rw-r--r-- | lib/Target/XCore/XCoreTargetMachine.h | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/lib/Target/XCore/XCore.h b/lib/Target/XCore/XCore.h index d95aab3..abc69b7 100644 --- a/lib/Target/XCore/XCore.h +++ b/lib/Target/XCore/XCore.h @@ -21,10 +21,10 @@ namespace llvm { class FunctionPass; class TargetMachine; class XCoreTargetMachine; - class raw_ostream; + class formatted_raw_ostream; FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM); - FunctionPass *createXCoreCodePrinterPass(raw_ostream &OS, + FunctionPass *createXCoreCodePrinterPass(formatted_raw_ostream &OS, XCoreTargetMachine &TM, bool Verbose); } // end namespace llvm; diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp index 5beefe6..6256c8a 100644 --- a/lib/Target/XCore/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/XCoreAsmPrinter.cpp @@ -33,8 +33,8 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/FormattedStream.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/raw_ostream.h" #include <algorithm> #include <cctype> using namespace llvm; @@ -58,7 +58,7 @@ namespace { DwarfWriter *DW; const XCoreSubtarget &Subtarget; public: - explicit XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM, + explicit XCoreAsmPrinter(formatted_raw_ostream &O, XCoreTargetMachine &TM, const TargetAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V), DW(0), Subtarget(*TM.getSubtargetImpl()) {} @@ -104,7 +104,7 @@ namespace { /// using the given target machine description. This should work /// regardless of whether the function is in SSA form. /// -FunctionPass *llvm::createXCoreCodePrinterPass(raw_ostream &o, +FunctionPass *llvm::createXCoreCodePrinterPass(formatted_raw_ostream &o, XCoreTargetMachine &tm, bool verbose) { return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), verbose); @@ -112,7 +112,8 @@ FunctionPass *llvm::createXCoreCodePrinterPass(raw_ostream &o, // PrintEscapedString - Print each character of the specified string, escaping // it if it is not printable or if it is an escape char. -static void PrintEscapedString(const std::string &Str, raw_ostream &Out) { +static void PrintEscapedString(const std::string &Str, + formatted_raw_ostream &Out) { for (unsigned i = 0, e = Str.size(); i != e; ++i) { unsigned char C = Str[i]; if (isprint(C) && C != '"' && C != '\\') { diff --git a/lib/Target/XCore/XCoreTargetMachine.cpp b/lib/Target/XCore/XCoreTargetMachine.cpp index b72225f..42b9875 100644 --- a/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/lib/Target/XCore/XCoreTargetMachine.cpp @@ -67,7 +67,7 @@ bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM, bool XCoreTargetMachine::addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel, bool Verbose, - raw_ostream &Out) { + formatted_raw_ostream &Out) { // Output assembly language. PM.add(createXCoreCodePrinterPass(Out, *this, Verbose)); return false; diff --git a/lib/Target/XCore/XCoreTargetMachine.h b/lib/Target/XCore/XCoreTargetMachine.h index 2385aed..081cf7a 100644 --- a/lib/Target/XCore/XCoreTargetMachine.h +++ b/lib/Target/XCore/XCoreTargetMachine.h @@ -55,7 +55,7 @@ public: virtual bool addInstSelector(PassManagerBase &PM, CodeGenOpt::Level OptLevel); virtual bool addAssemblyEmitter(PassManagerBase &PM, CodeGenOpt::Level OptLevel, - bool Verbose, raw_ostream &Out); + bool Verbose, formatted_raw_ostream &Out); }; } // end namespace llvm |
