diff options
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r-- | clang/lib/Serialization/ModuleManager.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index 40ffa6cfee8f..f4882c7be3f7 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/lib/Serialization/ModuleManager.cpp @@ -270,8 +270,7 @@ void ModuleManager::removeModules(ModuleIterator First, ModuleMap *modMap) { I->Imports.remove_if(IsVictim); I->ImportedBy.remove_if(IsVictim); } - Roots.erase(std::remove_if(Roots.begin(), Roots.end(), IsVictim), - Roots.end()); + llvm::erase_if(Roots, IsVictim); // Remove the modules from the PCH chain. for (auto I = First; I != Last; ++I) { @@ -384,16 +383,14 @@ void ModuleManager::visit(llvm::function_ref<bool(ModuleFile &M)> Visitor, // For any module that this module depends on, push it on the // stack (if it hasn't already been marked as visited). - for (auto M = CurrentModule->Imports.rbegin(), - MEnd = CurrentModule->Imports.rend(); - M != MEnd; ++M) { + for (ModuleFile *M : llvm::reverse(CurrentModule->Imports)) { // Remove our current module as an impediment to visiting the // module we depend on. If we were the last unvisited module // that depends on this particular module, push it into the // queue to be visited. - unsigned &NumUnusedEdges = UnusedIncomingEdges[(*M)->Index]; + unsigned &NumUnusedEdges = UnusedIncomingEdges[M->Index]; if (NumUnusedEdges && (--NumUnusedEdges == 0)) - Queue.push_back(*M); + Queue.push_back(M); } } |