mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-23 20:15:35 +00:00
Fix a bug exposed by lli
llvm-svn: 3049
This commit is contained in:
parent
0d323f2cdf
commit
b0e9d1b80c
@ -348,8 +348,17 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
|
||||
unsigned ValNo = 0;
|
||||
for (unsigned j = 1, e = PositionalOpts.size(); j != e; ++j)
|
||||
if (RequiresValue(PositionalOpts[j]))
|
||||
ErrorParsing |=
|
||||
ProvidePositionalOption(PositionalOpts[j], PositionalVals[ValNo++]);
|
||||
ErrorParsing |= ProvidePositionalOption(PositionalOpts[j],
|
||||
PositionalVals[ValNo++]);
|
||||
|
||||
// Handle the case where there is just one positional option, and it's
|
||||
// optional. In this case, we want to give JUST THE FIRST option to the
|
||||
// positional option and keep the rest for the consume after. The above
|
||||
// loop would have assigned no values to positional options in this case.
|
||||
//
|
||||
if (PositionalOpts.size() == 2 && ValNo == 0)
|
||||
ErrorParsing |= ProvidePositionalOption(PositionalOpts[1],
|
||||
PositionalVals[ValNo++]);
|
||||
|
||||
// Handle over all of the rest of the arguments to the
|
||||
// cl::ConsumeAfter command line option...
|
||||
|
@ -348,8 +348,17 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
|
||||
unsigned ValNo = 0;
|
||||
for (unsigned j = 1, e = PositionalOpts.size(); j != e; ++j)
|
||||
if (RequiresValue(PositionalOpts[j]))
|
||||
ErrorParsing |=
|
||||
ProvidePositionalOption(PositionalOpts[j], PositionalVals[ValNo++]);
|
||||
ErrorParsing |= ProvidePositionalOption(PositionalOpts[j],
|
||||
PositionalVals[ValNo++]);
|
||||
|
||||
// Handle the case where there is just one positional option, and it's
|
||||
// optional. In this case, we want to give JUST THE FIRST option to the
|
||||
// positional option and keep the rest for the consume after. The above
|
||||
// loop would have assigned no values to positional options in this case.
|
||||
//
|
||||
if (PositionalOpts.size() == 2 && ValNo == 0)
|
||||
ErrorParsing |= ProvidePositionalOption(PositionalOpts[1],
|
||||
PositionalVals[ValNo++]);
|
||||
|
||||
// Handle over all of the rest of the arguments to the
|
||||
// cl::ConsumeAfter command line option...
|
||||
|
Loading…
Reference in New Issue
Block a user