`env` is a default'ed parameter. In some cases it may be passed a `nullptr`,
which is not a valid parameter to `llvm::toStringRefArray`. Guard against this
case. This allows the swift compiler to work again on Windows!
This now takes `ArrayRef<StringRef>` and `Optional<ArrayRef<StringRef>>`
parameters. Explicitly update the interfaces to match. This is particularly
important to repair the Windows build.
Added swift::ExecuteInPlace(), which on Unix acts as a wrapper for execv()
and execve(). On other platforms, swift::ExecuteInPlace() is a wrapper for
llvm::sys::ExecuteAndWait(), so callers must be prepared for ExecuteInPlace()
to return in a non-error situation.
Added support in Compilation::performJobs() to detect that the Compilation has
exactly one Command to run. If that's the case, and buffered output isn't
required, execute that Command using swift::ExecuteInPlace() (instead of
creating a TaskQueue, which may unconditionally buffer output).
This change will allow the driver to invoke the frontend's REPL and immediate
modes without buffering output (and, on Unix, without a separate process being
spawned).
Also updated test/Driver/basic.swift to emit output with these changes in place.
Swift SVN r12544