LLVM API Documentation
#include <Pass.h>
Inheritance diagram for llvm::Pass:
Public Member Functions | |
Pass () | |
virtual | ~Pass () |
virtual const char * | getPassName () const |
const PassInfo * | getPassInfo () const |
virtual bool | runPass (Module &M)=0 |
virtual void | print (std::ostream &O, const Module *M) const |
virtual void | print (std::ostream &O) const |
void | dump () const |
virtual void | getAnalysisUsage (AnalysisUsage &Info) const |
virtual void | releaseMemory () |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType> | |
AnalysisType * | getAnalysisToUpdate () const |
bool | mustPreserveAnalysisID (const PassInfo *AnalysisID) const |
template<typename AnalysisType> | |
AnalysisType & | getAnalysis () const |
template<typename AnalysisType> | |
AnalysisType & | getAnalysisID (const PassInfo *PI) const |
Static Public Member Functions | |
template<typename AnalysisClass> | |
static const PassInfo * | getClassPassInfo () |
static const PassInfo * | lookupPassInfo (const std::type_info &TI) |
Friends | |
struct | AnalysisResolver |
class | PassManagerT< Module > |
class | PassManagerT< Function > |
class | PassManagerT< BasicBlock > |
Definition at line 58 of file Pass.h.
|
|
|
|
|
Reimplemented in llvm::CallGraph, llvm::IPModRef, llvm::MemoryDepAnalysis, and llvm::PgmDependenceGraph. Definition at line 225 of file Pass.cpp. References print(). Referenced by llvm::LiveIntervals::runOnMachineFunction(). |
|
Reimplemented in llvm::PassManagerT< Module >, and llvm::PassManagerT< Function >. Definition at line 204 of file Pass.cpp. References getPassName(). Referenced by llvm::PMDebug::PerformPassStartupStuff(). |
|
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 164 of file Pass.h. Referenced by llvm::AliasAnalysis::InitializeAliasAnalysis(). |
|
Definition at line 171 of file Pass.h. References first. |
|
getAnalysisToUpdate<AnalysisType>() - This function is used by subclasses to get to the analysis information that might be around that needs to be updated. This is different than getAnalysis in that it can fail (ie the analysis results haven't been computed), so should only be used if you provide the capability to update an analysis that exists. This method is often used by transformation APIs to update analysis results for a pass automatically as the transform is performed. Definition at line 144 of file PassAnalysisSupport.h. References llvm::AnalysisResolver::getAnalysisToUpdate(). Referenced by llvm::SplitCriticalEdge(). |
|
|
Definition at line 132 of file Pass.h. References lookupPassInfo(). |
|
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 322 of file Pass.cpp. References lookupPassInfo(). Referenced by getPassName(), and llvm::PassManagerT< Function >::runOnUnit(). |
|
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, and if nothing else is available, C++ RTTI will be consulted to get a SOMEWHAT intelligible name for the pass. Reimplemented in llvm::ModuloSchedulingPass, llvm::PhyRegAlloc, llvm::SparcV9CodeEmitter, llvm::PeepholeOpts, llvm::PassManagerTraits< BasicBlock >, llvm::PassManagerTraits< Function >, and llvm::PassManagerTraits< Module >. Definition at line 210 of file Pass.cpp. References getPassInfo(). Referenced by llvm::PassManagerT< Function >::addPass(), dumpPassStructure(), print(), llvm::PMDebug::PrintAnalysisSetInfo(), llvm::PMDebug::PrintPassInformation(), and llvm::PassManagerT< Function >::runOnUnit(). |
|
Definition at line 327 of file Pass.cpp. References I. Referenced by getClassPassInfo(), getPassInfo(), and llvm::RegisterAGBase::RegisterAGBase(). |
|
mustPreserveAnalysisID - This method serves the same function as getAnalysisToUpdate, 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 getAnalysisToUpdate if you do), but it can tell you if you need to preserve the pass at least. Definition at line 199 of file Pass.cpp. References llvm::AnalysisResolver::getAnalysisToUpdate(). |
|
Reimplemented in llvm::ImmediateDominatorsBase, llvm::DominatorSetBase, llvm::DominatorTreeBase, llvm::DominanceFrontierBase, llvm::IntervalPartition, llvm::LoopInfo, llvm::ScalarEvolution, llvm::IPModRef, llvm::MemoryDepAnalysis, llvm::PgmDependenceGraph, and llvm::LiveIntervals. Definition at line 220 of file Pass.cpp. References getPassName(). |
|
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::CallGraph, llvm::LocalDataStructures, llvm::BUDataStructures, llvm::TDDataStructures, llvm::CompleteBUDataStructures, llvm::FindUnsafePointerTypes, and llvm::FindUsedTypes. Definition at line 99 of file Pass.h. Referenced by dump(), and llvm::operator<<(). |
|
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::CallGraph, llvm::LocalDataStructures, llvm::BUDataStructures, llvm::ImmediateDominatorsBase, llvm::DominatorSetBase, llvm::DominatorTreeBase, llvm::DominanceFrontierBase, llvm::LoopInfo, llvm::ScalarEvolution, llvm::LiveVariables, llvm::IPModRef, llvm::MemoryDepAnalysis, llvm::LiveIntervals, and llvm::FunctionLiveVarInfo. |
|
runPass - Run this pass, returning true if a modification was made to the module argument. This should be implemented by all concrete subclasses. Implemented in llvm::ModulePass. |
|
|
|
Reimplemented in llvm::FunctionPass, and llvm::BasicBlockPass. |
|
Reimplemented in llvm::FunctionPass, and llvm::BasicBlockPass. |
|
Reimplemented in llvm::ImmutablePass, and llvm::FunctionPass. |