From dda30cd4af1c5f88fc00fd40b673f8e27c61379d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 5 Jan 2010 21:08:02 +0000 Subject: [PATCH] Restore dump() methods to Loop and MachineLoop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92772 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/LoopInfo.h | 4 +++- include/llvm/CodeGen/MachineLoopInfo.h | 2 ++ lib/Analysis/LoopInfo.cpp | 5 +++++ lib/CodeGen/MachineLoopInfo.cpp | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 060286fc5e2..33bf0b03748 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -478,7 +478,7 @@ public: for (iterator I = begin(), E = end(); I != E; ++I) (*I)->print(OS, Depth+2); } - + protected: friend class LoopInfoBase; explicit LoopBase(BlockT *BB) : ParentLoop(0) { @@ -588,6 +588,8 @@ public: /// block, return that block. Otherwise return null. BasicBlock *getUniqueExitBlock() const; + void dump() const; + private: friend class LoopInfoBase; explicit Loop(BasicBlock *BB) : LoopBase(BB) {} diff --git a/include/llvm/CodeGen/MachineLoopInfo.h b/include/llvm/CodeGen/MachineLoopInfo.h index d3df805f642..8459a8db9a3 100644 --- a/include/llvm/CodeGen/MachineLoopInfo.h +++ b/include/llvm/CodeGen/MachineLoopInfo.h @@ -49,6 +49,8 @@ public: /// contiguous with the part the contains the header. MachineBasicBlock *getBottomBlock(); + void dump() const; + private: friend class LoopInfoBase; explicit MachineLoop(MachineBasicBlock *MBB) diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 5d31c1157e1..453af5a5555 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -21,6 +21,7 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Support/CFG.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Debug.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/SmallPtrSet.h" #include @@ -385,6 +386,10 @@ BasicBlock *Loop::getUniqueExitBlock() const { return 0; } +void Loop::dump() const { + print(dbgs()); +} + //===----------------------------------------------------------------------===// // LoopInfo implementation // diff --git a/lib/CodeGen/MachineLoopInfo.cpp b/lib/CodeGen/MachineLoopInfo.cpp index d561a5bb8c9..269538b31d0 100644 --- a/lib/CodeGen/MachineLoopInfo.cpp +++ b/lib/CodeGen/MachineLoopInfo.cpp @@ -17,6 +17,7 @@ #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/Passes.h" +#include "llvm/Support/Debug.h" using namespace llvm; namespace llvm { @@ -73,3 +74,7 @@ MachineBasicBlock *MachineLoop::getBottomBlock() { } return BotMBB; } + +void MachineLoop::dump() const { + print(dbgs()); +} -- 2.34.1