Support: Use a range-based for
authorJustin Bogner <mail@justinbogner.com>
Mon, 14 Jul 2014 19:24:13 +0000 (19:24 +0000)
committerJustin Bogner <mail@justinbogner.com>
Mon, 14 Jul 2014 19:24:13 +0000 (19:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212973 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/CommandLine.cpp

index 87348f7342e528580467ac0063d990368cbb6573..586eceae757fcba6fed16627248b2bc4f92af857 100644 (file)
@@ -1018,13 +1018,12 @@ void cl::ParseCommandLineOptions(int argc, const char * const *argv,
   }
 
   // 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