Skip to content

Commit 9626d55

Browse files
authored
Merge pull request #29196 from rintaro/sourcekit-rdar58550697
[SourceKit] Disable module system headers validation
2 parents faf3be4 + 951b853 commit 9626d55

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/IDE/CompletionInstance.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,6 @@ bool swift::ide::CompletionInstance::performOperation(
324324
// source text. That breaks an invariant of syntax tree building.
325325
Invocation.getLangOptions().BuildSyntaxTree = false;
326326

327-
// This validation may call stat(2) many times. Disable it to prevent
328-
// performance regression.
329-
Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies =
330-
true;
331-
332327
// FIXME: ASTScopeLookup doesn't support code completion yet.
333328
Invocation.disableASTScopeLookup();
334329

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
@@ -3436,6 +3436,8 @@ int main(int argc, char *argv[]) {
34363436
options::DebugForbidTypecheckPrefix;
34373437
InitInvok.getTypeCheckerOptions().DebugConstraintSolver =
34383438
options::DebugConstraintSolver;
3439+
InitInvok.getSearchPathOptions().DisableModulesValidateSystemDependencies =
3440+
true;
34393441

34403442
for (auto ConfigName : options::BuildConfigs)
34413443
InitInvok.getLangOptions().addCustomConditionalCompilationFlag(ConfigName);

0 commit comments

Comments
 (0)