aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorYi-Hong Lyu <yilyu@microsoft.com>2020-04-16 23:45:45 -0700
committerYi-Hong Lyu <yilyu@microsoft.com>2020-04-17 02:12:54 -0700
commit54cfc6944e2669d7a41a164fc4f3d923a71e701d (patch)
treee5d8710e9d8176c646683fcfab15218465629562 /llvm/lib/Support/CommandLine.cpp
parent91c10f50f38d4897146c3490d9881c7e39d0d2a5 (diff)
downloadllvm-54cfc6944e2669d7a41a164fc4f3d923a71e701d.zip
llvm-54cfc6944e2669d7a41a164fc4f3d923a71e701d.tar.gz
llvm-54cfc6944e2669d7a41a164fc4f3d923a71e701d.tar.bz2
[CommandLine] Fix cl::ConsumeAfter support with more than one positional argument
Summary: Currently, cl::ConsumeAfter only works for the case that has exactly one positional argument. Without the fix, it skip fulfilling first positional argument and put that additional positional argument in interpreter arguments. Reviewers: bkramer, Mordante, rnk, lattner, beanz, craig.topper Reviewed By: rnk Subscribers: JosephTremoulet, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77242
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r--llvm/lib/Support/CommandLine.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index f78c4bf..0025806 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1581,9 +1581,9 @@ bool CommandLineParser::ParseCommandLineOptions(int argc,
} else {
assert(ConsumeAfterOpt && NumPositionalRequired <= PositionalVals.size());
unsigned ValNo = 0;
- for (size_t j = 1, e = PositionalOpts.size(); j != e; ++j)
- if (RequiresValue(PositionalOpts[j])) {
- ErrorParsing |= ProvidePositionalOption(PositionalOpts[j],
+ for (size_t J = 0, E = PositionalOpts.size(); J != E; ++J)
+ if (RequiresValue(PositionalOpts[J])) {
+ ErrorParsing |= ProvidePositionalOption(PositionalOpts[J],
PositionalVals[ValNo].first,
PositionalVals[ValNo].second);
ValNo++;