diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-30 20:23:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-30 20:23:45 +0000 |
commit | 1c28b42310b183a141fa3b40d07a6cfbdb97ee02 (patch) | |
tree | 70919b785c0607c9b59df58b90fbcfefcaf17fb4 /lib/VMCore/Pass.cpp | |
parent | 14987f16b4c67ff13e753b1b930b319ca098ce30 (diff) | |
download | llvm-1c28b42310b183a141fa3b40d07a6cfbdb97ee02.tar.gz llvm-1c28b42310b183a141fa3b40d07a6cfbdb97ee02.tar.bz2 llvm-1c28b42310b183a141fa3b40d07a6cfbdb97ee02.tar.xz |
- PassManager prints analysis sets nicer
- Use Pass::AnalysisImpls instead of findAnalysisGroupMemeber
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Pass.cpp')
-rw-r--r-- | lib/VMCore/Pass.cpp | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 33bf11d8e7..b673484f21 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -255,8 +255,10 @@ void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg, Pass *P, const std::vector<AnalysisID> &Set){ if (PassDebugging >= Details && !Set.empty()) { std::cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:"; - for (unsigned i = 0; i != Set.size(); ++i) - std::cerr << " " << Set[i]->getPassName(); + for (unsigned i = 0; i != Set.size(); ++i) { + if (i) std::cerr << ","; + std::cerr << " " << Set[i]->getPassName(); + } std::cerr << "\n"; } } @@ -455,6 +457,11 @@ RegisterAGBase::RegisterAGBase(const std::type_info &Interface, assert(ImplementationInfo && "Must register pass before adding to AnalysisGroup!"); + // Make sure we keep track of the fact that the implementation implements + // the interface. + PassInfo *IIPI = const_cast<PassInfo*>(ImplementationInfo); + IIPI->addInterfaceImplemented(InterfaceInfo); + // Lazily allocate to avoid nasty initialization order dependencies if (AnalysisGroupInfoMap == 0) AnalysisGroupInfoMap = new std::map<const PassInfo *,AnalysisGroupInfo>(); @@ -508,34 +515,6 @@ RegisterAGBase::~RegisterAGBase() { } -// findAnalysisGroupMember - Return an iterator pointing to one of the elements -// of Map if there is a pass in Map that is a member of the analysis group for -// the specified AnalysisGroupID. -// -static std::map<const PassInfo*, Pass*>::const_iterator -findAnalysisGroupMember(const PassInfo *AnalysisGroupID, - const std::map<const PassInfo*, Pass*> &Map) { - assert(AnalysisGroupID->getPassType() == PassInfo::AnalysisGroup && - "AnalysisGroupID is not an analysis group!"); - assert(AnalysisGroupInfoMap && AnalysisGroupInfoMap->count(AnalysisGroupID) && - "Analysis Group does not have any registered members!"); - - // Get the set of all known implementations of this analysis group... - std::set<const PassInfo *> &Impls = - (*AnalysisGroupInfoMap)[AnalysisGroupID].Implementations; - - // Scan over available passes, checking to see if any is a valid analysis - for (std::map<const PassInfo*, Pass*>::const_iterator I = Map.begin(), - E = Map.end(); I != E; ++I) - if (Impls.count(I->first)) // This is a valid analysis, return it. - return I; - - return Map.end(); // Nothing of use found. -} - - - - //===----------------------------------------------------------------------===// // PassRegistrationListener implementation // |