[BatchMode] Avoid spurious warnings in sourcekitd and indexing

Explicitly disable batch mode in createCompilerInvocation, since it uses
-force-single-frontend-invocation.  Previously we were getting spurious
warnings.  Also add a test that -disable-batch-mode will allow commands
that use -index-file to avoid the same warning, since that is likely
what they want to do as well.

rdar://39581506
This commit is contained in:
Ben Langmuir
2018-04-20 10:57:50 -07:00
parent 71e72d860e
commit 8ea2d0dded
4 changed files with 17 additions and 0 deletions

View File

@@ -34,6 +34,11 @@ swift::driver::createCompilerInvocation(ArrayRef<const char *> Argv,
// frontend command.
Args.push_back("-force-single-frontend-invocation");
// Explictly disable batch mode to avoid a spurious warning when combining
// -enable-batch-mode with -force-single-frontend-invocation. This is an
// implementation detail.
Args.push_back("-disable-batch-mode");
// Avoid using filelists
std::string neverThreshold =
std::to_string(Compilation::NEVER_USE_FILELIST);