[llvm] r327312 - [NFC] Replace iterators in PrintHelp with range-based for
Jan Korous via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 12 11:31:07 PDT 2018
Author: jkorous
Date: Mon Mar 12 11:31:07 2018
New Revision: 327312
URL: http://llvm.org/viewvc/llvm-project?rev=327312&view=rev
Log:
[NFC] Replace iterators in PrintHelp with range-based for
Modified:
llvm/trunk/lib/Option/OptTable.cpp
Modified: llvm/trunk/lib/Option/OptTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Option/OptTable.cpp?rev=327312&r1=327311&r2=327312&view=diff
==============================================================================
--- llvm/trunk/lib/Option/OptTable.cpp (original)
+++ llvm/trunk/lib/Option/OptTable.cpp Mon Mar 12 11:31:07 2018
@@ -537,8 +537,7 @@ void OptTable::PrintHelp(raw_ostream &OS
// Render help text into a map of group-name to a list of (option, help)
// pairs.
- using helpmap_ty = std::map<std::string, std::vector<OptionInfo>>;
- helpmap_ty GroupedOptionHelp;
+ std::map<std::string, std::vector<OptionInfo>> GroupedOptionHelp;
for (unsigned Id = 1, e = getNumOptions() + 1; Id != e; ++Id) {
// FIXME: Split out option groups.
@@ -567,11 +566,10 @@ void OptTable::PrintHelp(raw_ostream &OS
}
}
- for (helpmap_ty::iterator it = GroupedOptionHelp .begin(),
- ie = GroupedOptionHelp.end(); it != ie; ++it) {
- if (it != GroupedOptionHelp .begin())
+ for (auto& OptionGroup : GroupedOptionHelp) {
+ if (OptionGroup.first != GroupedOptionHelp.begin()->first)
OS << "\n";
- PrintHelpOptionList(OS, it->first, it->second);
+ PrintHelpOptionList(OS, OptionGroup.first, OptionGroup.second);
}
OS.flush();
More information about the llvm-commits
mailing list