mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 11:33:24 +02:00
move a large method out of line.
llvm-svn: 67892
This commit is contained in:
parent
b360b0390a
commit
601a4d8c70
@ -540,21 +540,7 @@ class parser<bool> : public basic_parser<bool> {
|
|||||||
bool IsInvertable; // Should we synthezise a -xno- style option?
|
bool IsInvertable; // Should we synthezise a -xno- style option?
|
||||||
const char *ArgStr;
|
const char *ArgStr;
|
||||||
public:
|
public:
|
||||||
void getExtraOptionNames(std::vector<const char*> &OptionNames) {
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// parse - Return true on error.
|
// parse - Return true on error.
|
||||||
bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
|
bool parse(Option &O, const char *ArgName, const std::string &Arg, bool &Val);
|
||||||
|
@ -877,6 +877,25 @@ bool parser<bool>::parse(Option &O, const char *ArgName,
|
|||||||
return false;
|
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
|
// parser<boolOrDefault> implementation
|
||||||
//
|
//
|
||||||
bool parser<boolOrDefault>::parse(Option &O, const char *ArgName,
|
bool parser<boolOrDefault>::parse(Option &O, const char *ArgName,
|
||||||
|
Loading…
Reference in New Issue
Block a user