LLVM API Documentation
#include <Pass.h>
Public Member Functions | |
BasicBlockPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const override |
createPrinterPass - Get a basic block printer pass. | |
virtual bool | doInitialization (Function &) |
virtual bool | runOnBasicBlock (BasicBlock &BB)=0 |
virtual bool | doFinalization (Function &) |
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 BasicBlock &BB) const |
BasicBlockPass class - This class is used to implement most local optimizations. Optimizations should subclass this class if they meet the following constraints: 1. Optimizations are local, operating on either a basic block or instruction at a time. 2. Optimizations do not modify the CFG of the contained function, or any other basic block in the function. 3. Optimizations conform to all of the constraints of FunctionPasses.
llvm::BasicBlockPass::BasicBlockPass | ( | char & | pid | ) | [inline, explicit] |
void BasicBlockPass::assignPassManager | ( | PMStack & | PMS, |
PassManagerType | PreferredType | ||
) | [override, virtual] |
Find appropriate Basic Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager.
Reimplemented from llvm::Pass.
Definition at line 1905 of file LegacyPassManager.cpp.
References llvm::PMTopLevelManager::addIndirectPassManager(), llvm::PMStack::empty(), llvm::PMDataManager::getPassManagerType(), llvm::PMT_BasicBlockPassManager, llvm::PMStack::push(), and llvm::PMStack::top().
Pass * BasicBlockPass::createPrinterPass | ( | raw_ostream & | O, |
const std::string & | Banner | ||
) | const [override, virtual] |
createPrinterPass - Get a basic block printer pass.
Implements llvm::Pass.
Definition at line 156 of file Pass.cpp.
References llvm::createPrintBasicBlockPass().
bool BasicBlockPass::doFinalization | ( | Function & | ) | [virtual] |
doFinalization - Virtual method overriden by BasicBlockPass subclasses to do any post processing needed after all passes have run.
bool BasicBlockPass::doInitialization | ( | Function & | ) | [virtual] |
doInitialization - Virtual method overridden by BasicBlockPass subclasses to do any necessary per-function initialization.
PassManagerType BasicBlockPass::getPotentialPassManagerType | ( | ) | const [override, virtual] |
Return what kind of Pass Manager can manage this pass.
Reimplemented from llvm::Pass.
Definition at line 183 of file Pass.cpp.
References llvm::PMT_BasicBlockPassManager.
virtual bool llvm::BasicBlockPass::runOnBasicBlock | ( | BasicBlock & | BB | ) | [pure virtual] |
runOnBasicBlock - Virtual method overriden by subclasses to do the per-basicblock processing of the pass.
bool BasicBlockPass::skipOptnoneFunction | ( | const BasicBlock & | BB | ) | const [protected] |
skipOptnoneFunction - Containing function has Attribute::OptimizeNone and most transformation passes should skip it.
Definition at line 171 of file Pass.cpp.
References llvm::dbgs(), DEBUG, F(), llvm::Function::getEntryBlock(), llvm::Value::getName(), llvm::BasicBlock::getParent(), llvm::Pass::getPassName(), llvm::Function::hasFnAttribute(), and llvm::Attribute::OptimizeNone.