diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp index 8fd35ef975e..544c56a789a 100644 --- a/lib/IR/LegacyPassManager.cpp +++ b/lib/IR/LegacyPassManager.cpp @@ -685,16 +685,12 @@ PMTopLevelManager::setLastUser(ArrayRef AnalysisPasses, Pass *P) { /// Collect passes whose last user is P void PMTopLevelManager::collectLastUses(SmallVectorImpl &LastUses, Pass *P) { - DenseMap >::iterator DMI = - InversedLastUser.find(P); + auto DMI = InversedLastUser.find(P); if (DMI == InversedLastUser.end()) return; - SmallPtrSet &LU = DMI->second; - for (Pass *LUP : LU) { - LastUses.push_back(LUP); - } - + auto &LU = DMI->second; + LastUses.append(LU.begin(), LU.end()); } AnalysisUsage *PMTopLevelManager::findAnalysisUsage(Pass *P) {