From e121cb09cdab86c1479cc0ebf8ac063f2823e0a8 Mon Sep 17 00:00:00 2001 From: Rintaro Ishizaki Date: Thu, 30 Jan 2020 15:04:07 -0800 Subject: [PATCH 1/2] Revert "[SourceKit] Disable module system headers validation" This reverts commit 951b85359a8b4781bae9e0735a893aee07b3dd1e. --- lib/IDE/CompletionInstance.cpp | 5 +++++ tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp | 5 ----- tools/swift-ide-test/swift-ide-test.cpp | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/IDE/CompletionInstance.cpp b/lib/IDE/CompletionInstance.cpp index 446d80601a9c3..7d326b96bf116 100644 --- a/lib/IDE/CompletionInstance.cpp +++ b/lib/IDE/CompletionInstance.cpp @@ -362,6 +362,11 @@ bool swift::ide::CompletionInstance::performOperation( // source text. That breaks an invariant of syntax tree building. Invocation.getLangOptions().BuildSyntaxTree = false; + // This validation may call stat(2) many times. Disable it to prevent + // performance regression. + Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies = + true; + // Since caching uses the interface hash, and since per type fingerprints // weaken that hash, disable them here: Invocation.getLangOptions().EnableTypeFingerprints = false; diff --git a/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp b/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp index 1ebbcfeb25441..1e2b1fd10a211 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp @@ -539,11 +539,6 @@ 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 diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp index fb2b67b7225fb..995eaaaab5eef 100644 --- a/tools/swift-ide-test/swift-ide-test.cpp +++ b/tools/swift-ide-test/swift-ide-test.cpp @@ -3436,8 +3436,6 @@ int main(int argc, char *argv[]) { options::DebugForbidTypecheckPrefix; InitInvok.getTypeCheckerOptions().DebugConstraintSolver = options::DebugConstraintSolver; - InitInvok.getSearchPathOptions().DisableModulesValidateSystemDependencies = - true; for (auto ConfigName : options::BuildConfigs) InitInvok.getLangOptions().addCustomConditionalCompilationFlag(ConfigName); From cb20d0ebfa9623a61f581edaba7e805cd0c357fd Mon Sep 17 00:00:00 2001 From: Rintaro Ishizaki Date: Thu, 30 Jan 2020 15:04:56 -0800 Subject: [PATCH 2/2] Revert "[CodeCompletion] Disable module system headers validation" This reverts commit ec70a40205396a9bd9e0310b3b81b4b41838976a. --- lib/IDE/CompletionInstance.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/IDE/CompletionInstance.cpp b/lib/IDE/CompletionInstance.cpp index 7d326b96bf116..446d80601a9c3 100644 --- a/lib/IDE/CompletionInstance.cpp +++ b/lib/IDE/CompletionInstance.cpp @@ -362,11 +362,6 @@ bool swift::ide::CompletionInstance::performOperation( // source text. That breaks an invariant of syntax tree building. Invocation.getLangOptions().BuildSyntaxTree = false; - // This validation may call stat(2) many times. Disable it to prevent - // performance regression. - Invocation.getSearchPathOptions().DisableModulesValidateSystemDependencies = - true; - // Since caching uses the interface hash, and since per type fingerprints // weaken that hash, disable them here: Invocation.getLangOptions().EnableTypeFingerprints = false;