LLVM API Documentation
#include <Pass.h>
Public Member Functions | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const override |
createPrinterPass - Get a function printer pass. | |
virtual bool | runOnFunction (Function &F)=0 |
void | assignPassManager (PMStack &PMS, PassManagerType T) override |
PassManagerType | getPotentialPassManagerType () const override |
Return what kind of Pass Manager can manage this pass. | |
Protected Member Functions | |
bool | skipOptnoneFunction (const Function &F) const |
FunctionPass class - This class is used to implement most global optimizations. Optimizations should subclass this class if they meet the following constraints:
1. Optimizations are organized globally, i.e., a function at a time 2. Optimizing a function does not cause the addition or removal of any functions in the module
llvm::FunctionPass::FunctionPass | ( | char & | pid | ) | [inline, explicit] |
void FunctionPass::assignPassManager | ( | PMStack & | PMS, |
PassManagerType | PreferredType | ||
) | [override, virtual] |
Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager.
Reimplemented from llvm::Pass.
Definition at line 1864 of file LegacyPassManager.cpp.
References llvm::PMDataManager::add(), llvm::PMTopLevelManager::addIndirectPassManager(), llvm::ModulePass::assignPassManager(), llvm::PMStack::empty(), llvm::PMDataManager::getPassManagerType(), llvm::PMT_FunctionPassManager, llvm::PMStack::pop(), llvm::PMDataManager::populateInheritedAnalysis(), llvm::PMStack::push(), and llvm::PMStack::top().
Pass * FunctionPass::createPrinterPass | ( | raw_ostream & | O, |
const std::string & | Banner | ||
) | const [override, virtual] |
createPrinterPass - Get a function printer pass.
Implements llvm::Pass.
Definition at line 134 of file Pass.cpp.
References llvm::createPrintFunctionPass().
PassManagerType FunctionPass::getPotentialPassManagerType | ( | ) | const [override, virtual] |
Return what kind of Pass Manager can manage this pass.
Reimplemented from llvm::Pass.
Definition at line 139 of file Pass.cpp.
References llvm::PMT_FunctionPassManager.
virtual bool llvm::FunctionPass::runOnFunction | ( | Function & | F | ) | [pure virtual] |
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Implemented in llvm::DependenceAnalysis, llvm::ScalarEvolution, llvm::RegionInfoPass, llvm::LoopInfo, llvm::MemoryDependenceAnalysis, llvm::DominanceFrontier, llvm::DominatorTreeWrapperPass, llvm::StackProtector, llvm::InstCombiner, llvm::LPPassManager, llvm::RGPassManager, llvm::LazyValueInfo, llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >, llvm::IntervalPartition, llvm::LibCallAliasAnalysis, llvm::BranchProbabilityInfo, llvm::UnifyFunctionExitNodes, llvm::NVPTXAllocaHoisting, llvm::BlockFrequencyInfo, llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >, llvm::final< T >, llvm::NVPTXLowerAggrCopies, and llvm::PostDominatorTree.
Referenced by llvm::FPPassManager::runOnFunction().
bool FunctionPass::skipOptnoneFunction | ( | const Function & | F | ) | const [protected] |
skipOptnoneFunction - This function has Attribute::OptimizeNone and most transformation passes should skip it.
Definition at line 143 of file Pass.cpp.
References llvm::dbgs(), DEBUG, llvm::Value::getName(), llvm::Pass::getPassName(), llvm::Function::hasFnAttribute(), and llvm::Attribute::OptimizeNone.