1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Set up ground work to verify preserved analysis info.

llvm-svn: 40039
This commit is contained in:
Devang Patel 2007-07-19 05:36:09 +00:00
parent c32df0bc73
commit 9c100bc7e9
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++;