LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::RegisterPass< passName > Struct Template Reference

#include <PassSupport.h>

Inheritance diagram for llvm::RegisterPass< passName >:
Inheritance graph
[legend]
Collaboration diagram for llvm::RegisterPass< passName >:
Collaboration graph
[legend]

Public Member Functions

 RegisterPass (const char *PassArg, const char *Name, bool CFGOnly=false, bool is_analysis=false)
 
- Public Member Functions inherited from llvm::PassInfo
 PassInfo (const char *name, const char *arg, const void *pi, NormalCtor_t normal, bool isCFGOnly, bool is_analysis)
 
 PassInfo (const char *name, const void *pi)
 
const char * getPassName () const
 
const char * getPassArgument () const
 
const void * getTypeInfo () const
 
bool isPassID (const void *IDPtr) const
 Return true if this PassID implements the specified ID pointer. More...
 
bool isAnalysisGroup () const
 
bool isAnalysis () const
 
bool isCFGOnlyPass () const
 
NormalCtor_t getNormalCtor () const
 
void setNormalCtor (NormalCtor_t Ctor)
 
PasscreatePass () const
 createPass() - Use this method to create an instance of this pass. More...
 
void addInterfaceImplemented (const PassInfo *ItfPI)
 
const std::vector< const
PassInfo * > & 
getInterfacesImplemented () const
 

Additional Inherited Members

- Public Types inherited from llvm::PassInfo
typedef Pass *(* NormalCtor_t )()
 

Detailed Description

template<typename passName>
struct llvm::RegisterPass< passName >

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:

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

Definition at line 203 of file PassSupport.h.

Constructor & Destructor Documentation

template<typename passName>
llvm::RegisterPass< passName >::RegisterPass ( const char *  PassArg,
const char *  Name,
bool  CFGOnly = false,
bool  is_analysis = false 
)
inline

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