-struct RegisterPassBase {
- /// getPassInfo - Get the pass info for the registered class...
- ///
- const PassInfo *getPassInfo() const { return &PIObj; }
-
- typedef Pass* (*NormalCtor_t)();
-
- RegisterPassBase(const char *Name, const char *Arg, intptr_t TI,
- NormalCtor_t NormalCtor = 0, bool CFGOnly = false)
- : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) {
- registerPass();
- }
- RegisterPassBase(intptr_t TI)
- : PIObj("", "", TI) {
- // This ctor may only be used for analysis groups: it does not auto-register
- // the pass.
- PIObj.SetIsAnalysisGroup();
- }
-
-protected:
- PassInfo PIObj; // The PassInfo object for this pass
- void registerPass();
- void unregisterPass();
-};
-
-template<typename PassName>
-Pass *callDefaultCtor() { return new PassName(); }
-
-template<typename PassName>
-struct RegisterPass : public RegisterPassBase {