Set up ground work to verify preserved analysis info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40039 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2007-07-19 05:36:09 +00:00
parent b97819852a
commit 9750b5d577
2 changed files with 12 additions and 1 deletions

View File

@ -161,6 +161,10 @@ public:
///
virtual void releaseMemory() {}
/// verifyAnalysis() - This member can be implemented by a analysis pass to
/// check state of analysis information.
virtual void verifyAnalysis() {}
// dumpPassStructure - Implement the -debug-passes=PassStructure option
virtual void dumpPassStructure(unsigned Offset = 0);

View File

@ -598,11 +598,18 @@ bool PMDataManager::preserveHigherLevelAnalysis(Pass *P) {
void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
AnalysisUsage AnUsage;
P->getAnalysisUsage(AnUsage);
const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
// Verify preserved analysis
for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(),
E = AvailableAnalysis.end(); I != E; ++I) {
Pass *AP = I->second;
AP->verifyAnalysis();
}
if (AnUsage.getPreservesAll())
return;
const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(),
E = AvailableAnalysis.end(); I != E; ) {
std::map<AnalysisID, Pass*>::iterator Info = I++;