Move SILLinkMode to SILOptions.

SILSerializeAll and EmitVerboseSIL are /not/ being moved because they are
options controlling the output, not about SILGen and SIL passes.

No functionality change.

Swift SVN r13197
This commit is contained in:
Jordan Rose
2014-01-31 02:34:34 +00:00
parent 3e08673772
commit 6af4dbf0e9
4 changed files with 31 additions and 29 deletions

View File

@@ -434,16 +434,6 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.ModuleLinkName = A->getValue();
}
if (const Arg *A = Args.getLastArg(OPT_disable_sil_linking,
OPT_sil_link_all)) {
if (A->getOption().matches(OPT_disable_sil_linking))
Opts.SILLinking = FrontendOptions::LinkNone;
else if (A->getOption().matches(OPT_sil_link_all))
Opts.SILLinking = FrontendOptions::LinkAll;
else
llvm_unreachable("Unknown SIL linking option!");
}
Opts.SILSerializeAll = Args.hasArg(OPT_sil_serialize_all);
return false;
@@ -561,7 +551,9 @@ static void PrintArg(raw_ostream &OS, const char *Arg, bool Quote) {
static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
DiagnosticEngine &Diags) {
if (const Arg *A = Args.getLastArg(options::OPT_sil_inline_threshold)) {
using namespace options;
if (const Arg *A = Args.getLastArg(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());
@@ -569,6 +561,16 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
}
}
if (const Arg *A = Args.getLastArg(OPT_disable_sil_linking,
OPT_sil_link_all)) {
if (A->getOption().matches(OPT_disable_sil_linking))
Opts.LinkMode = SILOptions::LinkNone;
else if (A->getOption().matches(OPT_sil_link_all))
Opts.LinkMode = SILOptions::LinkAll;
else
llvm_unreachable("Unknown SIL linking option!");
}
return false;
}