Support: Use a range-based for

llvm-svn: 212973
This commit is contained in:
Justin Bogner
2014-07-14 19:24:13 +00:00
parent cd3acb5604
commit 973b2ff322

View 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