class Pass
Declaration
class Pass { /* full declaration omitted */ };
Description
Pass interface - Implemented by all 'passes'. Subclass this if you are an interprocedural optimization or you do not fit into any of the more constrained passes described below.
Declared at: llvm/include/llvm/Pass.h:78
Method Overview
- public Pass(const llvm::Pass &)
- public Pass(llvm::PassKind K, char & pid)
- public virtual void assignPassManager(llvm::PMStack &, llvm::PassManagerType)
- public static llvm::Pass * createPass(llvm::AnalysisID ID)
- public virtual llvm::Pass * createPrinterPass(llvm::raw_ostream & OS, const std::string & Banner) const
- public virtual bool doFinalization(llvm::Module &)
- public virtual bool doInitialization(llvm::Module &)
- public void dump() const
- public virtual void dumpPassStructure(unsigned int Offset = 0)
- public virtual void * getAdjustedAnalysisPointer(llvm::AnalysisID ID)
- public template <typename AnalysisType>AnalysisType & getAnalysis(llvm::Function & F)
- public template <typename AnalysisType>AnalysisType & getAnalysis() const
- public template <typename AnalysisType>AnalysisType & getAnalysisID(llvm::AnalysisID PI, llvm::Function & F)
- public template <typename AnalysisType>AnalysisType & getAnalysisID(llvm::AnalysisID PI) const
- public template <typename AnalysisType>AnalysisType * getAnalysisIfAvailable() const
- public virtual void getAnalysisUsage(llvm::AnalysisUsage &) const
- public virtual llvm::ImmutablePass * getAsImmutablePass()
- public virtual llvm::PMDataManager * getAsPMDataManager()
- public llvm::AnalysisID getPassID() const
- public llvm::PassKind getPassKind() const
- public virtual llvm::StringRef getPassName() const
- public virtual llvm::PassManagerType getPotentialPassManagerType() const
- public llvm::AnalysisResolver * getResolver() const
- public static const llvm::PassInfo * lookupPassInfo(const void * TI)
- public static const llvm::PassInfo * lookupPassInfo(llvm::StringRef Arg)
- public bool mustPreserveAnalysisID(char & AID) const
- public virtual void preparePassManager(llvm::PMStack &)
- public virtual void print(llvm::raw_ostream & OS, const llvm::Module * M) const
- public virtual void releaseMemory()
- public void setResolver(llvm::AnalysisResolver * AR)
- public virtual void verifyAnalysis() const
- public virtual ~Pass()
Methods
¶Pass(const llvm::Pass&)
Pass(const llvm::Pass&)
Declared at: llvm/include/llvm/Pass.h:85
Parameters
- const llvm::Pass&
¶Pass(llvm::PassKind K, char& pid)
Pass(llvm::PassKind K, char& pid)
Declared at: llvm/include/llvm/Pass.h:84
Parameters
- llvm::PassKind K
- char& pid
¶virtual void assignPassManager(
llvm::PMStack&,
llvm::PassManagerType)
virtual void assignPassManager(
llvm::PMStack&,
llvm::PassManagerType)
Description
Each pass is responsible for assigning a pass manager to itself. PMS is the stack of available pass manager.
Declared at: llvm/include/llvm/Pass.h:126
Parameters
- llvm::PMStack&
- llvm::PassManagerType
¶static llvm::Pass* createPass(llvm::AnalysisID ID)
static llvm::Pass* createPass(llvm::AnalysisID ID)
Declared at: llvm/include/llvm/Pass.h:182
Parameters
- llvm::AnalysisID ID
¶virtual llvm::Pass* createPrinterPass(
llvm::raw_ostream& OS,
const std::string& Banner) const
virtual llvm::Pass* createPrinterPass(
llvm::raw_ostream& OS,
const std::string& Banner) const
Description
createPrinterPass - Get a Pass appropriate to print the IR this pass operates on (Module, Function or MachineFunction).
Declared at: llvm/include/llvm/Pass.h:121
Parameters
- llvm::raw_ostream& OS
- const std::string& Banner
¶virtual bool doFinalization(llvm::Module&)
virtual bool doFinalization(llvm::Module&)
Description
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run.
Declared at: llvm/include/llvm/Pass.h:107
Parameters
¶virtual bool doInitialization(llvm::Module&)
virtual bool doInitialization(llvm::Module&)
Description
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run.
Declared at: llvm/include/llvm/Pass.h:103
Parameters
¶void dump() const
void dump() const
Declared at: llvm/include/llvm/Pass.h:117
¶virtual void dumpPassStructure(
unsigned int Offset = 0)
virtual void dumpPassStructure(
unsigned int Offset = 0)
Declared at: llvm/include/llvm/Pass.h:170
Parameters
- unsigned int Offset = 0
¶virtual void* getAdjustedAnalysisPointer(
llvm::AnalysisID ID)
virtual void* getAdjustedAnalysisPointer(
llvm::AnalysisID ID)
Description
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. If needed, it should override this to adjust the this pointer as needed for the specified pass info.
Declared at: llvm/include/llvm/Pass.h:161
Parameters
- llvm::AnalysisID ID
¶template <typename AnalysisType>
AnalysisType& getAnalysis(llvm::Function& F)
template <typename AnalysisType>
AnalysisType& getAnalysis(llvm::Function& F)
Description
getAnalysis <AnalysisType >() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
Declared at: llvm/include/llvm/Pass.h:208
Templates
- AnalysisType
Parameters
¶template <typename AnalysisType>
AnalysisType& getAnalysis() const
template <typename AnalysisType>
AnalysisType& getAnalysis() const
Description
getAnalysis <AnalysisType >() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
Declared at: llvm/include/llvm/Pass.h:205
Templates
- AnalysisType
¶template <typename AnalysisType>
AnalysisType& getAnalysisID(llvm::AnalysisID PI,
llvm::Function& F)
template <typename AnalysisType>
AnalysisType& getAnalysisID(llvm::AnalysisID PI,
llvm::Function& F)
Declared at: llvm/include/llvm/Pass.h:214
Templates
- AnalysisType
Parameters
- llvm::AnalysisID PI
- llvm::Function& F
¶template <typename AnalysisType>
AnalysisType& getAnalysisID(
llvm::AnalysisID PI) const
template <typename AnalysisType>
AnalysisType& getAnalysisID(
llvm::AnalysisID PI) const
Declared at: llvm/include/llvm/Pass.h:211
Templates
- AnalysisType
Parameters
- llvm::AnalysisID PI
¶template <typename AnalysisType>
AnalysisType* getAnalysisIfAvailable() const
template <typename AnalysisType>
AnalysisType* getAnalysisIfAvailable() const
Description
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.
Declared at: llvm/include/llvm/Pass.h:192
Templates
- AnalysisType
¶virtual void getAnalysisUsage(
llvm::AnalysisUsage&) const
virtual void getAnalysisUsage(
llvm::AnalysisUsage&) const
Description
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.
Declared at: llvm/include/llvm/Pass.h:143
Parameters
¶virtual llvm::ImmutablePass* getAsImmutablePass()
virtual llvm::ImmutablePass* getAsImmutablePass()
Declared at: llvm/include/llvm/Pass.h:162
¶virtual llvm::PMDataManager* getAsPMDataManager()
virtual llvm::PMDataManager* getAsPMDataManager()
Declared at: llvm/include/llvm/Pass.h:163
¶llvm::AnalysisID getPassID() const
llvm::AnalysisID getPassID() const
Description
getPassID - Return the PassID number that corresponds to this pass.
Declared at: llvm/include/llvm/Pass.h:97
¶llvm::PassKind getPassKind() const
llvm::PassKind getPassKind() const
Declared at: llvm/include/llvm/Pass.h:89
¶virtual llvm::StringRef getPassName() const
virtual llvm::StringRef getPassName() const
Description
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.
Declared at: llvm/include/llvm/Pass.h:94
¶virtual llvm::PassManagerType
getPotentialPassManagerType() const
virtual llvm::PassManagerType
getPotentialPassManagerType() const
Description
Return what kind of Pass Manager can manage this pass.
Declared at: llvm/include/llvm/Pass.h:133
¶llvm::AnalysisResolver* getResolver() const
llvm::AnalysisResolver* getResolver() const
Declared at: llvm/include/llvm/Pass.h:137
¶static const llvm::PassInfo* lookupPassInfo(
const void* TI)
static const llvm::PassInfo* lookupPassInfo(
const void* TI)
Declared at: llvm/include/llvm/Pass.h:174
Parameters
- const void* TI
¶static const llvm::PassInfo* lookupPassInfo(
llvm::StringRef Arg)
static const llvm::PassInfo* lookupPassInfo(
llvm::StringRef Arg)
Declared at: llvm/include/llvm/Pass.h:178
Parameters
- llvm::StringRef Arg
¶bool mustPreserveAnalysisID(char& AID) const
bool mustPreserveAnalysisID(char& AID) const
Description
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.
Declared at: llvm/include/llvm/Pass.h:199
Parameters
- char& AID
¶virtual void preparePassManager(llvm::PMStack&)
virtual void preparePassManager(llvm::PMStack&)
Description
Check if available pass managers are suitable for this pass or not.
Declared at: llvm/include/llvm/Pass.h:130
Parameters
¶virtual void print(llvm::raw_ostream& OS,
const llvm::Module* M) const
virtual void print(llvm::raw_ostream& OS,
const llvm::Module* M) const
Description
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.
Declared at: llvm/include/llvm/Pass.h:115
Parameters
- llvm::raw_ostream& OS
- const llvm::Module* M
¶virtual void releaseMemory()
virtual void releaseMemory()
Description
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.
Declared at: llvm/include/llvm/Pass.h:155
¶void setResolver(llvm::AnalysisResolver* AR)
void setResolver(llvm::AnalysisResolver* AR)
Declared at: llvm/include/llvm/Pass.h:136
Parameters
¶virtual void verifyAnalysis() const
virtual void verifyAnalysis() const
Description
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
Declared at: llvm/include/llvm/Pass.h:167
¶virtual ~Pass()
virtual ~Pass()
Declared at: llvm/include/llvm/Pass.h:87