mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user