move a large method out of line.
authorChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 02:08:47 +0000 (02:08 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Mar 2009 02:08:47 +0000 (02:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67892 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 52052e44654e423f4d7a0980c59188d75ae9349e..12eb3a5f7a5744e7548ccfed04bc945117ff82d8 100644 (file)
@@ -540,22 +540,8 @@ class parser<bool> : public basic_parser<bool> {
   bool IsInvertable;   // Should we synthezise a -xno- style option?
   const char *ArgStr;
 public:
-  void getExtraOptionNames(std::vector<const char*> &OptionNames) {
-    if (IsInvertable) {
-      char *s = new char [strlen(ArgStr) + 3 + 1];
-      s[0] = ArgStr[0];
-      if (strncmp(ArgStr+1, "no-", 3) == 0)
-        strcpy(&s[1], &ArgStr[4]);
-      else {
-        s[1] = 'n';
-        s[2] = 'o';
-        s[3] = '-';
-        strcpy(&s[4], ArgStr+1);
-      }
-      OptionNames.push_back(s);
-    }
-  }
-
+  void getExtraOptionNames(std::vector<const char*> &OptionNames);
+  
   // parse - Return true on error.
   bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
 
index 2c56e0ffb87eb0fc5e12c06d1f924466a06fd56d..f3f198b355e1a5d12f612ac2de94396b2c417a5a 100644 (file)
@@ -877,6 +877,25 @@ bool parser<bool>::parse(Option &O, const char *ArgName,
   return false;
 }
 
+void parser<bool>::getExtraOptionNames(std::vector<const char*> &OptionNames) {
+  if (!IsInvertable)
+    return;
+  
+  char *s = new char [strlen(ArgStr) + 3 + 1];
+  s[0] = ArgStr[0];
+  if (strncmp(ArgStr+1, "no-", 3) == 0)
+    strcpy(&s[1], &ArgStr[4]);
+  else {
+    s[1] = 'n';
+    s[2] = 'o';
+    s[3] = '-';
+    strcpy(&s[4], ArgStr+1);
+  }
+  OptionNames.push_back(s);
+}
+
+
+
 // parser<boolOrDefault> implementation
 //
 bool parser<boolOrDefault>::parse(Option &O, const char *ArgName,