Skip to content

Commit

Permalink
* Fixed spelling of `invertible'
Browse files Browse the repository at this point in the history
* Simplified if statement


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68163 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mbrukman committed Apr 1, 2009
1 parent 4122282 commit d485e88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions include/llvm/Support/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ struct basic_parser : public basic_parser_impl {
//
template<>
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;
public:
void getExtraOptionNames(std::vector<const char*> &OptionNames);
Expand All @@ -547,10 +547,7 @@ class parser<bool> : public basic_parser<bool> {

template <class Opt>
void initialize(Opt &O) {
if (O.getMiscFlags() & llvm::cl::AllowInverse)
IsInvertable = true;
else
IsInvertable = false;
IsInvertible = (O.getMiscFlags() & llvm::cl::AllowInverse);
ArgStr = O.ArgStr;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Support/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,13 +872,13 @@ bool parser<bool>::parse(Option &O, const char *ArgName,
return O.error(": '" + Arg +
"' 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;
return false;
}

void parser<bool>::getExtraOptionNames(std::vector<const char*> &OptionNames) {
if (!IsInvertable)
if (!IsInvertible)
return;

char *s = new char [strlen(ArgStr) + 3 + 1];
Expand Down

0 comments on commit d485e88

Please sign in to comment.