1- //===--------------- ExplicitModuleBuildHandler .swift ---------------------===//
1+ //===--------------- ExplicitDependencyBuildPlanner .swift ---------------------===//
22//
33// This source file is part of the Swift.org open source project
44//
@@ -13,16 +13,16 @@ import TSCBasic
1313import TSCUtility
1414import Foundation
1515
16- /// A map from a module identifier to a pair consisting of a path to its .swiftmodule file.
16+ /// A map from a module identifier to a path to its .swiftmodule file.
1717public typealias ExternalTargetModulePathMap = [ ModuleDependencyId : AbsolutePath ]
1818/// A tuple all external artifacts a build system may pass in as input to the explicit build of the current module
1919/// Consists of a map of externally-built targets, and a map of all previously discovered/scanned modules.
2020public typealias ExternalBuildArtifacts = ( ExternalTargetModulePathMap , ModuleInfoMap )
2121
22- /// In Explicit Module Build mode, this handler is responsible for generating and providing
22+ /// In Explicit Module Build mode, this planner is responsible for generating and providing
2323/// build jobs for all module dependencies and providing compile command options
2424/// that specify said explicit module dependencies.
25- @_spi ( Testing) public struct ExplicitModuleBuildHandler {
25+ @_spi ( Testing) public struct ExplicitDependencyBuildPlanner {
2626 /// The module dependency graph.
2727 public var dependencyGraph : InterModuleDependencyGraph
2828
@@ -201,7 +201,7 @@ public typealias ExternalBuildArtifacts = (ExternalTargetModulePathMap, ModuleIn
201201
202202 // Encode the target triple pcm args into the output `.pcm` filename
203203 let targetEncodedModulePath =
204- try ExplicitModuleBuildHandler . targetEncodedClangModuleFilePath ( for: moduleInfo,
204+ try ExplicitDependencyBuildPlanner . targetEncodedClangModuleFilePath ( for: moduleInfo,
205205 pcmArgs: pcmArgs)
206206 outputs. append ( TypedVirtualPath ( file: targetEncodedModulePath, type: . pcm) )
207207 commandLine. appendFlags ( " -emit-pcm " , " -module-name " , moduleId. moduleName,
@@ -384,7 +384,7 @@ public typealias ExternalBuildArtifacts = (ExternalTargetModulePathMap, ModuleIn
384384 let dependencyInfo = try dependencyGraph. moduleInfo ( of: dependencyId)
385385 let dependencyClangModuleDetails = try dependencyGraph. clangModuleDetails ( of: dependencyId)
386386 let clangModulePath =
387- try ExplicitModuleBuildHandler . targetEncodedClangModuleFilePath ( for: dependencyInfo,
387+ try ExplicitDependencyBuildPlanner . targetEncodedClangModuleFilePath ( for: dependencyInfo,
388388 pcmArgs: pcmArgs)
389389
390390 // Collect the requried information about this module
@@ -430,7 +430,7 @@ public typealias ExternalBuildArtifacts = (ExternalTargetModulePathMap, ModuleIn
430430}
431431
432432/// Utility methods for encoding PCM's target triple into its name.
433- extension ExplicitModuleBuildHandler {
433+ extension ExplicitDependencyBuildPlanner {
434434 /// Compute a full path to the resulting .pcm file for a given Clang module, with the
435435 /// target triple encoded in the name.
436436 public static func targetEncodedClangModuleFilePath( for moduleInfo: ModuleInfo ,
@@ -455,7 +455,7 @@ extension ExplicitModuleBuildHandler {
455455 }
456456}
457457
458- /// Encapsulates some of the common queries of the ExplicitModuleBuildeHandler with error-checking
458+ /// Encapsulates some of the common queries of the ExplicitDependencyBuildPlanner with error-checking
459459/// on the dependency graph's structure.
460460internal extension InterModuleDependencyGraph {
461461 func moduleInfo( of moduleId: ModuleDependencyId ) throws -> ModuleInfo {
@@ -496,7 +496,7 @@ internal extension InterModuleDependencyGraph {
496496}
497497
498498// InterModuleDependencyGraph printing, useful for debugging
499- private extension InterModuleDependencyGraph {
499+ internal extension InterModuleDependencyGraph {
500500 func prettyPrintString( ) throws -> String {
501501 let encoder = JSONEncoder ( )
502502 encoder. outputFormatting = [ . prettyPrinted]
@@ -505,10 +505,10 @@ private extension InterModuleDependencyGraph {
505505 }
506506}
507507
508- // To keep the ExplicitModuleBuildHandler an implementation detail, provide an API
508+ // To keep the ExplicitDependencyBuildPlanner an implementation detail, provide an API
509509// to access the dependency graph
510510extension Driver {
511511 public var interModuleDependencyGraph : InterModuleDependencyGraph ? {
512- return explicitModuleBuildHandler ? . dependencyGraph
512+ return explicitDependencyBuildPlanner ? . dependencyGraph
513513 }
514514}
0 commit comments