OSDN Git Service

* Fixed spelling of `invertible'
authorMisha Brukman <brukman+llvm@gmail.com>
Wed, 1 Apr 2009 00:15:46 +0000 (00:15 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Wed, 1 Apr 2009 00:15:46 +0000 (00:15 +0000)
* Simplified if statement

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68163 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/CommandLine.h
lib/Support/CommandLine.cpp

index 4a7c8c8..e45ab21 100644 (file)
@@ -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);
@@ -547,10 +547,7 @@ public:
 
   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;
   }
 
index f3f198b..710b210 100644 (file)
@@ -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];