1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Lowercase versions of `occurrence' need to be spelled correctly, too.

llvm-svn: 7142
This commit is contained in:
Misha Brukman 2003-07-10 17:05:26 +00:00
parent cbaa8f3bfe
commit c12238543a
3 changed files with 36 additions and 36 deletions

View File

@ -34,11 +34,11 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
// Flags permitted to be passed to command line arguments // Flags permitted to be passed to command line arguments
// //
enum NumOccurrences { // Flags for the number of occurances allowed... enum NumOccurrences { // Flags for the number of occurrences allowed
Optional = 0x01, // Zero or One occurance Optional = 0x01, // Zero or One occurrence
ZeroOrMore = 0x02, // Zero or more occurances allowed ZeroOrMore = 0x02, // Zero or more occurrences allowed
Required = 0x03, // One occurance required Required = 0x03, // One occurrence required
OneOrMore = 0x04, // One or more occurances required OneOrMore = 0x04, // One or more occurrences required
// ConsumeAfter - Indicates that this option is fed anything that follows the // ConsumeAfter - Indicates that this option is fed anything that follows the
// last positional argument required by the application (it is an error if // last positional argument required by the application (it is an error if
@ -182,7 +182,7 @@ protected:
public: public:
// addArgument - Tell the system that this Option subclass will handle all // addArgument - Tell the system that this Option subclass will handle all
// occurances of -ArgStr on the command line. // occurrences of -ArgStr on the command line.
// //
void addArgument(const char *ArgStr); void addArgument(const char *ArgStr);
void removeArgument(const char *ArgStr); void removeArgument(const char *ArgStr);

View File

@ -247,18 +247,18 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
const char *ArgNameEnd = ArgName; const char *ArgNameEnd = ArgName;
while (*ArgNameEnd && *ArgNameEnd != '=') while (*ArgNameEnd && *ArgNameEnd != '=')
++ArgNameEnd; // Scan till end of argument name... ++ArgNameEnd; // Scan till end of argument name...
Value = ArgNameEnd; Value = ArgNameEnd;
if (*Value) // If we have an equals sign... if (*Value) // If we have an equals sign...
++Value; // Advance to value... ++Value; // Advance to value...
if (*ArgName != 0) { if (*ArgName != 0) {
std::string RealName(ArgName, ArgNameEnd); std::string RealName(ArgName, ArgNameEnd);
// Extract arg name part // Extract arg name part
std::map<std::string, Option*>::iterator I = Opts.find(RealName); std::map<std::string, Option*>::iterator I = Opts.find(RealName);
if (I == Opts.end() && !*Value && RealName.size() > 1) { if (I == Opts.end() && !*Value && RealName.size() > 1) {
// Check to see if this "option" is really a prefixed or grouped // Check to see if this "option" is really a prefixed or grouped
// argument... // argument...
// //
@ -283,13 +283,13 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
std::string RealArgName(RealName.begin(),RealName.begin()+Length); std::string RealArgName(RealName.begin(),RealName.begin()+Length);
RealName.erase(RealName.begin(), RealName.begin()+Length); RealName.erase(RealName.begin(), RealName.begin()+Length);
// Because ValueRequired is an invalid flag for grouped arguments, // Because ValueRequired is an invalid flag for grouped arguments,
// we don't need to pass argc/argv in... // we don't need to pass argc/argv in...
// //
assert(PGOpt->getValueExpectedFlag() != cl::ValueRequired && assert(PGOpt->getValueExpectedFlag() != cl::ValueRequired &&
"Option can not be cl::Grouping AND cl::ValueRequired!"); "Option can not be cl::Grouping AND cl::ValueRequired!");
int Dummy; int Dummy;
ErrorParsing |= ProvideOption(PGOpt, RealArgName.c_str(), "", ErrorParsing |= ProvideOption(PGOpt, RealArgName.c_str(), "",
0, 0, Dummy); 0, 0, Dummy);
// Get the next grouping option... // Get the next grouping option...
@ -305,7 +305,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
// //
I = Opts.end(); I = Opts.end();
} }
} }
Handler = I != Opts.end() ? I->second : 0; Handler = I != Opts.end() ? I->second : 0;
} }
@ -404,12 +404,12 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
// Loop over args and make sure all required args are specified! // Loop over args and make sure all required args are specified!
for (std::map<std::string, Option*>::iterator I = Opts.begin(), for (std::map<std::string, Option*>::iterator I = Opts.begin(),
E = Opts.end(); I != E; ++I) { E = Opts.end(); I != E; ++I) {
switch (I->second->getNumOccurrencesFlag()) { switch (I->second->getNumOccurrencesFlag()) {
case Required: case Required:
case OneOrMore: case OneOrMore:
if (I->second->getNumOccurrences() == 0) { if (I->second->getNumOccurrences() == 0) {
I->second->error(" must be specified at least once!"); I->second->error(" must be specified at least once!");
ErrorParsing = true; ErrorParsing = true;
} }
// Fall through // Fall through
@ -457,14 +457,14 @@ bool Option::addOccurrence(const char *ArgName, const std::string &Value) {
case OneOrMore: case OneOrMore:
case ZeroOrMore: case ZeroOrMore:
case ConsumeAfter: break; case ConsumeAfter: break;
default: return error(": bad num occurances flag value!"); default: return error(": bad num occurrences flag value!");
} }
return handleOccurrence(ArgName, Value); return handleOccurrence(ArgName, Value);
} }
// addArgument - Tell the system that this Option subclass will handle all // addArgument - Tell the system that this Option subclass will handle all
// occurances of -ArgStr on the command line. // occurrences of -ArgStr on the command line.
// //
void Option::addArgument(const char *ArgStr) { void Option::addArgument(const char *ArgStr) {
if (ArgStr[0]) if (ArgStr[0])
@ -715,7 +715,7 @@ public:
// Eliminate Hidden or ReallyHidden arguments, depending on ShowHidden // Eliminate Hidden or ReallyHidden arguments, depending on ShowHidden
Options.erase(std::remove_if(Options.begin(), Options.end(), Options.erase(std::remove_if(Options.begin(), Options.end(),
std::ptr_fun(ShowHidden ? isReallyHidden : isHidden)), std::ptr_fun(ShowHidden ? isReallyHidden : isHidden)),
Options.end()); Options.end());
// Eliminate duplicate entries in table (from enum flags options, f.e.) // Eliminate duplicate entries in table (from enum flags options, f.e.)
{ // Give OptionSet a scope { // Give OptionSet a scope

View File

@ -247,18 +247,18 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
const char *ArgNameEnd = ArgName; const char *ArgNameEnd = ArgName;
while (*ArgNameEnd && *ArgNameEnd != '=') while (*ArgNameEnd && *ArgNameEnd != '=')
++ArgNameEnd; // Scan till end of argument name... ++ArgNameEnd; // Scan till end of argument name...
Value = ArgNameEnd; Value = ArgNameEnd;
if (*Value) // If we have an equals sign... if (*Value) // If we have an equals sign...
++Value; // Advance to value... ++Value; // Advance to value...
if (*ArgName != 0) { if (*ArgName != 0) {
std::string RealName(ArgName, ArgNameEnd); std::string RealName(ArgName, ArgNameEnd);
// Extract arg name part // Extract arg name part
std::map<std::string, Option*>::iterator I = Opts.find(RealName); std::map<std::string, Option*>::iterator I = Opts.find(RealName);
if (I == Opts.end() && !*Value && RealName.size() > 1) { if (I == Opts.end() && !*Value && RealName.size() > 1) {
// Check to see if this "option" is really a prefixed or grouped // Check to see if this "option" is really a prefixed or grouped
// argument... // argument...
// //
@ -283,13 +283,13 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
std::string RealArgName(RealName.begin(),RealName.begin()+Length); std::string RealArgName(RealName.begin(),RealName.begin()+Length);
RealName.erase(RealName.begin(), RealName.begin()+Length); RealName.erase(RealName.begin(), RealName.begin()+Length);
// Because ValueRequired is an invalid flag for grouped arguments, // Because ValueRequired is an invalid flag for grouped arguments,
// we don't need to pass argc/argv in... // we don't need to pass argc/argv in...
// //
assert(PGOpt->getValueExpectedFlag() != cl::ValueRequired && assert(PGOpt->getValueExpectedFlag() != cl::ValueRequired &&
"Option can not be cl::Grouping AND cl::ValueRequired!"); "Option can not be cl::Grouping AND cl::ValueRequired!");
int Dummy; int Dummy;
ErrorParsing |= ProvideOption(PGOpt, RealArgName.c_str(), "", ErrorParsing |= ProvideOption(PGOpt, RealArgName.c_str(), "",
0, 0, Dummy); 0, 0, Dummy);
// Get the next grouping option... // Get the next grouping option...
@ -305,7 +305,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
// //
I = Opts.end(); I = Opts.end();
} }
} }
Handler = I != Opts.end() ? I->second : 0; Handler = I != Opts.end() ? I->second : 0;
} }
@ -404,12 +404,12 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
// Loop over args and make sure all required args are specified! // Loop over args and make sure all required args are specified!
for (std::map<std::string, Option*>::iterator I = Opts.begin(), for (std::map<std::string, Option*>::iterator I = Opts.begin(),
E = Opts.end(); I != E; ++I) { E = Opts.end(); I != E; ++I) {
switch (I->second->getNumOccurrencesFlag()) { switch (I->second->getNumOccurrencesFlag()) {
case Required: case Required:
case OneOrMore: case OneOrMore:
if (I->second->getNumOccurrences() == 0) { if (I->second->getNumOccurrences() == 0) {
I->second->error(" must be specified at least once!"); I->second->error(" must be specified at least once!");
ErrorParsing = true; ErrorParsing = true;
} }
// Fall through // Fall through
@ -457,14 +457,14 @@ bool Option::addOccurrence(const char *ArgName, const std::string &Value) {
case OneOrMore: case OneOrMore:
case ZeroOrMore: case ZeroOrMore:
case ConsumeAfter: break; case ConsumeAfter: break;
default: return error(": bad num occurances flag value!"); default: return error(": bad num occurrences flag value!");
} }
return handleOccurrence(ArgName, Value); return handleOccurrence(ArgName, Value);
} }
// addArgument - Tell the system that this Option subclass will handle all // addArgument - Tell the system that this Option subclass will handle all
// occurances of -ArgStr on the command line. // occurrences of -ArgStr on the command line.
// //
void Option::addArgument(const char *ArgStr) { void Option::addArgument(const char *ArgStr) {
if (ArgStr[0]) if (ArgStr[0])
@ -715,7 +715,7 @@ public:
// Eliminate Hidden or ReallyHidden arguments, depending on ShowHidden // Eliminate Hidden or ReallyHidden arguments, depending on ShowHidden
Options.erase(std::remove_if(Options.begin(), Options.end(), Options.erase(std::remove_if(Options.begin(), Options.end(),
std::ptr_fun(ShowHidden ? isReallyHidden : isHidden)), std::ptr_fun(ShowHidden ? isReallyHidden : isHidden)),
Options.end()); Options.end());
// Eliminate duplicate entries in table (from enum flags options, f.e.) // Eliminate duplicate entries in table (from enum flags options, f.e.)
{ // Give OptionSet a scope { // Give OptionSet a scope