Make tail merging the default, except on powerPC. There was no prior art

for a target-dependent default with a command-line override; this way
should be generally usable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37285 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen
2007-05-22 17:14:46 +00:00
parent 9621921acb
commit 81da02b553
8 changed files with 69 additions and 7 deletions

View File

@ -36,6 +36,7 @@ using namespace cl;
// Template instantiations and anchors.
//
TEMPLATE_INSTANTIATION(class basic_parser<bool>);
TEMPLATE_INSTANTIATION(class basic_parser<boolOrDefault>);
TEMPLATE_INSTANTIATION(class basic_parser<int>);
TEMPLATE_INSTANTIATION(class basic_parser<unsigned>);
TEMPLATE_INSTANTIATION(class basic_parser<double>);
@ -50,6 +51,7 @@ TEMPLATE_INSTANTIATION(class opt<bool>);
void Option::anchor() {}
void basic_parser_impl::anchor() {}
void parser<bool>::anchor() {}
void parser<boolOrDefault>::anchor() {}
void parser<int>::anchor() {}
void parser<unsigned>::anchor() {}
void parser<double>::anchor() {}
@ -767,6 +769,22 @@ bool parser<bool>::parse(Option &O, const char *ArgName,
return false;
}
// parser<boolOrDefault> implementation
//
bool parser<boolOrDefault>::parse(Option &O, const char *ArgName,
const std::string &Arg, boolOrDefault &Value) {
if (Arg == "" || Arg == "true" || Arg == "TRUE" || Arg == "True" ||
Arg == "1") {
Value = BOU_TRUE;
} else if (Arg == "false" || Arg == "FALSE" || Arg == "False" || Arg == "0") {
Value = BOU_FALSE;
} else {
return O.error(": '" + Arg +
"' is invalid value for boolean argument! Try 0 or 1");
}
return false;
}
// parser<int> implementation
//
bool parser<int>::parse(Option &O, const char *ArgName,