Change UsedPhysRegs from array bool to BitVector to save some space. Setting / gettin...
[oota-llvm.git] / include / llvm / PassSupport.h
index e4144f7e4224fd493e88039ff50da40cc0231e81..7c3c4a9d660376d9d268b2492f29eaf83b39c939 100644 (file)
@@ -137,8 +137,10 @@ struct RegisterPassBase {
   ///
   const PassInfo *getPassInfo() const { return &PIObj; }
 
+  typedef Pass* (*NormalCtor_t)();
+  
   RegisterPassBase(const char *Name, const char *Arg, const std::type_info &TI,
-                   Pass *(*NormalCtor)() = 0, bool CFGOnly = false)
+                   NormalCtor_t NormalCtor = 0, bool CFGOnly = false)
     : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) {
     registerPass();
   }
@@ -164,7 +166,7 @@ struct RegisterPass : public RegisterPassBase {
   // Register Pass using default constructor...
   RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false)
   : RegisterPassBase(Name, PassArg, typeid(PassName),
-                     callDefaultCtor<PassName>, CFGOnly) {
+                     (RegisterPassBase::NormalCtor_t)callDefaultCtor<PassName>, CFGOnly) {
   }
 };
 
@@ -193,20 +195,20 @@ class RegisterAGBase : public RegisterPassBase {
   const PassInfo *ImplementationInfo;
   bool isDefaultImplementation;
 protected:
-  RegisterAGBase(const std::type_info &Interface,
-                 const std::type_info *Pass = 0,
-                 bool isDefault = false);
+  explicit RegisterAGBase(const std::type_info &Interface,
+                          const std::type_info *Pass = 0,
+                          bool isDefault = false);
   void setGroupName(const char *Name);
 };
 
 template<typename Interface, bool Default = false>
 struct RegisterAnalysisGroup : public RegisterAGBase {
-  RegisterAnalysisGroup(RegisterPassBase &RPB)
+  explicit RegisterAnalysisGroup(RegisterPassBase &RPB)
     : RegisterAGBase(typeid(Interface), &RPB.getPassInfo()->getTypeInfo(), 
                      Default) {
   }
 
-  RegisterAnalysisGroup(const char *Name)
+  explicit RegisterAnalysisGroup(const char *Name)
   : RegisterAGBase(typeid(Interface)) {
     setGroupName(Name);
   }