mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
switch an std::string to StringRef, shaving 400 bytes off CommandLine.o
llvm-svn: 82370
This commit is contained in:
parent
b96f9df101
commit
b7eb454f66
@ -1145,33 +1145,32 @@ public:
|
|||||||
<< "\n"
|
<< "\n"
|
||||||
<< " Registered Targets:\n";
|
<< " Registered Targets:\n";
|
||||||
|
|
||||||
std::vector<std::pair<std::string, const Target*> > Targets;
|
std::vector<std::pair<StringRef, const Target*> > Targets;
|
||||||
size_t Width = 0;
|
size_t Width = 0;
|
||||||
for (TargetRegistry::iterator it = TargetRegistry::begin(),
|
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));
|
Targets.push_back(std::make_pair(it->getName(), &*it));
|
||||||
Width = std::max(Width, Targets.back().first.length());
|
Width = std::max(Width, Targets.back().first.size());
|
||||||
}
|
}
|
||||||
array_pod_sort(Targets.begin(), Targets.end());
|
array_pod_sort(Targets.begin(), Targets.end());
|
||||||
|
|
||||||
for (unsigned i = 0, e = Targets.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Targets.size(); i != e; ++i) {
|
||||||
outs() << " " << Targets[i].first;
|
outs() << " " << Targets[i].first;
|
||||||
outs().indent(Width - Targets[i].first.length()) << " - "
|
outs().indent(Width - Targets[i].first.size()) << " - "
|
||||||
<< Targets[i].second->getShortDescription() << '\n';
|
<< Targets[i].second->getShortDescription() << '\n';
|
||||||
}
|
}
|
||||||
if (Targets.empty())
|
if (Targets.empty())
|
||||||
outs() << " (none)\n";
|
outs() << " (none)\n";
|
||||||
}
|
}
|
||||||
void operator=(bool OptionWasSpecified) {
|
void operator=(bool OptionWasSpecified) {
|
||||||
if (OptionWasSpecified) {
|
if (!OptionWasSpecified) return;
|
||||||
if (OverrideVersionPrinter == 0) {
|
|
||||||
print();
|
if (OverrideVersionPrinter == 0) {
|
||||||
exit(1);
|
print();
|
||||||
} else {
|
exit(1);
|
||||||
(*OverrideVersionPrinter)();
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
(*OverrideVersionPrinter)();
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // End anonymous namespace
|
} // End anonymous namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user