A brief survey of priority_queue usage in the tree turned this up
[oota-llvm.git] / lib / Analysis / LoopPass.cpp
index 21c14c6293ebefe9135acb6cfb4bb0e0887950c4..b4534cd511f3fc336da2377e160bca97ee846ea8 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Devang Patel and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -14,7 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
+#include "llvm/Analysis/ScalarEvolution.h"
 using namespace llvm;
 
 //===----------------------------------------------------------------------===//
@@ -54,7 +54,7 @@ void LPPassManager::deleteLoopFromQueue(Loop *L) {
     }
     
     // Move all subloops into the parent loop.
-    while (L->begin() != L->end())
+    while (!L->empty())
       ParentLoop->addChildLoop(L->removeChildLoop(L->end()-1));
   } else {
     // Reparent all of the blocks in this loop.  Since BBLoop had no parent,
@@ -78,7 +78,7 @@ void LPPassManager::deleteLoopFromQueue(Loop *L) {
     }
 
     // Move all of the subloops to the top-level.
-    while (L->begin() != L->end())
+    while (!L->empty())
       LI->addTopLevelLoop(L->removeChildLoop(L->end()-1));
   }
 
@@ -222,7 +222,7 @@ bool LPPassManager::runOnFunction(Function &F) {
       StartPassTimer(P);
       LoopPass *LP = dynamic_cast<LoopPass *>(P);
       assert (LP && "Invalid LPPassManager member");
-      LP->runOnLoop(CurrentLoop, *this);
+      Changed |= LP->runOnLoop(CurrentLoop, *this);
       StopPassTimer(P);
 
       if (Changed)