[PATCH] D102021: [NFC] Correctly assert the indents for printEnumValHelpStr.

Joachim Meyer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 6 13:23:55 PDT 2021


fodinabor created this revision.
fodinabor added reviewers: chapuni, serge-sans-paille.
Herald added subscribers: dexonsmith, hiraditya.
fodinabor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Only verify that there's no negative indent.
Noted by @chapuni in https://reviews.llvm.org/D93494.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102021

Files:
  llvm/lib/Support/CommandLine.cpp


Index: llvm/lib/Support/CommandLine.cpp
===================================================================
--- llvm/lib/Support/CommandLine.cpp
+++ llvm/lib/Support/CommandLine.cpp
@@ -1739,7 +1739,7 @@
 void Option::printEnumValHelpStr(StringRef HelpStr, size_t BaseIndent,
                                  size_t FirstLineIndentedBy) {
   const StringRef ValHelpPrefix = "  ";
-  assert(BaseIndent >= FirstLineIndentedBy + ValHelpPrefix.size());
+  assert(BaseIndent >= FirstLineIndentedBy);
   std::pair<StringRef, StringRef> Split = HelpStr.split('\n');
   outs().indent(BaseIndent - FirstLineIndentedBy)
       << ArgHelpPrefix << ValHelpPrefix << Split.first << "\n";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102021.343492.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210506/6f953e75/attachment.bin>


More information about the llvm-commits mailing list