@@ -2132,7 +2132,6 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
21322132
21332133 // Compute the inputs and object output dependency paths.
21342134 // Note that we compute the object file output paths here even if the compilation mode won't produce any, because these paths are used to compute the paths to other generated files.
2135- // FIXME: If we want to match what Xcode did, then when using non-parallel WMO, we should include $(TARGET_NAME)-master.o as an output file, but not include the per-input-file object files as output files.
21362135 let outputObjectExtension : String
21372136 switch cbc. scope. evaluate ( BuiltinMacros . SWIFT_LTO) {
21382137 case . yes, . yesThin:
@@ -2161,11 +2160,11 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
21612160
21622161 // Add const metadata outputs to extra compilation outputs
21632162 if await supportConstSupplementaryMetadata ( cbc, delegate, compilationMode: compilationMode) {
2164- // If using whole module optimization then we use the -master .swiftconstvalues file from the sole compilation task.
2163+ // If using whole module optimization then we use the -primary .swiftconstvalues file from the sole compilation task.
21652164 if isUsingWholeModuleOptimization {
21662165 if let outputPath = objectOutputPaths. first {
2167- let masterSwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + compilationMode. moduleBaseNameSuffix + " -master "
2168- let supplementaryConstMetadataOutputPath = outputPath. dirname. join ( masterSwiftBaseName + " .swiftconstvalues " )
2166+ let primarySwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + compilationMode. moduleBaseNameSuffix + " -primary "
2167+ let supplementaryConstMetadataOutputPath = outputPath. dirname. join ( primarySwiftBaseName + " .swiftconstvalues " )
21692168 extraOutputPaths. append ( supplementaryConstMetadataOutputPath)
21702169 delegate. declareGeneratedSwiftConstMetadataFile ( supplementaryConstMetadataOutputPath, architecture: arch)
21712170 }
@@ -2232,11 +2231,11 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
22322231 //
22332232 // FIXME: Can we simplify this to not require the full macro scope?
22342233 //
2235- // If using whole module optimization then we use the -master .d file as the dependency file.
2234+ // If using whole module optimization then we use the -primary .d file as the dependency file.
22362235 if let outputPath = objectOutputPaths. first {
22372236 if Self . shouldUseWholeModuleOptimization ( for: cbc. scope) . result {
2238- let masterSwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + compilationMode. moduleBaseNameSuffix + " -master "
2239- let dependenciesFilePath = outputPath. dirname. join ( masterSwiftBaseName + " .d " )
2237+ let primarySwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + compilationMode. moduleBaseNameSuffix + " -primary "
2238+ let dependenciesFilePath = outputPath. dirname. join ( primarySwiftBaseName + " .d " )
22402239 return dependenciesFilePath
22412240 } else {
22422241 // if not using WMO, we use the first .d file as all are the same
@@ -2348,8 +2347,8 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
23482347 let dependencyData : DependencyDataStyle ?
23492348 if await shouldEmitMakeStyleDependencies ( cbc. producer, cbc. scope, delegate: delegate) {
23502349 // FIXME: Duplication with `SwiftCompilerSpec.computeOutputFileMapContents`
2351- let masterSwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + compilationMode. moduleBaseNameSuffix + " -master "
2352- let emitModuleDependenciesFilePath = objectFileDir. join ( masterSwiftBaseName + " -emit-module.d " )
2350+ let primarySwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + compilationMode. moduleBaseNameSuffix + " -primary "
2351+ let emitModuleDependenciesFilePath = objectFileDir. join ( primarySwiftBaseName + " -emit-module.d " )
23532352 dependencyData = eagerCompilationEnabled ? . makefileIgnoringSubsequentOutputs( emitModuleDependenciesFilePath) : dependencyInfoPath. map ( DependencyDataStyle . makefileIgnoringSubsequentOutputs)
23542353 } else {
23552354 dependencyData = nil
@@ -2755,7 +2754,7 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
27552754 moduleDirPath = scope. evaluate ( BuiltinMacros . BUILT_PRODUCTS_DIR) . join ( moduleName + " .swiftmodule " )
27562755 }
27572756 if isProject {
2758- // Copy this content to the Project subdir so we could master them out when installing.
2757+ // Copy this content to the Project subdir so we can exclude them by filename pattern when installing.
27592758 return moduleDirPath. join ( " Project " )
27602759 }
27612760 return moduleDirPath
@@ -3047,7 +3046,7 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
30473046
30483047 // Compute strings that will be used at various points when building the map.
30493048 let moduleBaseNameSuffix = compilationMode. moduleBaseNameSuffix
3050- let masterSwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + moduleBaseNameSuffix + " -master "
3049+ let primarySwiftBaseName = cbc. scope. evaluate ( BuiltinMacros . TARGET_NAME) + moduleBaseNameSuffix + " -primary "
30513050 let emitConstSideCarValues = await supportConstSupplementaryMetadata ( cbc, delegate, compilationMode: compilationMode)
30523051
30533052 func createCommonFileEntry( input: FileToBuild ) -> ( objectFilePath: Path , fileMapEntry: SwiftOutputFileMap . Entry ) {
@@ -3110,25 +3109,25 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
31103109 var fileMapEntry = SwiftOutputFileMap . Entry ( )
31113110
31123111 // The file used by Swift to manage intermodule dependencies.
3113- let globalSwiftDependenciesFilePath = objectFileDir. join ( masterSwiftBaseName + " .swiftdeps " )
3112+ let globalSwiftDependenciesFilePath = objectFileDir. join ( primarySwiftBaseName + " .swiftdeps " )
31143113 fileMapEntry. swiftDependencies = globalSwiftDependenciesFilePath. str
31153114
31163115 // The diagnostics file.
3117- let diagnosticsFilePath = objectFileDir. join ( masterSwiftBaseName + " .dia " )
3116+ let diagnosticsFilePath = objectFileDir. join ( primarySwiftBaseName + " .dia " )
31183117 fileMapEntry. diagnostics = diagnosticsFilePath. str
31193118
31203119 // The diagnostics file for emit-module jobs.
3121- let emitModuleDiagnosticsFilePath = objectFileDir. join ( masterSwiftBaseName + " -emit-module.dia " )
3120+ let emitModuleDiagnosticsFilePath = objectFileDir. join ( primarySwiftBaseName + " -emit-module.dia " )
31223121 fileMapEntry. emitModuleDiagnostics = emitModuleDiagnosticsFilePath. str
31233122
31243123 if await shouldEmitMakeStyleDependencies ( cbc. producer, cbc. scope, delegate: delegate) {
31253124 // The dependency file for emit-module jobs.
3126- let emitModuleDependenciesFilePath = objectFileDir. join ( masterSwiftBaseName + " -emit-module.d " )
3125+ let emitModuleDependenciesFilePath = objectFileDir. join ( primarySwiftBaseName + " -emit-module.d " )
31273126 fileMapEntry. emitModuleDependencies = emitModuleDependenciesFilePath. str
31283127 }
31293128
31303129 // The PCH file path for generatePCH job.
3131- let bridgingHeaderPCHPath = objectFileDir. join ( masterSwiftBaseName + " -Bridging-header.pch " )
3130+ let bridgingHeaderPCHPath = objectFileDir. join ( primarySwiftBaseName + " -Bridging-header.pch " )
31323131 fileMapEntry. pch = bridgingHeaderPCHPath. str
31333132
31343133 // Add the global entry to the map.
@@ -3146,35 +3145,35 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
31463145 var fileMapEntry = SwiftOutputFileMap . Entry ( )
31473146
31483147 // The diagnostics file.
3149- let diagnosticsFilePath = objectFileDir. join ( masterSwiftBaseName + " .dia " )
3148+ let diagnosticsFilePath = objectFileDir. join ( primarySwiftBaseName + " .dia " )
31503149 fileMapEntry. diagnostics = diagnosticsFilePath. str
31513150
31523151 // The diagnostics file for emit-module jobs.
3153- let emitModuleDiagnosticsFilePath = objectFileDir. join ( masterSwiftBaseName + " -emit-module.dia " )
3152+ let emitModuleDiagnosticsFilePath = objectFileDir. join ( primarySwiftBaseName + " -emit-module.dia " )
31543153 fileMapEntry. emitModuleDiagnostics = emitModuleDiagnosticsFilePath. str
31553154
31563155 if await shouldEmitMakeStyleDependencies ( cbc. producer, cbc. scope, delegate: delegate) {
31573156 // The dependency file for emit-module jobs.
3158- let emitModuleDependenciesFilePath = objectFileDir. join ( masterSwiftBaseName + " -emit-module.d " )
3157+ let emitModuleDependenciesFilePath = objectFileDir. join ( primarySwiftBaseName + " -emit-module.d " )
31593158 fileMapEntry. emitModuleDependencies = emitModuleDependenciesFilePath. str
31603159
31613160
31623161 // The dependencies file, used to discover implicit dependencies. This file will be in Makefile format.
3163- let dependenciesFilePath = objectFileDir. join ( masterSwiftBaseName + " .d " )
3162+ let dependenciesFilePath = objectFileDir. join ( primarySwiftBaseName + " .d " )
31643163 fileMapEntry. dependencies = dependenciesFilePath. str
31653164 }
31663165
31673166 // The file used by Swift to manage intermodule dependencies.
3168- let swiftDependenciesFilePath = objectFileDir. join ( masterSwiftBaseName + " .swiftdeps " )
3167+ let swiftDependenciesFilePath = objectFileDir. join ( primarySwiftBaseName + " .swiftdeps " )
31693168 fileMapEntry. swiftDependencies = swiftDependenciesFilePath. str
31703169
31713170 // The requested compile-time values
31723171 if emitConstSideCarValues && compilationMode. compileSources {
3173- fileMapEntry. constValues = objectFileDir. join ( masterSwiftBaseName + " .swiftconstvalues " ) . str
3172+ fileMapEntry. constValues = objectFileDir. join ( primarySwiftBaseName + " .swiftconstvalues " ) . str
31743173 }
31753174
31763175 // The PCH file path for generatePCH job.
3177- let bridgingHeaderPCHPath = objectFileDir. join ( masterSwiftBaseName + " -Bridging-header.pch " )
3176+ let bridgingHeaderPCHPath = objectFileDir. join ( primarySwiftBaseName + " -Bridging-header.pch " )
31783177 fileMapEntry. pch = bridgingHeaderPCHPath. str
31793178
31803179 // Add the global entry to the map.
0 commit comments