[PATCH] D93494: [Support] Indent multi-line descr of enum cli options.

NAKAMURA Takumi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 1 06:17:55 PDT 2021


chapuni added a comment.

It might causes assertion failure when a name in enum is long.
Reproducible with clang-scan-deps -help



================
Comment at: llvm/lib/Support/CommandLine.cpp:1731
+                                 size_t FirstLineIndentedBy) {
+  const StringRef ValHelpPrefix = "  ";
+  assert(BaseIndent >= FirstLineIndentedBy + ValHelpPrefix.size());
----------------
This is not reflected to MaxWidth.


================
Comment at: llvm/lib/Support/CommandLine.cpp:1948
       size_t NameSize = Name.empty() ? EmptyOption.size() : Name.size();
       Size = std::max(Size, NameSize + OptionPrefixesSize);
     }
----------------
Could we adjust it with ValHelpPrefix?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93494



More information about the llvm-commits mailing list