diff options
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 5 | ||||
-rw-r--r-- | include/llvm/CodeGen/DwarfWriter.h | 3 | ||||
-rw-r--r-- | include/llvm/CodeGen/FileWriters.h | 5 | ||||
-rw-r--r-- | include/llvm/CodeGen/GCMetadataPrinter.h | 5 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 10 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineOperand.h | 7 |
6 files changed, 28 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index 5292153..08c3197 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -34,6 +34,7 @@ namespace llvm { class Mangler; class TargetAsmInfo; class Type; + class raw_ostream; /// AsmPrinter - This class is intended to be used as a driving class for all /// asm writers. @@ -64,7 +65,7 @@ namespace llvm { public: /// Output stream on which we're printing assembly code. /// - std::ostream &O; + raw_ostream &O; /// Target machine description. /// @@ -96,7 +97,7 @@ namespace llvm { bool IsInTextSection; protected: - AsmPrinter(std::ostream &o, TargetMachine &TM, const TargetAsmInfo *T); + AsmPrinter(raw_ostream &o, TargetMachine &TM, const TargetAsmInfo *T); public: virtual ~AsmPrinter(); diff --git a/include/llvm/CodeGen/DwarfWriter.h b/include/llvm/CodeGen/DwarfWriter.h index a0cfec7..981513b 100644 --- a/include/llvm/CodeGen/DwarfWriter.h +++ b/include/llvm/CodeGen/DwarfWriter.h @@ -31,6 +31,7 @@ class MachineModuleInfo; class MachineFunction; class Module; class TargetAsmInfo; +class raw_ostream; //===----------------------------------------------------------------------===// // DwarfWriter - Emits Dwarf debug and exception handling directives. @@ -48,7 +49,7 @@ private: public: - DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T); + DwarfWriter(raw_ostream &OS, AsmPrinter *A, const TargetAsmInfo *T); virtual ~DwarfWriter(); /// SetModuleInfo - Set machine module info when it's known that pass manager diff --git a/include/llvm/CodeGen/FileWriters.h b/include/llvm/CodeGen/FileWriters.h index ac66b9d..cb7aea4 100644 --- a/include/llvm/CodeGen/FileWriters.h +++ b/include/llvm/CodeGen/FileWriters.h @@ -21,10 +21,11 @@ namespace llvm { class PassManagerBase; class MachineCodeEmitter; class TargetMachine; + class raw_ostream; - MachineCodeEmitter *AddELFWriter(PassManagerBase &FPM, std::ostream &O, + MachineCodeEmitter *AddELFWriter(PassManagerBase &FPM, raw_ostream &O, TargetMachine &TM); - MachineCodeEmitter *AddMachOWriter(PassManagerBase &FPM, std::ostream &O, + MachineCodeEmitter *AddMachOWriter(PassManagerBase &FPM, raw_ostream &O, TargetMachine &TM); } // end llvm namespace diff --git a/include/llvm/CodeGen/GCMetadataPrinter.h b/include/llvm/CodeGen/GCMetadataPrinter.h index 1ab138a..1c0665b 100644 --- a/include/llvm/CodeGen/GCMetadataPrinter.h +++ b/include/llvm/CodeGen/GCMetadataPrinter.h @@ -29,6 +29,7 @@ namespace llvm { class GCMetadataPrinter; + class raw_ostream; /// GCMetadataPrinterRegistry - The GC assembly printer registry uses all the /// defaults from Registry. @@ -63,10 +64,10 @@ namespace llvm { iterator end() { return S->end(); } /// beginAssembly/finishAssembly - Emit module metadata as assembly code. - virtual void beginAssembly(std::ostream &OS, AsmPrinter &AP, + virtual void beginAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI); - virtual void finishAssembly(std::ostream &OS, AsmPrinter &AP, + virtual void finishAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI); virtual ~GCMetadataPrinter(); diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 471cebe..c9506f1 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -258,6 +258,11 @@ public: } void print(std::ostream &OS, const TargetMachine *TM = 0) const; void print(std::ostream *OS) const { if (OS) print(*OS); } + void print(raw_ostream *OS, const TargetMachine *TM) const { + if (OS) print(*OS, TM); + } + void print(raw_ostream &OS, const TargetMachine *TM = 0) const; + void print(raw_ostream *OS) const { if (OS) print(*OS); } void dump() const; //===--------------------------------------------------------------------===// @@ -316,6 +321,11 @@ inline std::ostream& operator<<(std::ostream &OS, const MachineInstr &MI) { return OS; } +inline raw_ostream& operator<<(raw_ostream &OS, const MachineInstr &MI) { + MI.print(OS); + return OS; +} + } // End llvm namespace #endif diff --git a/include/llvm/CodeGen/MachineOperand.h b/include/llvm/CodeGen/MachineOperand.h index 05984f6..b4ba2f4 100644 --- a/include/llvm/CodeGen/MachineOperand.h +++ b/include/llvm/CodeGen/MachineOperand.h @@ -26,6 +26,7 @@ class GlobalValue; class MachineInstr; class TargetMachine; class MachineRegisterInfo; +class raw_ostream; /// MachineOperand class - Representation of each machine instruction operand. /// @@ -117,6 +118,7 @@ public: const MachineInstr *getParent() const { return ParentMI; } void print(std::ostream &os, const TargetMachine *TM = 0) const; + void print(raw_ostream &os, const TargetMachine *TM = 0) const; /// Accessors that tell you what kind of MachineOperand you're looking at. /// @@ -425,6 +427,11 @@ inline std::ostream &operator<<(std::ostream &OS, const MachineOperand &MO) { return OS; } +inline raw_ostream &operator<<(raw_ostream &OS, const MachineOperand& MO) { + MO.print(OS, 0); + return OS; +} + } // End llvm namespace #endif |