Implement operator<< for machine basic blocks to make it easier to dump them.
authorChris Lattner <sabre@nondot.org>
Sat, 18 Nov 2006 21:47:36 +0000 (21:47 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Nov 2006 21:47:36 +0000 (21:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31857 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineBasicBlock.h
include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/MachineBasicBlock.cpp

index 85d348337a921bf31250e005066d18d791635e9b..1196f2126b6fb1c3ff15e480636d1f28db66f002 100644 (file)
@@ -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);
 
 
 //===--------------------------------------------------------------------===//
index b967a1fcb37b0272c28755aaa8efa9fd31c9ac30..907985877f035f633c791cc436d1be3af539e81b 100644 (file)
@@ -20,6 +20,7 @@
 #include "llvm/Support/DataTypes.h"
 #include <vector>
 #include <cassert>
+#include <iosfwd>
 
 namespace llvm {
 
index fcc01299cd8a25b970599314d57331da4004da5d..201b79e130023a02cb03957e14af0e1ba63a5b37 100644 (file)
@@ -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