assert(ResultPass && "Unable to find requested analysis info");
if (Changed)
*Changed |= LocalChanged;
+ else
+ assert(!LocalChanged &&
+ "A pass trigged a code update but the update status is lost");
// Because the AnalysisType may not be a subclass of pass (for
// AnalysisGroups), we use getAdjustedAnalysisPointer here to potentially
if (F.empty())
return false;
- LoopInfo &LI = getAnalysis<LoopInfoWrapperPass>(F).getLoopInfo();
+ bool Changed = false;
+ LoopInfo &LI = getAnalysis<LoopInfoWrapperPass>(F, &Changed).getLoopInfo();
// If there are no loops in the function.
if (LI.empty())
- return false;
+ return Changed;
DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();
// If there is more than one top-level loop in this function, extract all of
// the loops.
if (std::next(LI.begin()) != LI.end())
- return extractLoops(LI.begin(), LI.end(), LI, DT);
+ return Changed | extractLoops(LI.begin(), LI.end(), LI, DT);
// Otherwise there is exactly one top-level loop.
Loop *TLL = *LI.begin();
}
if (ShouldExtractLoop)
- return extractLoop(TLL, LI, DT);
+ return Changed | extractLoop(TLL, LI, DT);
}
// Okay, this function is a minimal container around the specified loop.
// If we extract the loop, we will continue to just keep extracting it
// infinitely... so don't extract it. However, if the loop contains any
// sub-loops, extract them.
- return extractLoops(TLL->begin(), TLL->end(), LI, DT);
+ return Changed | extractLoops(TLL->begin(), TLL->end(), LI, DT);
}
bool LoopExtractor::extractLoops(Loop::iterator From, Loop::iterator To,