From 601a4d8c700d71e1a0308a91829210def7af7c9b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Mar 2009 02:08:47 +0000 Subject: [PATCH] move a large method out of line. llvm-svn: 67892 --- include/llvm/Support/CommandLine.h | 18 ++---------------- lib/Support/CommandLine.cpp | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 52052e44654..12eb3a5f7a5 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -540,22 +540,8 @@ class parser : public basic_parser { bool IsInvertable; // Should we synthezise a -xno- style option? const char *ArgStr; public: - void getExtraOptionNames(std::vector &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 &OptionNames); + // parse - Return true on error. bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val); diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 2c56e0ffb87..f3f198b355e 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -877,6 +877,25 @@ bool parser::parse(Option &O, const char *ArgName, return false; } +void parser::getExtraOptionNames(std::vector &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 implementation // bool parser::parse(Option &O, const char *ArgName,