summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-02-04 14:48:33 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2019-02-04 14:48:33 +0000
commitd90b5a2e5119fe3a67633a9880ff712630d26061 (patch)
tree05a91311b6c3fc2172438a8b011956e2cb36db6d /llvm/tools
parenteef758e949cca34488d4e8392f97c19aa328cdf7 (diff)
downloadbcm5719-llvm-d90b5a2e5119fe3a67633a9880ff712630d26061.tar.gz
bcm5719-llvm-d90b5a2e5119fe3a67633a9880ff712630d26061.zip
[CommandLine] Don't print empty sentinel values from EnumValN lists in help text
In order to make an option value truly optional, both the ValueOptional attribute and an empty-named value are required. Prior to this change, this empty-named value appears in the command-line help text: -some-option - some help text =v1 - description 1 =v2 - description 2 = - This change improves the help text for these sort of options in a number of ways: 1) ValueOptional options with an empty-named value now print their help text twice: both without and then with '=<value>' after the name. The latter version then lists the allowed values after it. 2) Empty-named values with no help text in ValueOptional options are not listed in the permitted values. -some-option - some help text -some-option=<value> - some help text =v1 - description 1 =v2 - description 2 3) Otherwise empty-named options are printed as =<empty> rather than simply '='. 4) Option values without help text do not have the '-' separator printed. -some-option=<value> - some help text =v1 - description 1 =v2 =<empty> - description It also tweaks the llvm-symbolizer -functions help text to not print a trailing ':' as that looks bad combined with 1) above. This is mostly a reland of r352750. Reviewed by: ruiu, thopre, mstorsjo Differential Revision: https://reviews.llvm.org/D57030 llvm-svn: 353048
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
index 15b2b9dddd4..0b0b8a68a4a 100644
--- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -38,7 +38,7 @@ ClUseSymbolTable("use-symbol-table", cl::init(true),
static cl::opt<FunctionNameKind> ClPrintFunctions(
"functions", cl::init(FunctionNameKind::LinkageName),
- cl::desc("Print function name for a given address:"), cl::ValueOptional,
+ cl::desc("Print function name for a given address"), cl::ValueOptional,
cl::values(clEnumValN(FunctionNameKind::None, "none", "omit function name"),
clEnumValN(FunctionNameKind::ShortName, "short",
"print short function name"),
OpenPOWER on IntegriCloud