Use the isReachableFromEntry method.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 24 Mar 2012 23:29:27 +0000 (23:29 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 24 Mar 2012 23:29:27 +0000 (23:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153400 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LoopInfo.h

index f807d48d4e40474999b138f0a545ecedaddb551f..8f44bed94716533447c411996a67b369431fb9e5 100644 (file)
@@ -772,14 +772,12 @@ public:
     LoopT *L = new LoopT(BB);
     BBMap[BB] = L;
 
-    BlockT *EntryBlock = BB->getParent()->begin();
-
     while (!TodoStack.empty()) {  // Process all the nodes in the loop
       BlockT *X = TodoStack.back();
       TodoStack.pop_back();
 
       if (!L->contains(X) &&         // As of yet unprocessed??
-          DT.dominates(EntryBlock, X)) {   // X is reachable from entry block?
+          DT.isReachableFromEntry(X)) {
         // Check to see if this block already belongs to a loop.  If this occurs
         // then we have a case where a loop that is supposed to be a child of
         // the current loop was processed before the current loop.  When this