[PATCH] D57030: [CommandLine] Don't print empty sentinel values from EnumValN lists in help text

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 4 01:47:05 PST 2019


thopre added inline comments.


================
Comment at: lib/Support/CommandLine.cpp:1662-1663
+      StringRef ValueName = getOption(i);
+      if (O.getValueExpectedFlag() == ValueOptional && ValueName.empty() &&
+          getDescription(i).empty())
+        continue;
----------------
I wonder if a small inline function for this would make sense. BTW, do you know why the width is not computed from the return value of getOptionInfo?


================
Comment at: unittests/Support/CommandLineTest.cpp:1023
+  // The length of a=<value> (including indentation) is actually the same as the
+  // =<empty> string, so it is impossible to distinguish via the two via
+  // testing.
----------------
Remove the first occurrence of "via". Any reason why the text here is different from the other two below?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57030/new/

https://reviews.llvm.org/D57030





More information about the llvm-commits mailing list