aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2022-01-05 13:39:19 +0100
committerJan Svoboda <jan_svoboda@apple.com>2022-01-05 14:40:47 +0100
commit32c2ea5c33a710cb1497bbd903039d8a9641e98a (patch)
tree42c405ca172e7efd825c2f17344d91dcbb9e7e7c /clang/lib/Lex/HeaderSearch.cpp
parentc7dd0bf41d8ee940893ae144cc0d813828c8233a (diff)
downloadllvm-32c2ea5c33a710cb1497bbd903039d8a9641e98a.zip
llvm-32c2ea5c33a710cb1497bbd903039d8a9641e98a.tar.gz
llvm-32c2ea5c33a710cb1497bbd903039d8a9641e98a.tar.bz2
[clang][lex] NFC: Simplify loop
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index a0b6011..5cb009d 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -29,6 +29,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Capacity.h"
#include "llvm/Support/Errc.h"
@@ -1779,11 +1780,8 @@ void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) {
}
// Populate the list of modules.
- for (ModuleMap::module_iterator M = ModMap.module_begin(),
- MEnd = ModMap.module_end();
- M != MEnd; ++M) {
- Modules.push_back(M->getValue());
- }
+ llvm::transform(ModMap.modules(), std::back_inserter(Modules),
+ [](const auto &NameAndMod) { return NameAndMod.second; });
}
void HeaderSearch::loadTopLevelSystemModules() {