mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[driver] Added support for specifying the number of commands to execute in parallel.
The driver does not yet support parallel execution, but this sets the Compilation up with the necessary information to execute commands in parallel. Swift SVN r11333
This commit is contained in:
@@ -95,8 +95,19 @@ std::unique_ptr<Compilation> Driver::buildCompilation(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
unsigned NumberOfParallelCommands = 1;
|
||||
if (const Arg *A = ArgList->getLastArg(options::OPT_j)) {
|
||||
if (StringRef(A->getValue()).getAsInteger(10, NumberOfParallelCommands)) {
|
||||
// TODO: emit diagnostic.
|
||||
llvm::errs() << "warning: invalid value: " << A->getAsString(*ArgList)
|
||||
<< '\n';
|
||||
NumberOfParallelCommands = 1;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<Compilation> C(new Compilation(*this, TC, std::move(ArgList),
|
||||
std::move(TranslatedArgList)));
|
||||
std::move(TranslatedArgList),
|
||||
NumberOfParallelCommands));
|
||||
|
||||
buildJobs(*C, Actions);
|
||||
if (DriverPrintBindings) {
|
||||
|
||||
Reference in New Issue
Block a user