mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
NFC: Move NumThreads from SILOptions to IRGenOptions
The option is only needed for IRGen.
This commit is contained in:
@@ -993,18 +993,6 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (const Arg *A = Args.getLastArg(OPT_num_threads)) {
|
||||
if (StringRef(A->getValue()).getAsInteger(10, Opts.NumThreads)) {
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
A->getAsString(Args), A->getValue());
|
||||
return true;
|
||||
}
|
||||
if (environmentVariableRequestedMaximumDeterminism()) {
|
||||
Opts.NumThreads = 1;
|
||||
Diags.diagnose(SourceLoc(), diag::remark_max_determinism_overriding,
|
||||
"-num-threads");
|
||||
}
|
||||
}
|
||||
|
||||
// If we're only emitting a module, stop optimizations once we've serialized
|
||||
// the SIL for the module.
|
||||
@@ -1209,7 +1197,7 @@ static bool ParseTBDGenArgs(TBDGenOptions &Opts, ArgList &Args,
|
||||
CompilerInvocation &Invocation) {
|
||||
using namespace options;
|
||||
|
||||
Opts.HasMultipleIGMs = Invocation.getSILOptions().hasMultipleIGMs();
|
||||
Opts.HasMultipleIGMs = Invocation.getIRGenOptions().hasMultipleIGMs();
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_module_link_name)) {
|
||||
Opts.ModuleLinkName = A->getValue();
|
||||
@@ -1543,6 +1531,19 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
getRuntimeCompatVersion();
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_num_threads)) {
|
||||
if (StringRef(A->getValue()).getAsInteger(10, Opts.NumThreads)) {
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
A->getAsString(Args), A->getValue());
|
||||
return true;
|
||||
}
|
||||
if (environmentVariableRequestedMaximumDeterminism()) {
|
||||
Opts.NumThreads = 1;
|
||||
Diags.diagnose(SourceLoc(), diag::remark_max_determinism_overriding,
|
||||
"-num-threads");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user