[llvm-commits] [llvm] r68163 - in /llvm/trunk: include/llvm/Support/CommandLine.h lib/Support/CommandLine.cpp

Misha Brukman brukman+llvm at gmail.com
Tue Mar 31 17:15:46 PDT 2009


Author: brukman
Date: Tue Mar 31 19:15:46 2009
New Revision: 68163

URL: http://llvm.org/viewvc/llvm-project?rev=68163&view=rev
Log:
* Fixed spelling of `invertible'
* Simplified if statement

Modified:
    llvm/trunk/include/llvm/Support/CommandLine.h
    llvm/trunk/lib/Support/CommandLine.cpp

Modified: llvm/trunk/include/llvm/Support/CommandLine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=68163&r1=68162&r2=68163&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/CommandLine.h (original)
+++ llvm/trunk/include/llvm/Support/CommandLine.h Tue Mar 31 19:15:46 2009
@@ -537,7 +537,7 @@
 //
 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 @@
 
   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;
   }
 

Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=68163&r1=68162&r2=68163&view=diff

==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Tue Mar 31 19:15:46 2009
@@ -872,13 +872,13 @@
     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];





More information about the llvm-commits mailing list