LLVM API Documentation

Public Member Functions | Protected Member Functions
llvm::BasicBlockPass Class Reference

#include <Pass.h>

Inheritance diagram for llvm::BasicBlockPass:
Inheritance graph
[legend]
Collaboration diagram for llvm::BasicBlockPass:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BasicBlockPass (char &pid)
PasscreatePrinterPass (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

Detailed Description

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.

Definition at line 330 of file Pass.h.


Constructor & Destructor Documentation

llvm::BasicBlockPass::BasicBlockPass ( char &  pid) [inline, explicit]

Definition at line 332 of file Pass.h.


Member Function Documentation

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().

doFinalization - Virtual method overriden by BasicBlockPass subclasses to do any post processing needed after all passes have run.

Definition at line 166 of file Pass.cpp.

doInitialization - Virtual method overridden by BasicBlockPass subclasses to do any necessary per-function initialization.

Definition at line 161 of file Pass.cpp.

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.

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.


The documentation for this class was generated from the following files: