Add new Loop::hasExitBlock helper method
authorChris Lattner <sabre@nondot.org>
Thu, 27 Feb 2003 22:48:28 +0000 (22:48 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 27 Feb 2003 22:48:28 +0000 (22:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5663 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LoopInfo.h

index d4a6224398bb5ce308dc2c5af977b38eb6d40206..6b96625c63400878f5394cfdfaab81a961e124bf 100644 (file)
@@ -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