[llvm-branch-commits] [llvm] f3e07c8 - [NFC] Correctly assert the indents for printEnumValHelpStr.
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon May 10 14:24:35 PDT 2021
Author: Joachim Meyer
Date: 2021-05-10T14:24:18-07:00
New Revision: f3e07c841e2f96a73b253d3b1a95e2ac8df5a376
URL: https://github.com/llvm/llvm-project/commit/f3e07c841e2f96a73b253d3b1a95e2ac8df5a376
DIFF: https://github.com/llvm/llvm-project/commit/f3e07c841e2f96a73b253d3b1a95e2ac8df5a376.diff
LOG: [NFC] Correctly assert the indents for printEnumValHelpStr.
Only verify that there's no negative indent.
Noted by @chapuni in https://reviews.llvm.org/D93494.
Reviewed By: chapuni
Differential Revision: https://reviews.llvm.org/D102021
(cherry picked from commit d9f2960c932c9803e662098e33d899efa3c67f44)
Added:
Modified:
llvm/lib/Support/CommandLine.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index e2f014d1815b7..123a23a5242c2 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1729,7 +1729,7 @@ void Option::printHelpStr(StringRef HelpStr, size_t Indent,
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";
More information about the llvm-branch-commits
mailing list