llvmc: make switch options ZeroOrMore by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121822 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2010-12-15 01:21:59 +00:00
parent bc4224bc6b
commit 87685e8e8f

View File

@ -768,14 +768,21 @@ public:
CheckNumberOfArguments(d, 2);
// Alias option store the aliased option name in the 'Help' field and do not
// have any properties.
if (OD.isAlias()) {
// Aliases store the aliased option name in the 'Help' field.
OD.Help = InitPtrToString(d.getArg(1));
}
else {
processOptionProperties(d, OD);
}
// Switch options are ZeroOrMore by default.
if (OD.isSwitch()) {
if (!(OD.isOptional() || OD.isOneOrMore() || OD.isRequired()))
OD.setZeroOrMore();
}
OptDescs_.InsertDescription(OD);
}