diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-24 10:36:58 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-24 10:36:58 +0000 |
commit | f55f61f8a105e225f3589cac07ae98c08c26b1f6 (patch) | |
tree | 233ac1c2bca5a7f2a8eb43b1a2815d807d9e4f9f /include/llvm | |
parent | f20e5a748a28c24941a9f9a3605f1e9cf3e91c69 (diff) | |
download | external_llvm-f55f61f8a105e225f3589cac07ae98c08c26b1f6.zip external_llvm-f55f61f8a105e225f3589cac07ae98c08c26b1f6.tar.gz external_llvm-f55f61f8a105e225f3589cac07ae98c08c26b1f6.tar.bz2 |
Move more to raw_ostream, provide support for writing MachineBasicBlock,
LiveInterval, etc to raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76965 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 12 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineBasicBlock.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 6910f41..20943d5 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -32,6 +32,7 @@ namespace llvm { class MachineInstr; class MachineRegisterInfo; class TargetRegisterInfo; + class raw_ostream; /// VNInfo - Value Number Information. /// This class holds information about a machine level values, including @@ -192,12 +193,15 @@ namespace llvm { void dump() const; void print(std::ostream &os) const; void print(std::ostream *os) const { if (os) print(*os); } + void print(raw_ostream &os) const; + void print(raw_ostream *os) const { if (os) print(*os); } private: LiveRange(); // DO NOT IMPLEMENT }; std::ostream& operator<<(std::ostream& os, const LiveRange &LR); + raw_ostream& operator<<(raw_ostream& os, const LiveRange &LR); inline bool operator<(unsigned V, const LiveRange &LR) { @@ -584,6 +588,10 @@ namespace llvm { void print(std::ostream *OS, const TargetRegisterInfo *TRI = 0) const { if (OS) print(*OS, TRI); } + void print(raw_ostream &OS, const TargetRegisterInfo *TRI = 0) const; + void print(raw_ostream *OS, const TargetRegisterInfo *TRI = 0) const { + if (OS) print(*OS, TRI); + } void dump() const; private: @@ -599,6 +607,10 @@ namespace llvm { LI.print(OS); return OS; } + inline raw_ostream &operator<<(raw_ostream &OS, const LiveInterval &LI) { + LI.print(OS); + return OS; + } } #endif diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index aacc314..90d67e5 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -21,6 +21,7 @@ namespace llvm { class BasicBlock; class MachineFunction; +class raw_ostream; template <> struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> { @@ -311,6 +312,8 @@ public: void dump() const; void print(std::ostream &OS) const; void print(std::ostream *OS) const { if (OS) print(*OS); } + void print(raw_ostream &OS) const; + void print(raw_ostream *OS) const { if (OS) print(*OS); } /// getNumber - MachineBasicBlocks are uniquely numbered at the function /// level, unless they're not in a MachineFunction yet, in which case this @@ -339,6 +342,7 @@ private: // Methods used to maintain doubly linked list of blocks... }; std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB); +raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB); //===--------------------------------------------------------------------===// // GraphTraits specializations for machine basic block graphs (machine-CFGs) |