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

* Fixed spelling of `invertible'

* Simplified if statement

llvm-svn: 68163
This commit is contained in:
Misha Brukman 2009-04-01 00:15:46 +00:00
parent aaa9263fc6
commit ea884c9e5e
2 changed files with 4 additions and 7 deletions

View File

@ -537,7 +537,7 @@ struct basic_parser : public basic_parser_impl {
// //
template<> template<>
class parser<bool> : public basic_parser<bool> { class parser<bool> : public basic_parser<bool> {
bool IsInvertable; // Should we synthezise a -xno- style option? bool IsInvertible; // Should we synthesize a -xno- style option?
const char *ArgStr; const char *ArgStr;
public: public:
void getExtraOptionNames(std::vector<const char*> &OptionNames); void getExtraOptionNames(std::vector<const char*> &OptionNames);
@ -547,10 +547,7 @@ public:
template <class Opt> template <class Opt>
void initialize(Opt &O) { void initialize(Opt &O) {
if (O.getMiscFlags() & llvm::cl::AllowInverse) IsInvertible = (O.getMiscFlags() & llvm::cl::AllowInverse);
IsInvertable = true;
else
IsInvertable = false;
ArgStr = O.ArgStr; ArgStr = O.ArgStr;
} }

View File

@ -872,13 +872,13 @@ bool parser<bool>::parse(Option &O, const char *ArgName,
return O.error(": '" + Arg + return O.error(": '" + Arg +
"' is invalid value for boolean argument! Try 0 or 1"); "' is invalid value for boolean argument! Try 0 or 1");
} }
if (IsInvertable && strncmp(ArgName+1, "no-", 3) == 0) if (IsInvertible && strncmp(ArgName+1, "no-", 3) == 0)
Value = !Value; Value = !Value;
return false; return false;
} }
void parser<bool>::getExtraOptionNames(std::vector<const char*> &OptionNames) { void parser<bool>::getExtraOptionNames(std::vector<const char*> &OptionNames) {
if (!IsInvertable) if (!IsInvertible)
return; return;
char *s = new char [strlen(ArgStr) + 3 + 1]; char *s = new char [strlen(ArgStr) + 3 + 1];