r262969 - [Modules] Modernize, use range-based loops.

Davide Italiano via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 8 15:58:08 PST 2016


Author: davide
Date: Tue Mar  8 17:58:08 2016
New Revision: 262969

URL: http://llvm.org/viewvc/llvm-project?rev=262969&view=rev
Log:
[Modules] Modernize, use range-based loops.

Modified:
    cfe/trunk/lib/Lex/ModuleMap.cpp

Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=262969&r1=262968&r2=262969&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Tue Mar  8 17:58:08 2016
@@ -94,11 +94,8 @@ ModuleMap::ModuleMap(SourceManager &Sour
 }
 
 ModuleMap::~ModuleMap() {
-  for (llvm::StringMap<Module *>::iterator I = Modules.begin(), 
-                                        IEnd = Modules.end();
-       I != IEnd; ++I) {
-    delete I->getValue();
-  }
+  for (auto &M : Modules)
+    delete M.getValue();
 }
 
 void ModuleMap::setTarget(const TargetInfo &Target) {




More information about the cfe-commits mailing list