diff options
Diffstat (limited to 'llvm/lib/IR/LegacyPassManager.cpp')
-rw-r--r-- | llvm/lib/IR/LegacyPassManager.cpp | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index 9c44eff7..f2a83b5 100644 --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -808,13 +808,6 @@ void PMTopLevelManager::addImmutablePass(ImmutablePass *P) { // doing lookups. AnalysisID AID = P->getPassID(); ImmutablePassMap[AID] = P; - - // Also add any interfaces implemented by the immutable pass to the map for - // fast lookup. - const PassInfo *PassInf = findAnalysisPassInfo(AID); - assert(PassInf && "Expected all immutable passes to be initialized"); - for (const PassInfo *ImmPI : PassInf->getInterfacesImplemented()) - ImmutablePassMap[ImmPI->getTypeInfo()] = P; } // Print passes managed by this top level manager. @@ -844,8 +837,7 @@ void PMTopLevelManager::dumpArguments() const { for (ImmutablePass *P : ImmutablePasses) if (const PassInfo *PI = findAnalysisPassInfo(P->getPassID())) { assert(PI && "Expected all immutable passes to be initialized"); - if (!PI->isAnalysisGroup()) - dbgs() << " -" << PI->getPassArgument(); + dbgs() << " -" << PI->getPassArgument(); } for (PMDataManager *PM : PassManagers) PM->dumpPassArguments(); @@ -878,15 +870,6 @@ void PMDataManager::recordAvailableAnalysis(Pass *P) { AnalysisID PI = P->getPassID(); AvailableAnalysis[PI] = P; - - assert(!AvailableAnalysis.empty()); - - // This pass is the current implementation of all of the interfaces it - // implements as well. - const PassInfo *PInf = TPM->findAnalysisPassInfo(PI); - if (!PInf) return; - for (const PassInfo *PI : PInf->getInterfacesImplemented()) - AvailableAnalysis[PI->getTypeInfo()] = P; } // Return true if P preserves high level analysis used by other @@ -1004,20 +987,8 @@ void PMDataManager::freePass(Pass *P, StringRef Msg, P->releaseMemory(); } - AnalysisID PI = P->getPassID(); - if (const PassInfo *PInf = TPM->findAnalysisPassInfo(PI)) { - // Remove the pass itself (if it is not already removed). - AvailableAnalysis.erase(PI); - - // Remove all interfaces this pass implements, for which it is also - // listed as the available implementation. - for (const PassInfo *PI : PInf->getInterfacesImplemented()) { - DenseMap<AnalysisID, Pass *>::iterator Pos = - AvailableAnalysis.find(PI->getTypeInfo()); - if (Pos != AvailableAnalysis.end() && Pos->second == P) - AvailableAnalysis.erase(Pos); - } - } + // Remove the pass itself (if it is not already removed). + AvailableAnalysis.erase(P->getPassID()); } /// Add pass P into the PassVector. Update @@ -1173,11 +1144,8 @@ void PMDataManager::dumpPassArguments() const { for (Pass *P : PassVector) { if (PMDataManager *PMD = P->getAsPMDataManager()) PMD->dumpPassArguments(); - else - if (const PassInfo *PI = - TPM->findAnalysisPassInfo(P->getPassID())) - if (!PI->isAnalysisGroup()) - dbgs() << " -" << PI->getPassArgument(); + else if (const PassInfo *PI = TPM->findAnalysisPassInfo(P->getPassID())) + dbgs() << " -" << PI->getPassArgument(); } } |