diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-21 00:14:44 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-21 00:14:44 +0000 |
commit | cb3718832375a581c5ea23f15918f3ea447a446c (patch) | |
tree | a72c740cc8590cd63825fcf08f71c5e2f625ca55 /lib/Target/X86 | |
parent | f4a97da4072a2ee4aca3c668a9fa113c06fdef8d (diff) | |
download | external_llvm-cb3718832375a581c5ea23f15918f3ea447a446c.zip external_llvm-cb3718832375a581c5ea23f15918f3ea447a446c.tar.gz external_llvm-cb3718832375a581c5ea23f15918f3ea447a446c.tar.bz2 |
Use raw_ostream throughout the AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55092 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 3 | ||||
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h | 2 | ||||
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86.h | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 7 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetMachine.h | 6 |
7 files changed, 16 insertions, 10 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 575762e..d154aaf 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -28,6 +28,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/Support/Mangler.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetOptions.h" using namespace llvm; @@ -84,7 +85,7 @@ static X86MachineFunctionInfo calculateFunctionInfo(const Function *F, /// PrintUnmangledNameSafely - Print out the printable characters in the name. /// Don't print things like \n or \0. -static void PrintUnmangledNameSafely(const Value *V, std::ostream &OS) { +static void PrintUnmangledNameSafely(const Value *V, raw_ostream &OS) { for (const char *Name = V->getNameStart(), *E = Name+V->getNameLen(); Name != E; ++Name) if (isprint(*Name)) diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h index 235c72e..87845fb 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h @@ -34,7 +34,7 @@ struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter { const X86Subtarget *Subtarget; - X86ATTAsmPrinter(std::ostream &O, X86TargetMachine &TM, + X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM, const TargetAsmInfo *T) : AsmPrinter(O, TM, T), DW(O, this, T), MMI(0) { Subtarget = &TM.getSubtarget<X86Subtarget>(); diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index 9b69264..ad4d12f 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -23,7 +23,7 @@ using namespace llvm; /// for a MachineFunction to the given output stream, using the given target /// machine description. /// -FunctionPass *llvm::createX86CodePrinterPass(std::ostream &o, +FunctionPass *llvm::createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm) { const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>(); diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h index faf26bd..3cb17fa 100644 --- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h @@ -20,11 +20,12 @@ #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/ADT/StringSet.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/raw_ostream.h" namespace llvm { struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter { - X86IntelAsmPrinter(std::ostream &O, X86TargetMachine &TM, + X86IntelAsmPrinter(raw_ostream &O, X86TargetMachine &TM, const TargetAsmInfo *T) : AsmPrinter(O, TM, T) { } diff --git a/lib/Target/X86/X86.h b/lib/Target/X86/X86.h index 2dd067a..a77542d 100644 --- a/lib/Target/X86/X86.h +++ b/lib/Target/X86/X86.h @@ -22,6 +22,7 @@ namespace llvm { class X86TargetMachine; class FunctionPass; class MachineCodeEmitter; +class raw_ostream; /// createX86ISelDag - This pass converts a legalized DAG into a /// X86-specific DAG, ready for instruction scheduling. @@ -38,7 +39,7 @@ FunctionPass *createX86FloatingPointStackifierPass(); /// assembly code for a MachineFunction to the given output stream, /// using the given target machine description. /// -FunctionPass *createX86CodePrinterPass(std::ostream &o, X86TargetMachine &tm); +FunctionPass *createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm); /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code /// to the specified MCE object. diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index ba3314c..5be5c5d 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -18,6 +18,7 @@ #include "llvm/PassManager.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/Passes.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetMachineRegistry.h" using namespace llvm; @@ -189,7 +190,7 @@ bool X86TargetMachine::addPostRegAlloc(PassManagerBase &PM, bool Fast) { } bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, - std::ostream &Out) { + raw_ostream &Out) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) PM.add(AsmPrinterCtor(Out, *this)); @@ -218,7 +219,7 @@ bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast, if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(*cerr.stream(), *this)); + PM.add(AsmPrinterCtor(errs(), *this)); } return false; @@ -230,7 +231,7 @@ bool X86TargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, if (DumpAsm) { assert(AsmPrinterCtor && "AsmPrinter was not linked in"); if (AsmPrinterCtor) - PM.add(AsmPrinterCtor(*cerr.stream(), *this)); + PM.add(AsmPrinterCtor(errs(), *this)); } return false; diff --git a/lib/Target/X86/X86TargetMachine.h b/lib/Target/X86/X86TargetMachine.h index 94b7566..13b391d 100644 --- a/lib/Target/X86/X86TargetMachine.h +++ b/lib/Target/X86/X86TargetMachine.h @@ -25,6 +25,8 @@ #include "X86ISelLowering.h" namespace llvm { + +class raw_ostream; class X86TargetMachine : public LLVMTargetMachine { X86Subtarget Subtarget; @@ -41,7 +43,7 @@ protected: // 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)(std::ostream &o, + typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o, X86TargetMachine &tm); static AsmPrinterCtorFn AsmPrinterCtor; @@ -75,7 +77,7 @@ public: virtual bool addPreRegAlloc(PassManagerBase &PM, bool Fast); virtual bool addPostRegAlloc(PassManagerBase &PM, bool Fast); virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast, - std::ostream &Out); + raw_ostream &Out); virtual bool addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE); virtual bool addSimpleCodeEmitter(PassManagerBase &PM, bool Fast, |