diff options
author | Kazu Hirata <kazu@google.com> | 2021-11-17 19:40:48 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-11-17 19:40:48 -0800 |
commit | 74115602e82d0e758f8e311d545e127ce0a48cd7 (patch) | |
tree | d61294d583b6b3a660b09a76e5033812b372ca0f /clang/lib/Serialization/ModuleManager.cpp | |
parent | 972219195eff52437e578d89accabc563de0be3f (diff) | |
download | llvm-74115602e82d0e758f8e311d545e127ce0a48cd7.zip llvm-74115602e82d0e758f8e311d545e127ce0a48cd7.tar.gz llvm-74115602e82d0e758f8e311d545e127ce0a48cd7.tar.bz2 |
[clang] Use range-based for loops with llvm::reverse (NFC)
Diffstat (limited to 'clang/lib/Serialization/ModuleManager.cpp')
-rw-r--r-- | clang/lib/Serialization/ModuleManager.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index 2fe88cc..f4882c7 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/lib/Serialization/ModuleManager.cpp @@ -383,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); } } |