@@ -83,7 +83,7 @@ extension Driver {
8383 switch kind {
8484 case . generatePCH:
8585 try addExplicitPCHBuildArguments ( inputs: & inputs, commandLine: & commandLine)
86- case . compile, . emitModule, . interpret:
86+ case . compile, . emitModule, . interpret, . verifyModuleInterface :
8787 try addExplicitModuleBuildArguments ( inputs: & inputs, commandLine: & commandLine)
8888 default :
8989 break
@@ -671,6 +671,23 @@ extension Driver {
671671 try dependencyPlanner. resolveBridgingHeaderDependencies ( inputs: & inputs, commandLine: & commandLine)
672672 }
673673
674+ /// Compute the cache key for swift interface outputs.
675+ mutating func computeCacheKeyForInterface( mainInput: TypedVirtualPath ,
676+ outputs: [ TypedVirtualPath ] ,
677+ commandLine: [ Job . ArgTemplate ] ) throws {
678+ if enableCaching {
679+ func computeKeyForInterface( forPrivate: Bool ) throws -> String ? {
680+ let outputType : FileType =
681+ forPrivate ? . privateSwiftInterface : . swiftInterface
682+ let isNeeded = outputs. contains { $0. type == outputType }
683+ guard isNeeded else { return nil }
684+ return try interModuleDependencyOracle. computeCacheKeyForOutput ( kind: outputType, commandLine: commandLine, input: mainInput. fileHandle)
685+ }
686+ swiftInterfaceCacheKey = try computeKeyForInterface ( forPrivate: false )
687+ privateSwiftInterfaceCacheKey = try computeKeyForInterface ( forPrivate: true )
688+ }
689+ }
690+
674691 /// In Explicit Module Build mode, distinguish between main module jobs and intermediate dependency build jobs,
675692 /// such as Swift modules built from .swiftmodule files and Clang PCMs.
676693 public func isExplicitMainModuleJob( job: Job ) -> Bool {
0 commit comments