From 973b2ff322ca2a04540aa035dc80ae71e6c25d7e Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Mon, 14 Jul 2014 19:24:13 +0000 Subject: Support: Use a range-based for llvm-svn: 212973 --- llvm/lib/Support/CommandLine.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/Support') diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 87348f7342e..586eceae757 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -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::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 -- cgit v1.2.3