aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp3
-rw-r--r--lib/Analysis/LoopInfo.cpp13
-rw-r--r--lib/Analysis/LoopPass.cpp16
3 files changed, 16 insertions, 16 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index 97a4008..786b720 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -117,7 +117,8 @@ bool CGPassManager::runOnModule(Module &M) {
if (Changed)
dumpPassInfo(P, MODIFICATION_MSG, ON_CG_MSG, "");
dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
-
+
+ verifyPreservedAnalysis(P);
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
removeDeadPasses(P, "", ON_CG_MSG);
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index d58f90d..8f9b43f 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -81,6 +81,18 @@ void Loop::print(std::ostream &OS, unsigned Depth) const {
(*I)->print(OS, Depth+2);
}
+/// verifyLoop - Verify loop structure
+void Loop::verifyLoop() const {
+#ifndef NDEBUG
+ assert (getHeader() && "Loop header is missing");
+ assert (getLoopPreheader() && "Loop preheader is missing");
+ assert (getLoopLatch() && "Loop latch is missing");
+ for (std::vector<Loop*>::const_iterator I = SubLoops.begin(), E = SubLoops.end();
+ I != E; ++I)
+ (*I)->verifyLoop();
+#endif
+}
+
void Loop::dump() const {
print(cerr);
}
@@ -104,7 +116,6 @@ void LoopInfo::releaseMemory() {
TopLevelLoops.clear();
}
-
void LoopInfo::Calculate(DominatorTree &DT) {
BasicBlock *RootNode = DT.getRootNode()->getBlock();
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp
index f14a9ba..dc3e868 100644
--- a/lib/Analysis/LoopPass.cpp
+++ b/lib/Analysis/LoopPass.cpp
@@ -157,18 +157,6 @@ 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) {
@@ -214,13 +202,13 @@ 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)
dumpPassInfo(P, MODIFICATION_MSG, ON_LOOP_MSG, "");
dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
-
+
+ verifyPreservedAnalysis(LP);
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
removeDeadPasses(P, "", ON_LOOP_MSG);