mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Sort list of targets in --version.
llvm-svn: 77127
This commit is contained in:
parent
a7a01acc7c
commit
fe859a94dc
@ -1144,19 +1144,22 @@ public:
|
||||
cout << "\n";
|
||||
cout << " Registered Targets:\n";
|
||||
|
||||
std::vector<std::pair<std::string, const Target*> > Targets;
|
||||
size_t Width = 0;
|
||||
for (TargetRegistry::iterator it = TargetRegistry::begin(),
|
||||
ie = TargetRegistry::end(); it != ie; ++it)
|
||||
ie = TargetRegistry::end(); it != ie; ++it) {
|
||||
Targets.push_back(std::make_pair(it->getName(), &*it));
|
||||
Width = std::max(Width, ::strlen(it->getName()));
|
||||
|
||||
unsigned NumTargets = 0;
|
||||
for (TargetRegistry::iterator it = TargetRegistry::begin(),
|
||||
ie = TargetRegistry::end(); it != ie; ++it, ++NumTargets) {
|
||||
cout << " " << it->getName()
|
||||
<< std::string(Width - ::strlen(it->getName()), ' ') << " - "
|
||||
<< it->getShortDescription() << "\n";
|
||||
}
|
||||
if (!NumTargets)
|
||||
std::sort(Targets.begin(), Targets.end());
|
||||
|
||||
for (unsigned i = 0, e = Targets.size(); i != e; ++i) {
|
||||
const Target *T = Targets[i].second;
|
||||
cout << " " << T->getName()
|
||||
<< std::string(Width - ::strlen(T->getName()), ' ') << " - "
|
||||
<< T->getShortDescription() << "\n";
|
||||
}
|
||||
if (Targets.empty())
|
||||
cout << " (none)\n";
|
||||
}
|
||||
void operator=(bool OptionWasSpecified) {
|
||||
|
Loading…
Reference in New Issue
Block a user