//
// 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.
//
//===----------------------------------------------------------------------===//
//
DominatorTree *DT = NULL;
DominanceFrontier *DF = NULL;
if (P) {
- DT = P->getAnalysisToUpdate<DominatorTree>();
- DF = P->getAnalysisToUpdate<DominanceFrontier>();
+ DT = P->getAnalysisIfAvailable<DominatorTree>();
+ DF = P->getAnalysisIfAvailable<DominanceFrontier>();
}
SmallVector<BasicBlock *, 16> NewBlocks;
Loop *NewParentLoop = NULL;
- while (!LoopNest.empty()) {
- Loop *L = LoopNest.back();
- LoopNest.pop_back();
+ do {
+ Loop *L = LoopNest.pop_back_val();
Loop *NewLoop = new Loop();
if (!NewParentLoop)
// Process sub loops
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
LoopNest.push_back(*I);
- }
+ } while (!LoopNest.empty());
// Remap instructions to reference operands from ValueMap.
for(SmallVector<BasicBlock *, 16>::iterator NBItr = NewBlocks.begin(),