aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-11-17 19:19:59 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-11-17 19:19:59 +0000
commit2a085c34933a6c76e5a86f2680d93c16b0438801 (patch)
treead33685f929340ad3b22fee84a399080e7c8567a
parent7adcdc313f8367808a1f43c34ca67a4044595327 (diff)
Add a WriteAsOperand for MachineBasicBlock so MachineLoopInfo dump looks sane.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89130 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h2
-rw-r--r--include/llvm/CodeGen/MachineDominators.h2
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp5
3 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index b11adfe3c7..bb50b5df4c 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/include/llvm/CodeGen/MachineBasicBlock.h
@@ -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)
//===--------------------------------------------------------------------===//
diff --git a/include/llvm/CodeGen/MachineDominators.h b/include/llvm/CodeGen/MachineDominators.h
index e56776b144..086528aaf5 100644
--- a/include/llvm/CodeGen/MachineDominators.h
+++ b/include/llvm/CodeGen/MachineDominators.h
@@ -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);
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index 7b14a4c851..cd52825d21 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/lib/CodeGen/MachineBasicBlock.cpp
@@ -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();
+}