summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-08-10 01:59:05 +0000
committerAndrew Trick <atrick@apple.com>2011-08-10 01:59:05 +0000
commit78b40c3f3aa754fdd0bca361a6a5c589a87665d6 (patch)
treeded3bb4a52a1891b9314aad37a741a2f989e8614 /llvm/lib/Analysis/LoopInfo.cpp
parent278ffd7d8e924172dd3994e0886d87f4f5bd6804 (diff)
downloadbcm5719-llvm-78b40c3f3aa754fdd0bca361a6a5c589a87665d6.tar.gz
bcm5719-llvm-78b40c3f3aa754fdd0bca361a6a5c589a87665d6.zip
Cleanup. Added LoopBlocksDFS::perform for simple clients.
llvm-svn: 137195
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index cfe71d18a4f..528b3cf87b6 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -18,6 +18,7 @@
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
#include "llvm/Analysis/Dominators.h"
+#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/CommandLine.h"
@@ -417,3 +418,15 @@ void LoopInfo::print(raw_ostream &OS, const Module*) const {
LI.print(OS);
}
+//===----------------------------------------------------------------------===//
+// LoopBlocksDFS implementation
+//
+
+/// Traverse the loop blocks and store the DFS result.
+/// Useful for clients that just want the final DFS result and don't need to
+/// visit blocks during the initial traversal.
+void LoopBlocksDFS::perform(LoopInfo *LI) {
+ LoopBlocksTraversal Traversal(*this, LI);
+ for (LoopBlocksTraversal::POTIterator POI = Traversal.begin(),
+ POE = Traversal.end(); POI != POE; ++POI) ;
+}
OpenPOWER on IntegriCloud