LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 ()
 ~RegisterPassBase ()

Protected Member Functions

void registerPass (PassInfo *)
void unregisterPass (PassInfo *)
void setOnlyUsesCFG ()

Protected Attributes

PassInfoPIObj

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 149 of file PassSupport.h.


Constructor & Destructor Documentation

llvm::RegisterPassBase::RegisterPassBase  )  [inline]
 

Definition at line 154 of file PassSupport.h.

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

Definition at line 155 of file PassSupport.h.

References 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 152 of file PassSupport.h.

References PIObj.

void RegisterPassBase::registerPass PassInfo  )  [protected]
 

Definition at line 333 of file Pass.cpp.

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

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

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 40 of file Pass.cpp.

References getCFGOnlyAnalyses(), and PIObj.

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

void RegisterPassBase::unregisterPass PassInfo  )  [protected]
 

Definition at line 349 of file Pass.cpp.

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

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


Member Data Documentation

PassInfo* llvm::RegisterPassBase::PIObj [protected]
 

Definition at line 160 of file PassSupport.h.

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


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