LLVM API Documentation
#include <LegacyPassManagers.h>
Public Member Functions | |
void | schedulePass (Pass *P) |
void | setLastUser (ArrayRef< Pass * > AnalysisPasses, Pass *P) |
Set pass P as the last user of the given analysis passes. | |
void | collectLastUses (SmallVectorImpl< Pass * > &LastUses, Pass *P) |
Collect passes whose last user is P. | |
Pass * | findAnalysisPass (AnalysisID AID) |
AnalysisUsage * | findAnalysisUsage (Pass *P) |
Find analysis usage information for the pass P. | |
virtual | ~PMTopLevelManager () |
Destructor. | |
void | addImmutablePass (ImmutablePass *P) |
Add immutable pass and initialize it. | |
SmallVectorImpl< ImmutablePass * > & | getImmutablePasses () |
void | addPassManager (PMDataManager *Manager) |
void | addIndirectPassManager (PMDataManager *Manager) |
void | dumpPasses () const |
void | dumpArguments () const |
Public Attributes | |
PMStack | activeStack |
Protected Member Functions | |
PMTopLevelManager (PMDataManager *PMDM) | |
Initialize top level manager. Create first pass manager. | |
unsigned | getNumContainedManagers () const |
void | initializeAllAnalysisInfo () |
Protected Attributes | |
SmallVector< PMDataManager *, 8 > | PassManagers |
Collection of pass managers. |
PMTopLevelManager manages LastUser info and collects common APIs used by top level pass managers.
Definition at line 167 of file LegacyPassManagers.h.
PMTopLevelManager::PMTopLevelManager | ( | PMDataManager * | PMDM | ) | [explicit, protected] |
Initialize top level manager. Create first pass manager.
Definition at line 507 of file LegacyPassManager.cpp.
References llvm::PMDataManager::setTopLevelManager().
PMTopLevelManager::~PMTopLevelManager | ( | ) | [virtual] |
Destructor.
Definition at line 806 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, and PassManagers.
void llvm::PMTopLevelManager::addImmutablePass | ( | ImmutablePass * | P | ) | [inline] |
Add immutable pass and initialize it.
Definition at line 204 of file LegacyPassManagers.h.
References llvm::ImmutablePass::initializePass(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by schedulePass().
void llvm::PMTopLevelManager::addIndirectPassManager | ( | PMDataManager * | Manager | ) | [inline] |
Definition at line 219 of file LegacyPassManagers.h.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::LoopPass::assignPassManager(), llvm::CallGraphSCCPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::FunctionPass::assignPassManager(), and llvm::BasicBlockPass::assignPassManager().
void llvm::PMTopLevelManager::addPassManager | ( | PMDataManager * | Manager | ) | [inline] |
Definition at line 213 of file LegacyPassManagers.h.
References PassManagers, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
void PMTopLevelManager::collectLastUses | ( | SmallVectorImpl< Pass * > & | LastUses, |
Pass * | P | ||
) |
Collect passes whose last user is P.
Definition at line 568 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT >, KeyT, ValueT, KeyInfoT >::end(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::PMDataManager::dumpLastUses(), and llvm::PMDataManager::removeDeadPasses().
void PMTopLevelManager::dumpArguments | ( | ) | const |
Definition at line 760 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::dbgs(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::PassRegistry::getPassInfo(), llvm::PassRegistry::getPassRegistry(), I, PassDebugging, and PassManagers.
Referenced by llvm::PMDataManager::addLowerLevelRequiredPass(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), and llvm::legacy::PassManagerImpl::run().
void PMTopLevelManager::dumpPasses | ( | ) | const |
Definition at line 741 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, PassDebugging, PassManagers, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::PMDataManager::addLowerLevelRequiredPass(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), and llvm::legacy::PassManagerImpl::run().
Find the pass that implements Analysis AID. Search immutable passes and all pass managers. If desired pass is not found then return NULL.
Definition at line 701 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::PassInfo::getInterfacesImplemented(), llvm::PassRegistry::getPassInfo(), llvm::PassRegistry::getPassRegistry(), I, P, PassManagers, llvm::SmallVectorTemplateCommon< T, typename >::rbegin(), and llvm::SmallVectorTemplateCommon< T, typename >::rend().
Referenced by llvm::PMDataManager::findAnalysisPass(), and schedulePass().
Find analysis usage information for the pass P.
Definition at line 582 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT >, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and llvm::Pass::getAnalysisUsage().
Referenced by llvm::PMDataManager::collectRequiredAnalysis(), llvm::PMDataManager::initializeAnalysisImpl(), llvm::PMDataManager::preserveHigherLevelAnalysis(), llvm::PMDataManager::removeNotPreservedAnalysis(), schedulePass(), and llvm::PMDataManager::verifyPreservedAnalysis().
SmallVectorImpl<ImmutablePass *>& llvm::PMTopLevelManager::getImmutablePasses | ( | ) | [inline] |
Definition at line 209 of file LegacyPassManagers.h.
Referenced by llvm::legacy::FunctionPassManagerImpl::doFinalization(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), and llvm::legacy::PassManagerImpl::run().
unsigned llvm::PMTopLevelManager::getNumContainedManagers | ( | ) | const [inline, protected] |
Definition at line 171 of file LegacyPassManagers.h.
References PassManagers, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::legacy::FunctionPassManagerImpl::doFinalization(), llvm::legacy::FunctionPassManagerImpl::doInitialization(), llvm::legacy::FunctionPassManagerImpl::releaseMemoryOnTheFly(), llvm::legacy::FunctionPassManagerImpl::run(), and llvm::legacy::PassManagerImpl::run().
void PMTopLevelManager::initializeAllAnalysisInfo | ( | ) | [protected] |
Definition at line 780 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), and PassManagers.
Referenced by llvm::legacy::FunctionPassManagerImpl::run(), and llvm::legacy::PassManagerImpl::run().
void PMTopLevelManager::schedulePass | ( | Pass * | P | ) |
Schedule pass P for execution. Make sure that passes required by P are run before P is run. Update analysis info maintained by the manager. Remove dead passes. This is a recursive function.
Definition at line 598 of file LegacyPassManager.cpp.
References activeStack, addImmutablePass(), llvm::Pass::assignPassManager(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::PassInfo::createPass(), llvm::Pass::createPrinterPass(), llvm::dbgs(), llvm::SmallVectorTemplateCommon< T, typename >::end(), findAnalysisPass(), findAnalysisUsage(), llvm::Pass::getAsImmutablePass(), llvm::Pass::getPassID(), llvm::PassRegistry::getPassInfo(), llvm::Pass::getPassName(), llvm::PassRegistry::getPassRegistry(), llvm::Pass::getPotentialPassManagerType(), llvm::AnalysisUsage::getRequiredSet(), I, llvm::PMDataManager::initializeAnalysisImpl(), llvm::PassInfo::isAnalysis(), llvm::Pass::preparePassManager(), llvm::PMDataManager::recordAvailableAnalysis(), llvm::Pass::setResolver(), ShouldPrintAfterPass(), and ShouldPrintBeforePass().
Referenced by llvm::LoopPass::assignPassManager(), llvm::CallGraphSCCPass::assignPassManager(), and llvm::RegionPass::assignPassManager().
void PMTopLevelManager::setLastUser | ( | ArrayRef< Pass * > | AnalysisPasses, |
Pass * | P | ||
) |
Set pass P as the last user of the given analysis passes.
Definition at line 515 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::ArrayRef< T >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::ArrayRef< T >::end(), llvm::PMDataManager::getAsPass(), llvm::PMDataManager::getDepth(), llvm::AnalysisResolver::getPMDataManager(), llvm::AnalysisUsage::getRequiredTransitiveSet(), llvm::Pass::getResolver(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by llvm::PMDataManager::add().
Definition at line 228 of file LegacyPassManagers.h.
Referenced by llvm::RGPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), and schedulePass().
SmallVector<PMDataManager *, 8> llvm::PMTopLevelManager::PassManagers [protected] |
Collection of pass managers.
Definition at line 233 of file LegacyPassManagers.h.
Referenced by addPassManager(), dumpArguments(), dumpPasses(), findAnalysisPass(), getNumContainedManagers(), initializeAllAnalysisInfo(), and ~PMTopLevelManager().