[SourceKit] Disable module system headers validation

in all SourceKit requests.
This validation may call many stat(2). Since we don't expect system files
are edited. Disable it for SourceKit requests. Even if they are edited,
manual builds can validates and updates them.

rdar://problem/58550697
This commit is contained in:
Rintaro Ishizaki
2020-01-14 13:06:57 -08:00
parent faf3be4e8a
commit 951b85359a
3 changed files with 7 additions and 5 deletions

View File

@@ -539,6 +539,11 @@ bool SwiftASTManager::initCompilerInvocation(
// We don't care about LLVMArgs
FrontendOpts.LLVMArgs.clear();
// This validation may call stat(2) many times. Disable it to prevent
// performance issues.
Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies =
true;
// SwiftSourceInfo files provide source location information for decls coming
// from loaded modules. For most IDE use cases it either has an undesirable
// impact on performance with no benefit (code completion), results in stale