LLVM API Documentation
#include <Pass.h>
Public Member Functions | |
| Pass (intptr_t pid) | |
| Pass (const void *pid) | |
| virtual | ~Pass () |
| virtual const char * | getPassName () const |
| const PassInfo * | getPassInfo () const |
| virtual void | print (std::ostream &O, const Module *M) const |
| void | print (std::ostream *O, const Module *M) const |
| void | dump () const |
| virtual void | assignPassManager (PMStack &, PassManagerType=PMT_Unknown) |
| virtual void | preparePassManager (PMStack &) |
| Check if available pass managers are suitable for this pass or not. | |
| virtual PassManagerType | getPotentialPassManagerType () const |
| Return what kind of Pass Manager can manage this pass. | |
| void | setResolver (AnalysisResolver *AR) |
| AnalysisResolver * | getResolver () |
| virtual void | getAnalysisUsage (AnalysisUsage &) const |
| virtual void | releaseMemory () |
| virtual void | verifyAnalysis () const |
| virtual void | dumpPassStructure (unsigned Offset=0) |
| template<typename AnalysisType> | |
| AnalysisType * | getAnalysisIfAvailable () const |
| bool | mustPreserveAnalysisID (const PassInfo *AnalysisID) const |
| template<typename AnalysisType> | |
| AnalysisType & | getAnalysis () const |
| template<typename AnalysisType> | |
| AnalysisType & | getAnalysis (Function &F) |
| template<typename AnalysisType> | |
| AnalysisType & | getAnalysisID (const PassInfo *PI) const |
| template<typename AnalysisType> | |
| AnalysisType & | getAnalysisID (const PassInfo *PI, Function &F) |
Static Public Member Functions | |
| template<typename AnalysisClass> | |
| static const PassInfo * | getClassPassInfo () |
| static const PassInfo * | lookupPassInfo (intptr_t TI) |
Definition at line 72 of file Pass.h.
| const char * Pass::getPassName | ( | ) | const [virtual] |
getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.
getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.
Reimplemented in llvm::LPPassManager, llvm::FPPassManager, llvm::DebugLabelFolder, llvm::MachOWriter, llvm::X86ATTAsmPrinter, llvm::X86IntelAsmPrinter, and llvm::MPPassManager.
Definition at line 52 of file Pass.cpp.
References getPassInfo(), and PI.
Referenced by llvm::PMDataManager::addLowerLevelRequiredPass(), llvm::PMStack::dump(), llvm::PMDataManager::dumpPassInfo(), dumpPassStructure(), print(), llvm::PMDataManager::removeDeadPasses(), llvm::PMDataManager::removeNotPreservedAnalysis(), and llvm::PMDataManager::verifyDomInfo().
| const PassInfo * Pass::getPassInfo | ( | ) | const |
getPassInfo - Return the PassInfo data structure that corresponds to this pass... If the pass has not been registered, this will return null.
Definition at line 202 of file Pass.cpp.
References lookupPassInfo().
Referenced by getPassName(), llvm::PMDataManager::preserveHigherLevelAnalysis(), llvm::PMDataManager::recordAvailableAnalysis(), and llvm::PMTopLevelManager::schedulePass().
| void Pass::print | ( | std::ostream & | O, | |
| const Module * | M | |||
| ) | const [virtual] |
print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.
Reimplemented in llvm::DominatorTree, llvm::DominanceFrontierBase, llvm::FindUsedTypes, llvm::IntervalPartition, llvm::LoopInfo, llvm::LoopVR, llvm::PostDominatorTree, llvm::ScalarEvolution, llvm::LiveIntervals, llvm::LiveStacks, llvm::MachineDominatorTree, and llvm::SimpleRegisterCoalescing.
Definition at line 62 of file Pass.cpp.
References getPassName().
Referenced by dump(), llvm::operator<<(), and print().
| void llvm::Pass::print | ( | std::ostream * | O, | |
| const Module * | M | |||
| ) | const [inline] |
Reimplemented in llvm::DominanceFrontierBase, llvm::FindUsedTypes, llvm::IntervalPartition, llvm::ScalarEvolution, llvm::LiveIntervals, llvm::LiveStacks, and llvm::SimpleRegisterCoalescing.
Definition at line 110 of file Pass.h.
References print().
| void Pass::dump | ( | ) | const |
Definition at line 67 of file Pass.cpp.
References llvm::cerr(), and print().
Referenced by llvm::LiveIntervals::runOnMachineFunction(), and llvm::PMDataManager::verifyDomInfo().
| virtual void llvm::Pass::assignPassManager | ( | PMStack & | , | |
| PassManagerType | = PMT_Unknown | |||
| ) | [inline, virtual] |
Each pass is responsible for assigning a pass manager to itself. PMS is the stack of available pass manager.
Reimplemented in llvm::LoopPass, llvm::CallGraphSCCPass, llvm::ModulePass, llvm::FunctionPass, and llvm::BasicBlockPass.
Definition at line 115 of file Pass.h.
Referenced by llvm::PassManagerImpl::addTopLevelPass(), and llvm::FunctionPassManagerImpl::addTopLevelPass().
| virtual void llvm::Pass::preparePassManager | ( | PMStack & | ) | [inline, virtual] |
Check if available pass managers are suitable for this pass or not.
Reimplemented in llvm::LoopPass.
Definition at line 118 of file Pass.h.
Referenced by llvm::PMTopLevelManager::schedulePass().
| virtual PassManagerType llvm::Pass::getPotentialPassManagerType | ( | ) | const [inline, virtual] |
Return what kind of Pass Manager can manage this pass.
Reimplemented in llvm::LoopPass, llvm::CallGraphSCCPass, llvm::ModulePass, llvm::FunctionPass, and llvm::BasicBlockPass.
Definition at line 121 of file Pass.h.
References llvm::PMT_Unknown.
Referenced by llvm::MPPassManager::addLowerLevelRequiredPass(), and llvm::PMTopLevelManager::schedulePass().
| void llvm::Pass::setResolver | ( | AnalysisResolver * | AR | ) | [inline] |
Definition at line 126 of file Pass.h.
Referenced by llvm::PMDataManager::add(), llvm::PassManagerImpl::addTopLevelPass(), llvm::FunctionPassManagerImpl::addTopLevelPass(), and llvm::FunctionPassManager::FunctionPassManager().
| AnalysisResolver* llvm::Pass::getResolver | ( | ) | [inline] |
Definition at line 130 of file Pass.h.
Referenced by llvm::PMDataManager::add(), llvm::PMDataManager::initializeAnalysisImpl(), and llvm::PMDataManager::verifyDomInfo().
| virtual void llvm::Pass::getAnalysisUsage | ( | AnalysisUsage & | ) | const [inline, virtual] |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented in llvm::DominatorTree, llvm::DominanceFrontier, llvm::FindUsedTypes, llvm::IntervalPartition, llvm::LibCallAliasAnalysis, llvm::LoopInfo, llvm::LPPassManager, llvm::LoopVR, llvm::MemoryDependenceAnalysis, llvm::PostDominatorTree, llvm::PostDominanceFrontier, llvm::ScalarEvolution, llvm::CallGraphSCCPass, llvm::AsmPrinter, llvm::LiveIntervals, llvm::LiveStacks, llvm::LiveVariables, llvm::MachineDominatorTree, llvm::MachineLoopInfo, llvm::SelectionDAGISel, llvm::FPPassManager, llvm::Inliner, llvm::UnifyFunctionExitNodes, llvm::DebugLabelFolder, llvm::SimpleRegisterCoalescing, llvm::X86ATTAsmPrinter, llvm::RSProfilers_std, llvm::FunctionPassManagerImpl, llvm::MPPassManager, and llvm::PassManagerImpl.
Definition at line 139 of file Pass.h.
Referenced by llvm::PMDataManager::dumpPreservedSet(), llvm::PMDataManager::dumpRequiredSet(), llvm::PMTopLevelManager::findAnalysisUsage(), llvm::SimpleRegisterCoalescing::getAnalysisUsage(), llvm::DebugLabelFolder::getAnalysisUsage(), llvm::MachineDominatorTree::getAnalysisUsage(), llvm::LiveStacks::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), and llvm::AsmPrinter::getAnalysisUsage().
| virtual void llvm::Pass::releaseMemory | ( | ) | [inline, virtual] |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.
Optionally implement this function to release pass memory when it is no longer used.
Reimplemented in llvm::DominatorTree, llvm::DominanceFrontierBase, llvm::IntervalPartition, llvm::LoopInfo, llvm::LoopVR, llvm::MemoryDependenceAnalysis, llvm::ScalarEvolution, llvm::LiveIntervals, llvm::LiveStacks, llvm::LiveVariables, llvm::MachineDominatorTree, llvm::MachineLoopInfo, and llvm::SimpleRegisterCoalescing.
| virtual void llvm::Pass::verifyAnalysis | ( | ) | const [inline, virtual] |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
| void Pass::dumpPassStructure | ( | unsigned | Offset = 0 |
) | [virtual] |
Reimplemented in llvm::LPPassManager, llvm::FPPassManager, and llvm::MPPassManager.
Definition at line 44 of file Pass.cpp.
References llvm::cerr(), and getPassName().
Referenced by llvm::FPPassManager::dumpPassStructure(), llvm::MPPassManager::dumpPassStructure(), and llvm::LPPassManager::dumpPassStructure().
| static const PassInfo* llvm::Pass::getClassPassInfo | ( | ) | [inline, static] |
| const PassInfo * Pass::lookupPassInfo | ( | intptr_t | TI | ) | [static] |
Definition at line 206 of file Pass.cpp.
References getPassRegistrar().
Referenced by getClassPassInfo(), getPassInfo(), and llvm::RegisterAGBase::RegisterAGBase().
| AnalysisType * llvm::Pass::getAnalysisIfAvailable | ( | ) | const [inline] |
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. This is different than getAnalysis in that it can fail (if the analysis results haven't been computed), so should only be used if you can handle the case when the analysis is not available. This method is often used by transformation APIs to update analysis results for a pass automatically as the transform is performed.
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. This is different than getAnalysis in that it can fail (if the analysis results haven't been computed), so should only be used if you can handle the case when the analysis is not available. This method is often used by transformation APIs to update analysis results for a pass automatically as the transform is performed.
Definition at line 169 of file PassAnalysisSupport.h.
References llvm::AnalysisResolver::getAnalysisIfAvailable(), and PI.
Referenced by llvm::CloneLoop(), llvm::MergeBlockIntoPredecessor(), llvm::SplitBlock(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), and llvm::PMDataManager::verifyDomInfo().
| bool Pass::mustPreserveAnalysisID | ( | const PassInfo * | AnalysisID | ) | const |
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. This obviously cannot give you a properly typed instance of the class if you don't have the class name available (use getAnalysisIfAvailable if you do), but it can tell you if you need to preserve the pass at least.
Definition at line 39 of file Pass.cpp.
References llvm::AnalysisResolver::getAnalysisIfAvailable().
| AnalysisType & llvm::Pass::getAnalysis | ( | ) | const [inline] |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
Definition at line 183 of file PassAnalysisSupport.h.
Referenced by llvm::AliasAnalysis::InitializeAliasAnalysis().
| AnalysisType & llvm::Pass::getAnalysis | ( | Function & | F | ) | [inline] |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
Definition at line 216 of file PassAnalysisSupport.h.
| AnalysisType & llvm::Pass::getAnalysisID | ( | const PassInfo * | PI | ) | const [inline] |
Definition at line 190 of file PassAnalysisSupport.h.
References llvm::AnalysisResolver::findImplPass().
| AnalysisType & llvm::Pass::getAnalysisID | ( | const PassInfo * | PI, | |
| Function & | F | |||
| ) | [inline] |
Definition at line 223 of file PassAnalysisSupport.h.
References llvm::AnalysisResolver::findImplPass().