aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/XCore/XCoreAsmPrinter.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-07-14 20:18:05 +0000
committerDavid Greene <greened@obbligato.org>2009-07-14 20:18:05 +0000
commit71847813bc419f7a0667468136a07429c6d9f164 (patch)
tree6cd09f8ff7f7b28b32c364fb6f63f44e85937880 /lib/Target/XCore/XCoreAsmPrinter.cpp
parenta266b5f22811480a65e65a08c8a5d92fe9be8a3b (diff)
downloadexternal_llvm-71847813bc419f7a0667468136a07429c6d9f164.tar.gz
external_llvm-71847813bc419f7a0667468136a07429c6d9f164.tar.bz2
external_llvm-71847813bc419f7a0667468136a07429c6d9f164.zip
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/XCoreAsmPrinter.cpp')
-rw-r--r--lib/Target/XCore/XCoreAsmPrinter.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp
index 5beefe6ea6..6256c8a85c 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 != '\\') {