Extract '-sil-inline-threshold' from the performance inliner.

Plumbing this through to the inliner necessitated the creation of a
SILOptions class (like FrontendOptions and IRGenOptions). I'll move
more things into this soon.

One change: for compatibility with the new driver, the option must be
specified as "-sil-inline-threshold 50" instead of "-sil-inline-threshold=50".
(We're really trying to be consistent about joined-equals vs. separate
in the new frontend.)

Swift SVN r13193
This commit is contained in:
Jordan Rose
2014-01-31 01:52:12 +00:00
parent bac31d985a
commit c7f1064527
9 changed files with 95 additions and 23 deletions

View File

@@ -559,6 +559,19 @@ static void PrintArg(raw_ostream &OS, const char *Arg, bool Quote) {
OS << '"';
}
static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
DiagnosticEngine &Diags) {
if (const Arg *A = Args.getLastArg(options::OPT_sil_inline_threshold)) {
if (StringRef(A->getValue()).getAsInteger(10, Opts.InlineThreshold)) {
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
A->getAsString(Args), A->getValue());
return true;
}
}
return false;
}
void CompilerInvocation::buildDWARFDebugFlags(std::string &Output,
const ArrayRef<const char*> &Args,
StringRef SDKPath) {
@@ -698,7 +711,11 @@ bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
if (ParseSearchPathArgs(SearchPathOpts, *ParsedArgs, Diags)) {
return true;
}
if (ParseSILArgs(SILOpts, *ParsedArgs, Diags)) {
return true;
}
if (ParseIRGenArgs(IRGenOpts, *ParsedArgs, Diags, FrontendOpts,
getSDKPath())) {
return true;