[llvm] r219095 - [cleanup] Switch to using range-based for loops in two very obvious
Chandler Carruth
chandlerc at gmail.com
Sun Oct 5 17:06:48 PDT 2014
Author: chandlerc
Date: Sun Oct 5 19:06:48 2014
New Revision: 219095
URL: http://llvm.org/viewvc/llvm-project?rev=219095&view=rev
Log:
[cleanup] Switch to using range-based for loops in two very obvious
places.
Modified:
llvm/trunk/lib/IR/PassRegistry.cpp
Modified: llvm/trunk/lib/IR/PassRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/PassRegistry.cpp?rev=219095&r1=219094&r2=219095&view=diff
==============================================================================
--- llvm/trunk/lib/IR/PassRegistry.cpp (original)
+++ llvm/trunk/lib/IR/PassRegistry.cpp Sun Oct 5 19:06:48 2014
@@ -63,10 +63,8 @@ void PassRegistry::registerPass(const Pa
PassInfoStringMap[PI.getPassArgument()] = Π
// Notify any listeners.
- for (std::vector<PassRegistrationListener *>::iterator I = Listeners.begin(),
- E = Listeners.end();
- I != E; ++I)
- (*I)->passRegistered(&PI);
+ for (auto *Listener : Listeners)
+ Listener->passRegistered(&PI);
if (ShouldFree)
ToFree.push_back(std::unique_ptr<const PassInfo>(&PI));
@@ -84,8 +82,8 @@ void PassRegistry::unregisterPass(const
void PassRegistry::enumerateWith(PassRegistrationListener *L) {
sys::SmartScopedReader<true> Guard(Lock);
- for (auto I = PassInfoMap.begin(), E = PassInfoMap.end(); I != E; ++I)
- L->passEnumerate(I->second);
+ for (auto PassInfoPair : PassInfoMap)
+ L->passEnumerate(PassInfoPair.second);
}
/// Analysis Group Mechanisms.
More information about the llvm-commits
mailing list