diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-11-18 21:47:36 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-11-18 21:47:36 +0000 |
| commit | ace542fa6cdd3dbafbc1e06a5d7b7ccf0fc17eba (patch) | |
| tree | 4d1b32e733a7fa7c107b9852ba10f5bbe4f298c9 | |
| parent | 7acdc17fe48c0b9cdbfa50251aae689b7e57998f (diff) | |
| download | bcm5719-llvm-ace542fa6cdd3dbafbc1e06a5d7b7ccf0fc17eba.tar.gz bcm5719-llvm-ace542fa6cdd3dbafbc1e06a5d7b7ccf0fc17eba.zip | |
Implement operator<< for machine basic blocks to make it easier to dump them.
llvm-svn: 31857
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineBasicBlock.h | 1 | ||||
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineInstr.h | 1 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 4 |
3 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h index 85d348337a9..1196f2126b6 100644 --- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h @@ -222,6 +222,7 @@ private: // Methods used to maintain doubly linked list of blocks... void removePredecessor(MachineBasicBlock *pred); }; +std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB); //===--------------------------------------------------------------------===// diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h index b967a1fcb37..907985877f0 100644 --- a/llvm/include/llvm/CodeGen/MachineInstr.h +++ b/llvm/include/llvm/CodeGen/MachineInstr.h @@ -20,6 +20,7 @@ #include "llvm/Support/DataTypes.h" #include <vector> #include <cassert> +#include <iosfwd> namespace llvm { diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index fcc01299cd8..201b79e1300 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -27,6 +27,10 @@ MachineBasicBlock::~MachineBasicBlock() { LeakDetector::removeGarbageObject(this); } +std::ostream& llvm::operator<<(std::ostream &OS, const MachineBasicBlock &MBB) { + MBB.print(OS); + return OS; +} // MBBs start out as #-1. When a MBB is added to a MachineFunction, it // gets the next available unique MBB number. If it is removed from a |

