}
};
-static TimingInfo *TheTimeInfo;
-
} // End of anon namespace
+static TimingInfo *TheTimeInfo;
+
//===----------------------------------------------------------------------===//
// PMTopLevelManager implementation
std::map<AnalysisID, Pass*>::iterator Info = I++;
if (!dynamic_cast<ImmutablePass*>(Info->second)
&& std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
- PreservedSet.end())
+ PreservedSet.end()) {
// Remove this analysis
AvailableAnalysis.erase(Info);
+ if (PassDebugging >= Details) {
+ Pass *S = Info->second;
+ cerr << " -- " << P->getPassName() << " is not preserving ";
+ cerr << S->getPassName() << "\n";
+ }
+ }
}
// Check inherited analysis also. If P is not preserving analysis
TPM->collectLastUses(DeadPasses, P);
+ if (PassDebugging >= Details && !DeadPasses.empty()) {
+ cerr << " -*- " << P->getPassName();
+ cerr << " is the last user of following pass instances.";
+ cerr << " Free these instances\n";
+ }
+
for (SmallVector<Pass *, 12>::iterator I = DeadPasses.begin(),
E = DeadPasses.end(); I != E; ++I) {
// When Pass manager is not able to order required analysis info, Pass manager
// checks whether any lower level manager will be able to provide this
// analysis info on demand or not.
- assert (0 && "Unable to handle Pass that requires lower level Analysis pass");
+#ifndef NDEBUG
+ cerr << "Unable to schedule " << RequiredPass->getPassName();
+ cerr << " required by " << P->getPassName() << "\n";
+#endif
+ assert (0 && "Unable to schedule pass");
}
// Destructor
if (F.isDeclaration())
return false;
+
+ // Collect inherited analysis from Module level pass manager.
+ populateInheritedAnalysis(TPM->activeStack);
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
FunctionPass *FP = getContainedPass(Index);
// [1] Create new Function Pass Manager
FPP = new FPPassManager(PMD->getDepth() + 1);
+ FPP->populateInheritedAnalysis(PMS);
// [2] Set up new manager's top level manager
PMTopLevelManager *TPM = PMD->getTopLevelManager();