LLVM API Documentation

llvm::RegisterPassBase Struct Reference

#include <PassSupport.h>

Inheritance diagram for llvm::RegisterPassBase:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

const PassInfogetPassInfo () const
 RegisterPassBase (const char *Name, const char *Arg, const std::type_info &TI, unsigned char PT, Pass *(*Normal)()=0, Pass *(*TargetCtor)(TargetMachine &)=0)
 RegisterPassBase (const std::type_info &TI, unsigned char PT)
 ~RegisterPassBase ()

Protected Member Functions

void registerPass ()
void unregisterPass ()
void setOnlyUsesCFG ()

Protected Attributes

PassInfo PIObj

Detailed Description

RegisterPass<t> template - This template class is used to notify the system that a Pass is available for use, and registers it into the internal database maintained by the PassManager. Unless this template is used, opt, for example will not be able to see the pass and attempts to create the pass will fail. This template is used in the follow manner (at global scope, in your .cpp file):

static RegisterPass<YourPassClassName> tmp("passopt", "My Pass Name");

This statement will cause your pass to be created by calling the default constructor exposed by the pass. If you have a different constructor that must be called, create a global constructor function (which takes the arguments you need and returns a Pass*) and register your pass like this:

Pass *createMyPass(foo &opt) { return new MyPass(opt); } static RegisterPass<PassClassName> tmp("passopt", "My Name", createMyPass);

Definition at line 150 of file PassSupport.h.


Constructor & Destructor Documentation

llvm::RegisterPassBase::RegisterPassBase ( const char *  Name,
const char *  Arg,
const std::type_info &  TI,
unsigned char  PT,
Pass *(*)()  Normal = 0,
Pass *(*)(TargetMachine &)  TargetCtor = 0 
) [inline]

Definition at line 155 of file PassSupport.h.

References registerPass().

llvm::RegisterPassBase::RegisterPassBase ( const std::type_info &  TI,
unsigned char  PT 
) [inline]

Definition at line 161 of file PassSupport.h.

References llvm::PassInfo::AnalysisGroup.

llvm::RegisterPassBase::~RegisterPassBase (  )  [inline]

Definition at line 168 of file PassSupport.h.

References llvm::PassInfo::AnalysisGroup, llvm::PassInfo::getPassType(), PIObj, and unregisterPass().


Member Function Documentation

const PassInfo* llvm::RegisterPassBase::getPassInfo (  )  const [inline]

getPassInfo - Get the pass info for the registered class...

Definition at line 153 of file PassSupport.h.

References PIObj.

void RegisterPassBase::registerPass (  )  [protected]

Definition at line 328 of file Pass.cpp.

References E, llvm::PassInfo::getTypeInfo(), and PIObj.

Referenced by llvm::RegisterAGBase::RegisterAGBase(), and RegisterPassBase().

void RegisterPassBase::unregisterPass (  )  [protected]

Definition at line 343 of file Pass.cpp.

References E, llvm::PassInfo::getTypeInfo(), and PIObj.

Referenced by llvm::RegisterAGBase::~RegisterAGBase(), and ~RegisterPassBase().

void RegisterPassBase::setOnlyUsesCFG (  )  [protected]

setOnlyUsesCFG - Notice that this pass only depends on the CFG, so transformations that do not modify the CFG do not invalidate this pass.

Definition at line 37 of file Pass.cpp.

References getCFGOnlyAnalyses(), and PIObj.

Referenced by llvm::RegisterAnalysis< PassName >::RegisterAnalysis(), and llvm::RegisterOpt< PassName >::RegisterOpt().


Member Data Documentation

PassInfo llvm::RegisterPassBase::PIObj [protected]

Definition at line 175 of file PassSupport.h.

Referenced by getPassInfo(), llvm::RegisterAGBase::RegisterAGBase(), registerPass(), setOnlyUsesCFG(), unregisterPass(), llvm::RegisterAGBase::~RegisterAGBase(), and ~RegisterPassBase().


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