Add Real Enable/Disable Flags for Cross-Module Incremental Builds

In the legacy driver, these flags will merely be propagated to the
frontends to indicate that they should disable serialization of
incremental information in swift module files.

In the new driver, these flags control whether the Swift driver performs
an incremental build that is aware of metadata embedded in the module.

Kudos to David for coming up with our new marketing name: Incremental
Imports.

rdar://74363450
This commit is contained in:
Robert Widmann
2021-02-23 13:48:49 -08:00
parent 53069e2a6b
commit 28a37a427f
9 changed files with 28 additions and 13 deletions

View File

@@ -1536,7 +1536,11 @@ static bool performCompileStepsPostSILGen(CompilerInstance &Instance,
SerializationOptions serializationOpts =
Invocation.computeSerializationOptions(outs, Instance.getMainModule());
if (serializationOpts.ExperimentalCrossModuleIncrementalInfo) {
const bool canEmitIncrementalInfoIntoModule =
!serializationOpts.DisableCrossModuleIncrementalInfo &&
(Action == FrontendOptions::ActionType::MergeModules);
if (canEmitIncrementalInfoIntoModule) {
const auto alsoEmitDotFile =
Instance.getInvocation()
.getLangOptions()