mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Frontend] Internalize createDependencyTracker
Expand the FrontendOptions to allow the enabling of the dependency tracker for non-system dependencies, and switch the previous clients of `createDependencyTracker` over to using this option. This ensures that the dependency tracker is now set only during `CompilerInstance::setup`.
This commit is contained in:
@@ -1126,9 +1126,14 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
|
||||
GenericArgs.push_back("-prebuilt-module-cache-path");
|
||||
GenericArgs.push_back(prebuiltCachePath);
|
||||
}
|
||||
subInvocation.getFrontendOptions().TrackSystemDeps = trackSystemDependencies;
|
||||
if (trackSystemDependencies) {
|
||||
subInvocation.getFrontendOptions().IntermoduleDependencyTracking =
|
||||
IntermoduleDepTrackingMode::IncludeSystem;
|
||||
GenericArgs.push_back("-track-system-dependencies");
|
||||
} else {
|
||||
// Always track at least the non-system dependencies for interface building.
|
||||
subInvocation.getFrontendOptions().IntermoduleDependencyTracking =
|
||||
IntermoduleDepTrackingMode::ExcludeSystem;
|
||||
}
|
||||
if (LoaderOpts.disableImplicitSwiftModule) {
|
||||
subInvocation.getFrontendOptions().DisableImplicitModules = true;
|
||||
@@ -1252,7 +1257,7 @@ InterfaceSubContextDelegateImpl::getCacheHash(StringRef useInterfacePath) {
|
||||
|
||||
// Whether or not we're tracking system dependencies affects the
|
||||
// invalidation behavior of this cache item.
|
||||
subInvocation.getFrontendOptions().TrackSystemDeps);
|
||||
subInvocation.getFrontendOptions().shouldTrackSystemDependencies());
|
||||
|
||||
return llvm::APInt(64, H).toString(36, /*Signed=*/false);
|
||||
}
|
||||
@@ -1330,8 +1335,6 @@ bool InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleN
|
||||
|
||||
ForwardingDiagnosticConsumer FDC(Diags);
|
||||
subInstance.addDiagnosticConsumer(&FDC);
|
||||
subInstance.createDependencyTracker(subInvocation.getFrontendOptions()
|
||||
.TrackSystemDeps);
|
||||
if (subInstance.setup(subInvocation)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user