Add a WriteAsOperand for MachineBasicBlock so MachineLoopInfo dump looks sane.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 17 Nov 2009 19:19:59 +0000 (19:19 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 17 Nov 2009 19:19:59 +0000 (19:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89130 91177308-0d34-0410-b5e6-96231b3b80d8

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

index b11adfe3c71ef775475bfd262a1ba70ebd968e9c..bb50b5df4ca81ac5b9883908c7592d74402e3cae 100644 (file)
@@ -358,6 +358,8 @@ private:   // Methods used to maintain doubly linked list of blocks...
 
 raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
 
+void WriteAsOperand(raw_ostream &, const MachineBasicBlock*, bool t);
+
 //===--------------------------------------------------------------------===//
 // GraphTraits specializations for machine basic block graphs (machine-CFGs)
 //===--------------------------------------------------------------------===//
index e56776b1440c8bf8e030ee6dcc773cf9c123379c..086528aaf57c37463849e65a877769349f0dbeef 100644 (file)
@@ -23,8 +23,6 @@
 
 namespace llvm {
 
-inline void WriteAsOperand(raw_ostream &, const MachineBasicBlock*, bool t) {  }
-
 template<>
 inline void DominatorTreeBase<MachineBasicBlock>::addRoot(MachineBasicBlock* MBB) {
   this->Roots.push_back(MBB);
index 7b14a4c851385a86e8ed46383e7e6796cfb11ee8..cd52825d21f12cf5449df5a2f6543d59a76ba773 100644 (file)
@@ -447,3 +447,8 @@ bool MachineBasicBlock::CorrectExtraCFGEdges(MachineBasicBlock *DestA,
   }
   return MadeChange;
 }
+
+void llvm::WriteAsOperand(raw_ostream &OS, const MachineBasicBlock *MBB,
+                          bool t) {
+  OS << "BB#" << MBB->getNumber();
+}