summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2016-10-12 10:04:35 +0000
committerAlex Lorenz <arphaman@gmail.com>2016-10-12 10:04:35 +0000
commitd68028789807429945c7852bbda4effa95bf7d21 (patch)
tree38aa599baea326d6912c611abd736b4eeeb23057 /llvm/lib/Support/CommandLine.cpp
parent1b9327f332035fb35ddaf5159ae1ae6913f25ca8 (diff)
downloadbcm5719-llvm-d68028789807429945c7852bbda4effa95bf7d21.tar.gz
bcm5719-llvm-d68028789807429945c7852bbda4effa95bf7d21.zip
[Support][CommandLine] Display subcommands in help when there are less than 3
subcommands This commit fixes a bug where the help output doesn't display subcommands when a tool has less than 3 subcommands. This change doesn't include a corresponding unittest as there is no viable way to provide a unittest for it. Differential Revision: https://reviews.llvm.org/D25463 llvm-svn: 283998
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index 756df942020..07114ddcb8f 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1780,7 +1780,7 @@ public:
if (ConsumeAfterOpt)
outs() << " " << ConsumeAfterOpt->HelpStr;
- if (Sub == &*TopLevelSubCommand && Subs.size() > 2) {
+ if (Sub == &*TopLevelSubCommand && !Subs.empty()) {
// Compute the maximum subcommand length...
size_t MaxSubLen = 0;
for (size_t i = 0, e = Subs.size(); i != e; ++i)
OpenPOWER on IntegriCloud