[llvm] r212973 - Support: Use a range-based for

Justin Bogner mail at justinbogner.com
Mon Jul 14 12:24:13 PDT 2014


Author: bogner
Date: Mon Jul 14 14:24:13 2014
New Revision: 212973

URL: http://llvm.org/viewvc/llvm-project?rev=212973&view=rev
Log:
Support: Use a range-based for

Modified:
    llvm/trunk/lib/Support/CommandLine.cpp

Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=212973&r1=212972&r2=212973&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Mon Jul 14 14:24:13 2014
@@ -1018,13 +1018,12 @@ void cl::ParseCommandLineOptions(int arg
   }
 
   // Loop over args and make sure all required args are specified!
-  for (StringMap<Option*>::iterator I = Opts.begin(),
-         E = Opts.end(); I != E; ++I) {
-    switch (I->second->getNumOccurrencesFlag()) {
+  for (const auto &Opt : Opts) {
+    switch (Opt.second->getNumOccurrencesFlag()) {
     case Required:
     case OneOrMore:
-      if (I->second->getNumOccurrences() == 0) {
-        I->second->error("must be specified at least once!");
+      if (Opt.second->getNumOccurrences() == 0) {
+        Opt.second->error("must be specified at least once!");
         ErrorParsing = true;
       }
       // Fall through





More information about the llvm-commits mailing list