mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add loop info verification mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37822 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d933fa9507
commit
1a957d563f
@ -114,6 +114,11 @@ public:
|
||||
// queue. This allows LoopPass to change loop nest for the loop. This
|
||||
// utility may send LPPassManager into infinite loops so use caution.
|
||||
void redoLoop(Loop *L);
|
||||
|
||||
private:
|
||||
/// verifyLoopInfo - Verify loop nest.
|
||||
void verifyLoopInfo();
|
||||
|
||||
private:
|
||||
std::deque<Loop *> LQ;
|
||||
bool skipThisLoop;
|
||||
|
@ -157,6 +157,18 @@ void LPPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
|
||||
Info.setPreservesAll();
|
||||
}
|
||||
|
||||
/// verifyLoopInfo - Verify loop nest.
|
||||
void LPPassManager::verifyLoopInfo() {
|
||||
assert (LI && "Loop Info is missing");
|
||||
|
||||
for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) {
|
||||
Loop *L = *I;
|
||||
assert (L->getHeader() && "Loop header is missing");
|
||||
assert (L->getLoopPreheader() && "Loop preheader is missing");
|
||||
assert (L->getLoopLatch() && "Loop latch is missing");
|
||||
}
|
||||
}
|
||||
|
||||
/// run - Execute all of the passes scheduled for execution. Keep track of
|
||||
/// whether any of the passes modifies the function, and if so, return true.
|
||||
bool LPPassManager::runOnFunction(Function &F) {
|
||||
@ -202,6 +214,7 @@ bool LPPassManager::runOnFunction(Function &F) {
|
||||
LoopPass *LP = dynamic_cast<LoopPass *>(P);
|
||||
assert (LP && "Invalid LPPassManager member");
|
||||
LP->runOnLoop(CurrentLoop, *this);
|
||||
verifyLoopInfo();
|
||||
StopPassTimer(P);
|
||||
|
||||
if (Changed)
|
||||
@ -302,4 +315,3 @@ void LoopPass::assignPassManager(PMStack &PMS,
|
||||
|
||||
LPPM->add(this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user