Initial plumbing for private dependencies

Add a mode bit to the dependency collector that respects the frontend flag in the previous commit.

Notably, we now write over the dependency files at the end of the compiler pipeline when this flag is on so that dependency from SILGen and IRGen are properly written to disk.
This commit is contained in:
Robert Widmann
2020-05-04 15:51:10 -07:00
parent a42fa19d12
commit b06211eac4
27 changed files with 1150 additions and 16 deletions

View File

@@ -2184,6 +2184,14 @@ int swift::performFrontend(ArrayRef<const char *> Args,
Invocation.getFrontendOptions().DumpAPIPath);
}
// If we're asked to enable private intransitive dependencies, we need to
// write over the dependency files we just emitted because we need to
// get the dependencies written post-Sema down on disk.
// FIXME: Evaluate the impact turning this on universally has.
if (Invocation.getLangOptions().EnableExperientalPrivateIntransitiveDependencies) {
emitReferenceDependenciesForAllPrimaryInputsIfNeeded(*Instance);
}
// Verify reference dependencies of the current compilation job *before*
// verifying diagnostics so that the former can be tested via the latter.
if (Invocation.getFrontendOptions().EnableIncrementalDependencyVerifier) {