diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h index fe3ca520659..b5e581a6f4e 100644 --- a/include/llvm/PassSupport.h +++ b/include/llvm/PassSupport.h @@ -190,14 +190,11 @@ struct RegisterPass : public PassInfo { /// a nice name with the interface. /// class RegisterAGBase : public PassInfo { - PassInfo *InterfaceInfo; - const PassInfo *ImplementationInfo; - bool isDefaultImplementation; protected: - explicit RegisterAGBase(const char *Name, - intptr_t InterfaceID, - intptr_t PassID = 0, - bool isDefault = false); + RegisterAGBase(const char *Name, + intptr_t InterfaceID, + intptr_t PassID = 0, + bool isDefault = false); }; template diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index e2a8d744e39..1278074ef53 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -132,9 +132,7 @@ class PassRegistrar { /// AnalysisGroupInfo - Keep track of information for each analysis group. struct AnalysisGroupInfo { - const PassInfo *DefaultImpl; std::set Implementations; - AnalysisGroupInfo() : DefaultImpl(0) {} }; /// AnalysisGroupInfoMap - Information for each analysis group. @@ -177,11 +175,10 @@ public: "Cannot add a pass to the same analysis group more than once!"); AGI.Implementations.insert(ImplementationInfo); if (isDefault) { - assert(AGI.DefaultImpl == 0 && InterfaceInfo->getNormalCtor() == 0 && + assert(InterfaceInfo->getNormalCtor() == 0 && "Default implementation for analysis group already specified!"); assert(ImplementationInfo->getNormalCtor() && "Cannot specify pass as default if it does not have a default ctor"); - AGI.DefaultImpl = ImplementationInfo; InterfaceInfo->setNormalCtor(ImplementationInfo->getNormalCtor()); } } @@ -253,10 +250,10 @@ void PassInfo::unregisterPass() { // RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID, intptr_t PassID, bool isDefault) - : PassInfo(Name, InterfaceID), - ImplementationInfo(0), isDefaultImplementation(isDefault) { + : PassInfo(Name, InterfaceID) { - InterfaceInfo = const_cast(Pass::lookupPassInfo(InterfaceID)); + PassInfo *InterfaceInfo = + const_cast(Pass::lookupPassInfo(InterfaceID)); if (InterfaceInfo == 0) { // First reference to Interface, register it now. registerPass(); @@ -266,7 +263,7 @@ RegisterAGBase::RegisterAGBase(const char *Name, intptr_t InterfaceID, "Trying to join an analysis group that is a normal pass!"); if (PassID) { - ImplementationInfo = Pass::lookupPassInfo(PassID); + const PassInfo *ImplementationInfo = Pass::lookupPassInfo(PassID); assert(ImplementationInfo && "Must register pass before adding to AnalysisGroup!");