LLVM API Documentation

llvm::FunctionPass Class Reference

#include <Pass.h>

Inheritance diagram for llvm::FunctionPass:
[legend]
Collaboration diagram for llvm::FunctionPass:
[legend]

List of all members.

Public Member Functions

 FunctionPass (intptr_t pid)
 FunctionPass (const void *pid)
virtual bool doInitialization (Module &)
virtual bool runOnFunction (Function &F)=0
virtual bool doFinalization (Module &)
virtual bool runOnModule (Module &M)
bool run (Function &F)
virtual void assignPassManager (PMStack &PMS, PassManagerType T=PMT_FunctionPassManager)
virtual PassManagerType getPotentialPassManagerType () const
 Return what kind of Pass Manager can manage this pass.


Detailed Description

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

Definition at line 274 of file Pass.h.


Constructor & Destructor Documentation

llvm::FunctionPass::FunctionPass ( intptr_t  pid  )  [inline, explicit]

Definition at line 276 of file Pass.h.

llvm::FunctionPass::FunctionPass ( const void *  pid  )  [inline, explicit]

Definition at line 277 of file Pass.h.


Member Function Documentation

virtual bool llvm::FunctionPass::doInitialization ( Module &   )  [inline, virtual]

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

Reimplemented in llvm::AsmPrinter, llvm::ELFWriter, llvm::MachOWriter, llvm::PIC16AsmPrinter, llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.

Definition at line 282 of file Pass.h.

Referenced by llvm::FPPassManager::doInitialization(), run(), and runOnModule().

virtual bool llvm::FunctionPass::runOnFunction ( Function &  F  )  [pure virtual]

virtual bool llvm::FunctionPass::doFinalization ( Module &   )  [inline, virtual]

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

Reimplemented in llvm::AsmPrinter, llvm::ELFWriter, llvm::MachOWriter, llvm::PIC16AsmPrinter, llvm::X86ATTAsmPrinter, and llvm::X86IntelAsmPrinter.

Definition at line 292 of file Pass.h.

Referenced by llvm::FPPassManager::doFinalization(), run(), and runOnModule().

bool FunctionPass::runOnModule ( Module &  M  )  [virtual]

runOnModule - On a module, we run this pass by initializing, ronOnFunction'ing once for every function in the module, then by finalizing.

Definition at line 84 of file Pass.cpp.

References llvm::Module::begin(), Changed, doFinalization(), doInitialization(), E, llvm::Module::end(), and runOnFunction().

bool FunctionPass::run ( Function &  F  ) 

run - On a function, we simply initialize, run the function, then finalize.

Definition at line 96 of file Pass.cpp.

References Changed, doFinalization(), doInitialization(), llvm::GlobalValue::getParent(), llvm::Function::isDeclaration(), and runOnFunction().

void FunctionPass::assignPassManager ( PMStack &  PMS,
PassManagerType  PreferredType = PMT_FunctionPassManager 
) [virtual]

virtual PassManagerType llvm::FunctionPass::getPotentialPassManagerType (  )  const [inline, virtual]

Return what kind of Pass Manager can manage this pass.

Reimplemented from llvm::Pass.

Definition at line 309 of file Pass.h.

References llvm::PMT_FunctionPassManager.


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