diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:05 +0000 |
commit | 349cc55c9796c4596a5b9904cd3281af295f878f (patch) | |
tree | 410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/clang/lib/Serialization/ModuleManager.cpp | |
parent | cb2ae6163174b90e999326ecec3699ee093a5d43 (diff) | |
parent | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff) |
Diffstat (limited to 'contrib/llvm-project/clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/Serialization/ModuleManager.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/contrib/llvm-project/clang/lib/Serialization/ModuleManager.cpp b/contrib/llvm-project/clang/lib/Serialization/ModuleManager.cpp index 40ffa6cfee8f..f4882c7be3f7 100644 --- a/contrib/llvm-project/clang/lib/Serialization/ModuleManager.cpp +++ b/contrib/llvm-project/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); } } |