43 class AnalysisResolver;
85 void operator=(
const Pass&) =
delete;
90 : Resolver(nullptr), PassID(&pid), Kind(K) { }
130 const std::string &Banner)
const = 0;
201 template<
typename AnalysisType> AnalysisType *
216 template<
typename AnalysisType>
219 template<
typename AnalysisType>
222 template<
typename AnalysisType>
225 template<
typename AnalysisType>
239 const std::string &Banner)
const override;
304 const std::string &Banner)
const override;
341 const std::string &Banner)
const override;
Pass interface - Implemented by all 'passes'.
PassManagerType
Different types of internal pass managers.
virtual Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const =0
createPrinterPass - Get a Pass appropriate to print the IR this pass operates on (Module, Function or MachineFunction).
virtual PMDataManager * getAsPMDataManager()
virtual void dumpPassStructure(unsigned Offset=0)
virtual bool runOnModule(Module &M)=0
runOnModule - Virtual method overriden by subclasses to process the module being operated on...
AnalysisType & getAnalysisID(AnalysisID PI) const
A Module instance is used to store all the information related to an LLVM module. ...
AnalysisID getPassID() const
getPassID - Return the PassID number that corresponds to this pass.
virtual void releaseMemory()
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void assignPassManager(PMStack &PMS, PassManagerType T) override
Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into t...
virtual void verifyAnalysis() const
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
virtual bool doInitialization(Function &)
doInitialization - Virtual method overridden by BasicBlockPass subclasses to do any necessary per-fun...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
virtual void preparePassManager(PMStack &)
Check if available pass managers are suitable for this pass or not.
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
virtual void initializePass()
initializePass - This method may be overriden by immutable passes to allow them to perform various in...
bool skipBasicBlock(const BasicBlock &BB) const
Optional passes call this function to check whether the pass should be skipped.
void setResolver(AnalysisResolver *AR)
Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const override
createPrinterPass - Get a basic block printer pass.
AnalysisType * getAnalysisIfAvailable() const
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information tha...
virtual bool doFinalization(Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
bool mustPreserveAnalysisID(char &AID) const
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID.
PMStack - This class implements a stack data structure of PMDataManager pointers. ...
void assignPassManager(PMStack &PMS, PassManagerType T) override
Find appropriate Module Pass Manager in the PM Stack and add self into that manager.
bool runOnModule(Module &) override
ImmutablePasses are never run.
PassKind getPassKind() const
virtual bool doFinalization(Function &)
doFinalization - Virtual method overriden by BasicBlockPass subclasses to do any post processing need...
virtual ImmutablePass * getAsImmutablePass()
static const PassInfo * lookupPassInfo(const void *TI)
virtual bool doInitialization(Module &)
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
void assignPassManager(PMStack &PMS, PassManagerType T) override
Find appropriate Basic Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that...
LLVM Basic Block Representation.
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
AnalysisResolver * getResolver() const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.
PassInfo class - An instance of this class exists for every pass known by the system, and can be obtained from a live Pass by calling its getPassInfo() method.
BasicBlockPass class - This class is used to implement most local optimizations.
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
bool skipModule(Module &M) const
Optional passes call this function to check whether the pass should be skipped.
ImmutablePass class - This class is used to provide information that does not need to be run...
bool isFunctionInPrintList(StringRef FunctionName)
isFunctionInPrintList - returns true if a function should be printed via
Pass(PassKind K, char &pid)
BasicBlockPass(char &pid)
Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const override
createPrinterPass - Get a module printer pass.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
~ImmutablePass() override
PMDataManager provides the common place to manage the analysis data used by pass managers.
static Pass * createPass(AnalysisID ID)
Pass * createPrinterPass(raw_ostream &O, const std::string &Banner) const override
createPrinterPass - Get a function printer pass.
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
virtual bool runOnBasicBlock(BasicBlock &BB)=0
runOnBasicBlock - Virtual method overriden by subclasses to do the per-basicblock processing of the p...
virtual void * getAdjustedAnalysisPointer(AnalysisID ID)
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through...
This class implements an extremely fast bulk output stream that can only output to a stream...
ImmutablePass * getAsImmutablePass() override
virtual void print(raw_ostream &O, const Module *M) const
print - Print out the internal state of the pass.
StringRef - Represent a constant reference to a string, i.e.
PassManagerType getPotentialPassManagerType() const override
Return what kind of Pass Manager can manage this pass.
bool TimePassesIsEnabled
If the user specifies the -time-passes argument on an LLVM tool command line then the value of this b...
virtual PassManagerType getPotentialPassManagerType() const
Return what kind of Pass Manager can manage this pass.
virtual void assignPassManager(PMStack &, PassManagerType)
Each pass is responsible for assigning a pass manager to itself.