From 212833ce766fb9b747672b249667e0161e52968c Mon Sep 17 00:00:00 2001 From: James Henderson Date: Fri, 1 Feb 2019 10:38:40 +0000 Subject: Revert r352750. This was causing a build bot failure: http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/15346/ llvm-svn: 352848 --- llvm/lib/Support/CommandLine.cpp | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'llvm/lib/Support/CommandLine.cpp') 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 << "="; - 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() << ""; - 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()) -- cgit v1.1