|
LLVM
4.0.0
|
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. More...
#include <PassSupport.h>
Public Member Functions | |
| RegisterPass (StringRef PassArg, StringRef Name, bool CFGOnly=false, bool is_analysis=false) | |
Public Member Functions inherited from llvm::PassInfo | |
| PassInfo (StringRef name, StringRef arg, const void *pi, NormalCtor_t normal, bool isCFGOnly, bool is_analysis, TargetMachineCtor_t machine=nullptr) | |
| PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass. More... | |
| PassInfo (StringRef name, const void *pi) | |
| PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass. More... | |
| StringRef | getPassName () const |
| getPassName - Return the friendly name for the pass, never returns null More... | |
| StringRef | getPassArgument () const |
| getPassArgument - Return the command line option that may be passed to 'opt' that will cause this pass to be run. More... | |
| const void * | getTypeInfo () const |
| getTypeInfo - Return the id object for the pass... More... | |
| bool | isPassID (const void *IDPtr) const |
| Return true if this PassID implements the specified ID pointer. More... | |
| bool | isAnalysisGroup () const |
| isAnalysisGroup - Return true if this is an analysis group, not a normal pass. More... | |
| bool | isAnalysis () const |
| bool | isCFGOnlyPass () const |
| isCFGOnlyPass - return true if this pass only looks at the CFG for the function. More... | |
| NormalCtor_t | getNormalCtor () const |
| getNormalCtor - Return a pointer to a function, that when called, creates an instance of the pass and returns it. More... | |
| void | setNormalCtor (NormalCtor_t Ctor) |
| TargetMachineCtor_t | getTargetMachineCtor () const |
| getTargetMachineCtor - Return a pointer to a function, that when called with a TargetMachine, creates an instance of the pass and returns it. More... | |
| void | setTargetMachineCtor (TargetMachineCtor_t Ctor) |
| Pass * | createPass () const |
| createPass() - Use this method to create an instance of this pass. More... | |
| void | addInterfaceImplemented (const PassInfo *ItfPI) |
| addInterfaceImplemented - This method is called when this pass is registered as a member of an analysis group with the RegisterAnalysisGroup template. More... | |
| const std::vector< const PassInfo * > & | getInterfacesImplemented () const |
| getInterfacesImplemented - Return a list of all of the analysis group interfaces implemented by this pass. More... | |
Additional Inherited Members | |
Public Types inherited from llvm::PassInfo | |
| typedef Pass *(* | NormalCtor_t )() |
| typedef Pass *(* | TargetMachineCtor_t )(TargetMachine *) |
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 102 of file PassSupport.h.
|
inline |
Definition at line 104 of file PassSupport.h.
References llvm::PassRegistry::getPassRegistry(), and llvm::PassRegistry::registerPass().
1.8.6