Skip to content

Commit ba443dd

Browse files
authored
Merge pull request #29202 from rintaro/5.2-sourcekit-rdar58550697
[5.2][SourceKit] Disable module system headers validation in all SourceKit requests
2 parents 71b9cc8 + 6528d7f commit ba443dd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,11 @@ bool SwiftASTManager::initCompilerInvocation(
539539
// We don't care about LLVMArgs
540540
FrontendOpts.LLVMArgs.clear();
541541

542+
// This validation may call stat(2) many times. Disable it to prevent
543+
// performance issues.
544+
Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies =
545+
true;
546+
542547
// SwiftSourceInfo files provide source location information for decls coming
543548
// from loaded modules. For most IDE use cases it either has an undesirable
544549
// impact on performance with no benefit (code completion), results in stale

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3302,6 +3302,8 @@ int main(int argc, char *argv[]) {
33023302
options::DebugForbidTypecheckPrefix;
33033303
InitInvok.getTypeCheckerOptions().DebugConstraintSolver =
33043304
options::DebugConstraintSolver;
3305+
InitInvok.getSearchPathOptions().DisableModulesValidateSystemDependencies =
3306+
true;
33053307

33063308
for (auto ConfigName : options::BuildConfigs)
33073309
InitInvok.getLangOptions().addCustomConditionalCompilationFlag(ConfigName);

0 commit comments

Comments
 (0)