[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:
Connor Wakamo
2013-12-15 21:47:35 +00:00
parent 2d75ca2adf
commit 44971d2e5a
4 changed files with 29 additions and 4 deletions

View File

@@ -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) {