LLVM API Documentation
#include <LegacyPassManagers.h>
PMDataManager provides the common place to manage the analysis data used by pass managers.
Definition at line 263 of file LegacyPassManagers.h.
llvm::PMDataManager::PMDataManager | ( | ) | [inline, explicit] |
Definition at line 266 of file LegacyPassManagers.h.
References initializeAnalysisInfo().
PMDataManager::~PMDataManager | ( | ) | [virtual] |
Definition at line 1270 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), I, and PassVector.
void PMDataManager::add | ( | Pass * | P, |
bool | ProcessAnalysis = true |
||
) |
Add pass P into the PassVector. Update AvailableAnalysis appropriately if ProcessAnalysis is true.
Definition at line 984 of file LegacyPassManager.cpp.
References addLowerLevelRequiredPass(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorImpl< T >::clear(), collectRequiredAnalysis(), llvm::PassInfo::createPass(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), getAsPass(), llvm::Pass::getAsPMDataManager(), getDepth(), llvm::PassRegistry::getPassInfo(), llvm::PassRegistry::getPassRegistry(), llvm::AnalysisResolver::getPMDataManager(), llvm::Pass::getResolver(), I, llvm_unreachable, PassVector, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), recordAvailableAnalysis(), removeNotPreservedAnalysis(), llvm::PMTopLevelManager::setLastUser(), llvm::Pass::setResolver(), and TPM.
Referenced by llvm::LoopPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::ModulePass::assignPassManager(), and llvm::FunctionPass::assignPassManager().
void PMDataManager::addLowerLevelRequiredPass | ( | Pass * | P, |
Pass * | RequiredPass | ||
) | [virtual] |
Add RequiredPass into list of lower level passes required by pass P. RequiredPass is run on the fly by Pass Manager when P requests it through getAnalysis interface.
Add RequiredPass into list of lower level passes required by pass P. RequiredPass is run on the fly by Pass Manager when P requests it through getAnalysis interface. This should be handled by specific pass manager.
Definition at line 1243 of file LegacyPassManager.cpp.
References llvm::dbgs(), llvm::PMTopLevelManager::dumpArguments(), llvm::PMTopLevelManager::dumpPasses(), llvm::Pass::getPassName(), llvm_unreachable, and TPM.
Referenced by add().
void PMDataManager::collectRequiredAnalysis | ( | SmallVectorImpl< Pass * > & | RP, |
SmallVectorImpl< AnalysisID > & | RP_NotAvail, | ||
Pass * | P | ||
) |
Populate RequiredPasses with analysis pass that are required by pass P and are available. Populate ReqPassNotAvailable with analysis pass that are required by pass P but are not available.
Populate RP with analysis pass that are required by pass P and are available. Populate RP_NotAvail with analysis pass that are required by pass P but are not available.
Definition at line 1064 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), findAnalysisPass(), llvm::PMTopLevelManager::findAnalysisUsage(), llvm::AnalysisUsage::getRequiredSet(), llvm::AnalysisUsage::getRequiredTransitiveSet(), I, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and TPM.
Referenced by add().
void PMDataManager::dumpLastUses | ( | Pass * | P, |
unsigned | Offset | ||
) | const |
Definition at line 1127 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::PMTopLevelManager::collectLastUses(), llvm::dbgs(), llvm::SmallVectorTemplateCommon< T >::end(), I, and TPM.
Referenced by llvm::RGPassManager::dumpPassStructure(), and llvm::LPPassManager::dumpPassStructure().
void PMDataManager::dumpPassArguments | ( | ) | const |
Definition at line 1144 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::dbgs(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::PassRegistry::getPassRegistry(), I, and PassVector.
void PMDataManager::dumpPassInfo | ( | Pass * | P, |
enum PassDebuggingString | S1, | ||
enum PassDebuggingString | S2, | ||
StringRef | Msg | ||
) |
Definition at line 1157 of file LegacyPassManager.cpp.
References llvm::dbgs(), llvm::EXECUTION_MSG, llvm::FREEING_MSG, getDepth(), llvm::Pass::getPassName(), llvm::MODIFICATION_MSG, llvm::sys::TimeValue::now(), llvm::ON_BASICBLOCK_MSG, llvm::ON_CG_MSG, llvm::ON_FUNCTION_MSG, llvm::ON_LOOP_MSG, llvm::ON_MODULE_MSG, llvm::ON_REGION_MSG, PassDebugging, and llvm::sys::TimeValue::str().
Referenced by freePass(), llvm::LPPassManager::runOnFunction(), and llvm::RGPassManager::runOnFunction().
void PMDataManager::dumpPreservedSet | ( | const Pass * | P | ) | const |
Definition at line 1210 of file LegacyPassManager.cpp.
References llvm::Pass::getAnalysisUsage(), llvm::AnalysisUsage::getPreservedSet(), and PassDebugging.
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
void PMDataManager::dumpRequiredSet | ( | const Pass * | P | ) | const |
Definition at line 1201 of file LegacyPassManager.cpp.
References llvm::Pass::getAnalysisUsage(), llvm::AnalysisUsage::getRequiredSet(), and PassDebugging.
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
Pass * PMDataManager::findAnalysisPass | ( | AnalysisID | AID, |
bool | SearchParent | ||
) |
Find the pass that implements Analysis AID. If desired pass is not found then return NULL.
Definition at line 1111 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::PMTopLevelManager::findAnalysisPass(), I, if(), and TPM.
Referenced by collectRequiredAnalysis(), llvm::AnalysisResolver::getAnalysisIfAvailable(), initializeAnalysisImpl(), and verifyPreservedAnalysis().
void PMDataManager::freePass | ( | Pass * | P, |
StringRef | Msg, | ||
enum PassDebuggingString | DBG_STR | ||
) |
Remove P.
Definition at line 953 of file LegacyPassManager.cpp.
References dumpPassInfo(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::FREEING_MSG, llvm::Pass::getPassID(), llvm::PassRegistry::getPassRegistry(), llvm::getPassTimer(), llvm::Pass::releaseMemory(), and llvm::X.
Referenced by removeDeadPasses(), llvm::LPPassManager::runOnFunction(), and llvm::RGPassManager::runOnFunction().
virtual Pass* llvm::PMDataManager::getAsPass | ( | ) | [pure virtual] |
Implemented in llvm::FPPassManager, llvm::legacy::PassManagerImpl, llvm::legacy::FunctionPassManagerImpl, llvm::LPPassManager, and llvm::RGPassManager.
Referenced by add(), and llvm::PMTopLevelManager::setLastUser().
DenseMap<AnalysisID, Pass*>* llvm::PMDataManager::getAvailableAnalysis | ( | ) | [inline] |
Definition at line 355 of file LegacyPassManagers.h.
unsigned llvm::PMDataManager::getDepth | ( | ) | const [inline] |
Definition at line 335 of file LegacyPassManagers.h.
Referenced by add(), dumpPassInfo(), llvm::PMStack::push(), and llvm::PMTopLevelManager::setLastUser().
unsigned llvm::PMDataManager::getNumContainedPasses | ( | ) | const [inline] |
Definition at line 346 of file LegacyPassManagers.h.
References PassVector, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::LPPassManager::cloneBasicBlockSimpleAnalysis(), llvm::LPPassManager::deleteSimpleAnalysisValue(), llvm::RGPassManager::dumpPassStructure(), llvm::LPPassManager::dumpPassStructure(), llvm::legacy::FunctionPassManagerImpl::releaseMemoryOnTheFly(), llvm::LPPassManager::runOnFunction(), and llvm::RGPassManager::runOnFunction().
Pass * PMDataManager::getOnTheFlyPass | ( | Pass * | P, |
AnalysisID | PI, | ||
Function & | F | ||
) | [virtual] |
Definition at line 1265 of file LegacyPassManager.cpp.
References llvm_unreachable.
Referenced by llvm::AnalysisResolver::findImplPass().
virtual PassManagerType llvm::PMDataManager::getPassManagerType | ( | ) | const [inline, virtual] |
Reimplemented in llvm::FPPassManager, llvm::RGPassManager, and llvm::LPPassManager.
Definition at line 350 of file LegacyPassManagers.h.
References llvm::PMT_Unknown.
Referenced by llvm::LoopPass::assignPassManager(), llvm::CallGraphSCCPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::ModulePass::assignPassManager(), llvm::FunctionPass::assignPassManager(), llvm::BasicBlockPass::assignPassManager(), llvm::LoopPass::preparePassManager(), llvm::RegionPass::preparePassManager(), and llvm::PMStack::push().
PMTopLevelManager* llvm::PMDataManager::getTopLevelManager | ( | ) | [inline] |
Definition at line 332 of file LegacyPassManagers.h.
References TPM.
void PMDataManager::initializeAnalysisImpl | ( | Pass * | P | ) |
All Required analyses should be available to the pass as it runs! Here we fill in the AnalysisImpls member of the pass so that it can successfully use the getAnalysis() method to retrieve the implementations it needs.
Definition at line 1092 of file LegacyPassManager.cpp.
References llvm::AnalysisResolver::addAnalysisImplsPair(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), findAnalysisPass(), llvm::PMTopLevelManager::findAnalysisUsage(), llvm::AnalysisUsage::getRequiredSet(), llvm::Pass::getResolver(), I, and TPM.
Referenced by llvm::RGPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), and llvm::PMTopLevelManager::schedulePass().
void llvm::PMDataManager::initializeAnalysisInfo | ( | ) | [inline] |
Initialize available analysis information.
Definition at line 303 of file LegacyPassManagers.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), InheritedAnalysis, and llvm::PMT_Last.
Referenced by PMDataManager(), and llvm::PMStack::pop().
bool PMDataManager::isPassDebuggingExecutionsOrMore | ( | ) | const [protected] |
isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions or higher is specified.
Definition at line 115 of file LegacyPassManager.cpp.
References PassDebugging.
void llvm::PMDataManager::populateInheritedAnalysis | ( | PMStack & | PMS | ) | [inline] |
Definition at line 360 of file LegacyPassManagers.h.
References llvm::PMStack::begin(), llvm::PMStack::end(), I, and InheritedAnalysis.
Referenced by llvm::LoopPass::assignPassManager(), llvm::RegionPass::assignPassManager(), llvm::FunctionPass::assignPassManager(), llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
Definition at line 842 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::PMTopLevelManager::findAnalysisUsage(), llvm::Pass::getAsImmutablePass(), llvm::Pass::getPassID(), llvm::AnalysisUsage::getPreservedSet(), llvm::AnalysisUsage::getPreservesAll(), I, and TPM.
Referenced by llvm::LoopPass::preparePassManager(), and llvm::RegionPass::preparePassManager().
void PMDataManager::recordAvailableAnalysis | ( | Pass * | P | ) |
Augment AvailableAnalysis by adding analysis made available by pass P.
Augement AvailableAnalysis by adding analysis made available by pass P.
Definition at line 824 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty(), llvm::PassInfo::getInterfacesImplemented(), llvm::Pass::getPassID(), llvm::PassRegistry::getPassInfo(), and llvm::PassRegistry::getPassRegistry().
Referenced by add(), llvm::LPPassManager::runOnFunction(), llvm::RGPassManager::runOnFunction(), and llvm::PMTopLevelManager::schedulePass().
void PMDataManager::removeDeadPasses | ( | Pass * | P, |
StringRef | Msg, | ||
enum PassDebuggingString | DBG_STR | ||
) |
Remove dead passes used by P.
Remove analysis passes that are not used any longer.
Definition at line 931 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::PMTopLevelManager::collectLastUses(), llvm::dbgs(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T >::end(), freePass(), llvm::Pass::getPassName(), I, PassDebugging, and TPM.
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
void PMDataManager::removeNotPreservedAnalysis | ( | Pass * | P | ) |
Remove Analysis that is not preserved by the pass.
Remove Analysis not preserved by Pass P.
Definition at line 882 of file LegacyPassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::sys::path::begin(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::dbgs(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::sys::path::end(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), llvm::PMTopLevelManager::findAnalysisUsage(), llvm::Pass::getPassName(), llvm::AnalysisUsage::getPreservedSet(), llvm::AnalysisUsage::getPreservesAll(), I, InheritedAnalysis, PassDebugging, llvm::PMT_Last, and TPM.
Referenced by add(), llvm::LPPassManager::runOnFunction(), and llvm::RGPassManager::runOnFunction().
void llvm::PMDataManager::setDepth | ( | unsigned | newDepth | ) | [inline] |
Definition at line 336 of file LegacyPassManagers.h.
Referenced by llvm::PMStack::push().
void llvm::PMDataManager::setTopLevelManager | ( | PMTopLevelManager * | T | ) | [inline] |
Definition at line 333 of file LegacyPassManagers.h.
Referenced by llvm::legacy::FunctionPassManager::FunctionPassManager(), llvm::legacy::PassManager::PassManager(), llvm::PMTopLevelManager::PMTopLevelManager(), and llvm::PMStack::push().
void PMDataManager::verifyPreservedAnalysis | ( | Pass * | P | ) |
verifyPreservedAnalysis -- Verify analysis presreved by pass P.
verifyPreservedAnalysis -- Verify analysis preserved by pass P.
Definition at line 862 of file LegacyPassManager.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), findAnalysisPass(), llvm::PMTopLevelManager::findAnalysisUsage(), llvm::getPassTimer(), llvm::AnalysisUsage::getPreservedSet(), I, and TPM.
Referenced by llvm::RGPassManager::runOnFunction(), and llvm::LPPassManager::runOnFunction().
DenseMap<AnalysisID, Pass *>* llvm::PMDataManager::InheritedAnalysis[PMT_Last] [protected] |
Definition at line 378 of file LegacyPassManagers.h.
Referenced by initializeAnalysisInfo(), populateInheritedAnalysis(), and removeNotPreservedAnalysis().
SmallVector<Pass *, 16> llvm::PMDataManager::PassVector [protected] |
Definition at line 373 of file LegacyPassManagers.h.
Referenced by add(), dumpPassArguments(), llvm::LPPassManager::getContainedPass(), llvm::RGPassManager::getContainedPass(), llvm::FPPassManager::getContainedPass(), getNumContainedPasses(), and ~PMDataManager().
PMTopLevelManager* llvm::PMDataManager::TPM [protected] |
Definition at line 370 of file LegacyPassManagers.h.
Referenced by add(), addLowerLevelRequiredPass(), collectRequiredAnalysis(), dumpLastUses(), findAnalysisPass(), getTopLevelManager(), initializeAnalysisImpl(), preserveHigherLevelAnalysis(), removeDeadPasses(), removeNotPreservedAnalysis(), llvm::RGPassManager::runOnFunction(), llvm::LPPassManager::runOnFunction(), setTopLevelManager(), and verifyPreservedAnalysis().