aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-02-01 10:38:40 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2019-02-01 10:38:40 +0000
commit212833ce766fb9b747672b249667e0161e52968c (patch)
treed019b14ae2b2af734a9989bf70726caf992d48ac /llvm/lib/Support/CommandLine.cpp
parent563a29d449def26b9e3bdf9fb1bf59d03b461a62 (diff)
downloadllvm-212833ce766fb9b747672b249667e0161e52968c.zip
llvm-212833ce766fb9b747672b249667e0161e52968c.tar.gz
llvm-212833ce766fb9b747672b249667e0161e52968c.tar.bz2
Revert r352750.
This was causing a build bot failure: http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/15346/ llvm-svn: 352848
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp32
1 files changed, 5 insertions, 27 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 886595e..f8bc6a8 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1663,35 +1663,13 @@ size_t generic_parser_base::getOptionWidth(const Option &O) const {
void generic_parser_base::printOptionInfo(const Option &O,
size_t GlobalWidth) const {
if (O.hasArgStr()) {
- // When the value is optional, first print a line just describing the option
- // without values.
- if (O.getValueExpectedFlag() == ValueOptional) {
- for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
- if (getOption(i).empty()) {
- outs() << " -" << O.ArgStr;
- Option::printHelpStr(O.HelpStr, GlobalWidth, O.ArgStr.size() + 6);
- break;
- }
- }
- }
+ outs() << " -" << O.ArgStr;
+ Option::printHelpStr(O.HelpStr, GlobalWidth, O.ArgStr.size() + 6);
- outs() << " -" << O.ArgStr << "=<value>";
- Option::printHelpStr(O.HelpStr, GlobalWidth, O.ArgStr.size() + 14);
for (unsigned i = 0, e = getNumOptions(); i != e; ++i) {
- StringRef ValueName = getOption(i);
- StringRef Description = getDescription(i);
- if (O.getValueExpectedFlag() == ValueOptional && ValueName.empty() &&
- Description.empty())
- continue;
- size_t NumSpaces = GlobalWidth - ValueName.size() - 8;
- outs() << " =" << ValueName;
- if (ValueName.empty()) {
- outs() << "<empty>";
- NumSpaces -= 7;
- }
- if (!Description.empty())
- outs().indent(NumSpaces) << " - " << Description;
- outs() << '\n';
+ size_t NumSpaces = GlobalWidth - getOption(i).size() - 8;
+ outs() << " =" << getOption(i);
+ outs().indent(NumSpaces) << " - " << getDescription(i) << '\n';
}
} else {
if (!O.HelpStr.empty())