OSDN Git Service

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 b11adfe..bb50b5d 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 e56776b..086528a 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 7b14a4c..cd52825 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();
+}