Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/AST/ModuleDependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,13 @@ SwiftDependencyScanningService::SwiftDependencyScanningService() {
clang::CASOptions(),
/* CAS (llvm::cas::ObjectStore) */ nullptr,
/* Cache (llvm::cas::ActionCache) */ nullptr,
/* SharedFS */ nullptr);
/* SharedFS */ nullptr,
// ScanningOptimizations::Default excludes the current working
// directory optimization. Clang needs to communicate with
// the build system to handle the optimization safely.
// Swift can handle the working directory optimizaiton
// already so it is safe to turn on all optimizations.
clang::tooling::dependencies::ScanningOptimizations::All);
SharedFilesystemCache.emplace();
}

Expand Down Expand Up @@ -748,7 +754,11 @@ bool SwiftDependencyScanningService::setupCachingDependencyScanningService(
ClangScanningFormat,
Instance.getInvocation().getCASOptions().CASOpts,
Instance.getSharedCASInstance(), Instance.getSharedCacheInstance(),
UseClangIncludeTree ? nullptr : CacheFS);
UseClangIncludeTree ? nullptr : CacheFS,
// The current working directory optimization (off by default)
// should not impact CAS. We set the optization to all to be
// consistent with the non-CAS case.
clang::tooling::dependencies::ScanningOptimizations::All);

return false;
}
Expand Down