diff options
author | Owen Anderson <resistor@mac.com> | 2010-07-20 16:55:05 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-07-20 16:55:05 +0000 |
commit | 3183ef11207bcea6606c63d4ba1fb25f2125353f (patch) | |
tree | 8c239303acfa60a6fd75950f2f71fa326fcfcd8c /llvm/lib/VMCore/PassManager.cpp | |
parent | 46f00a25f91b2a5f744192ad8be3459bcbfbcfbb (diff) | |
download | bcm5719-llvm-3183ef11207bcea6606c63d4ba1fb25f2125353f.tar.gz bcm5719-llvm-3183ef11207bcea6606c63d4ba1fb25f2125353f.zip |
Pull out r108755. After offline discussion with Chris, we're going to go a different direction with this.
llvm-svn: 108856
Diffstat (limited to 'llvm/lib/VMCore/PassManager.cpp')
-rw-r--r-- | llvm/lib/VMCore/PassManager.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/llvm/lib/VMCore/PassManager.cpp b/llvm/lib/VMCore/PassManager.cpp index 4cf5501379c..296b0d13a71 100644 --- a/llvm/lib/VMCore/PassManager.cpp +++ b/llvm/lib/VMCore/PassManager.cpp @@ -638,14 +638,10 @@ Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) { // If Pass not found then check the interfaces implemented by Immutable Pass if (!P) { - const PassInfo::InterfaceInfo *ImmPI = PI->getInterfacesImplemented(); - while (ImmPI) { - if (ImmPI->interface == AID) { - P = *I; - break; - } else - ImmPI = ImmPI->next; - } + const std::vector<const PassInfo*> &ImmPI = + PI->getInterfacesImplemented(); + if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end()) + P = *I; } } @@ -735,11 +731,9 @@ void PMDataManager::recordAvailableAnalysis(Pass *P) { //This pass is the current implementation of all of the interfaces it //implements as well. - const PassInfo::InterfaceInfo *II = PI->getInterfacesImplemented(); - while (II) { - AvailableAnalysis[II->interface] = P; - II = II->next; - } + const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented(); + for (unsigned i = 0, e = II.size(); i != e; ++i) + AvailableAnalysis[II[i]] = P; } // Return true if P preserves high level analysis used by other @@ -873,13 +867,12 @@ void PMDataManager::freePass(Pass *P, StringRef Msg, // Remove all interfaces this pass implements, for which it is also // listed as the available implementation. - const PassInfo::InterfaceInfo *II = PI->getInterfacesImplemented(); - while (II) { + const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented(); + for (unsigned i = 0, e = II.size(); i != e; ++i) { std::map<AnalysisID, Pass*>::iterator Pos = - AvailableAnalysis.find(II->interface); + AvailableAnalysis.find(II[i]); if (Pos != AvailableAnalysis.end() && Pos->second == P) AvailableAnalysis.erase(Pos); - II = II->next; } } } |