mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Caching][NFC] Restructure CASOption in swift. NFC
Clean up how CASOptions are kept and passed inside swift to make the code more readable. Also avoid a copy of CAS configuration in ClangImporter.
This commit is contained in:
@@ -480,12 +480,12 @@ SwiftDependencyTracker::createTreeFromDependencies() {
|
||||
|
||||
bool SwiftDependencyScanningService::setupCachingDependencyScanningService(
|
||||
CompilerInstance &Instance) {
|
||||
if (!Instance.getInvocation().getFrontendOptions().EnableCaching)
|
||||
if (!Instance.getInvocation().getCASOptions().EnableCaching)
|
||||
return false;
|
||||
|
||||
if (CASOpts) {
|
||||
// If CASOption matches, the service is initialized already.
|
||||
if (*CASOpts == Instance.getInvocation().getFrontendOptions().CASOpts)
|
||||
if (*CASOpts == Instance.getInvocation().getCASOptions().CASOpts)
|
||||
return false;
|
||||
|
||||
// CASOption mismatch, return error.
|
||||
@@ -496,7 +496,7 @@ bool SwiftDependencyScanningService::setupCachingDependencyScanningService(
|
||||
}
|
||||
|
||||
// Setup CAS.
|
||||
CASOpts = Instance.getInvocation().getFrontendOptions().CASOpts;
|
||||
CASOpts = Instance.getInvocation().getCASOptions().CASOpts;
|
||||
CAS = Instance.getSharedCASInstance();
|
||||
|
||||
// Add SDKSetting file.
|
||||
@@ -552,7 +552,7 @@ bool SwiftDependencyScanningService::setupCachingDependencyScanningService(
|
||||
ClangScanningService.emplace(
|
||||
clang::tooling::dependencies::ScanningMode::DependencyDirectivesScan,
|
||||
ClangScanningFormat,
|
||||
Instance.getInvocation().getFrontendOptions().CASOpts,
|
||||
Instance.getInvocation().getCASOptions().CASOpts,
|
||||
Instance.getSharedCASInstance(), Instance.getSharedCacheInstance(),
|
||||
UseClangIncludeTree ? nullptr : CacheFS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user