llvmc: make switch options ZeroOrMore by default.

llvm-svn: 121822
This commit is contained in:
Mikhail Glushenkov 2010-12-15 01:21:59 +00:00
parent 8c6b56f39d
commit 9f9b7051c7
1 changed files with 8 additions and 1 deletions

View File

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