summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-27 22:48:28 +0000
committerChris Lattner <sabre@nondot.org>2003-02-27 22:48:28 +0000
commit9eaef21f1f3b77bec6d10cada423c8b037d85a14 (patch)
tree6f50ed493513ea4f88f25c7ed16ce9266fd7e6a2
parent72f876223f175f2990111659e2ff7ac0fc972abd (diff)
downloadbcm5719-llvm-9eaef21f1f3b77bec6d10cada423c8b037d85a14.tar.gz
bcm5719-llvm-9eaef21f1f3b77bec6d10cada423c8b037d85a14.zip
Add new Loop::hasExitBlock helper method
llvm-svn: 5663
-rw-r--r--llvm/include/llvm/Analysis/LoopInfo.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index d4a6224398b..6b96625c634 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -69,6 +69,15 @@ public:
///
unsigned getNumBackEdges() const;
+ /// hasExitBlock - Return true if the current loop has the specified block as
+ /// an exit block...
+ bool hasExitBlock(BasicBlock *BB) const {
+ for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i)
+ if (ExitBlocks[i] == BB)
+ return true;
+ return false;
+ }
+
/// getLoopPreheader - If there is a preheader for this loop, return it. A
/// loop has a preheader if there is only one edge to the header of the loop
/// from outside of the loop. If this is the case, the block branching to the
OpenPOWER on IntegriCloud