@@ -3036,21 +3036,9 @@ extension Driver {
30363036
30373037 // Emit-module discovered dependencies are always specified as a single-output
30383038 // file
3039- if type == . emitModuleDependencies {
3040- if let path = outputFileMap? . existingOutputForSingleInput ( outputType: type) {
3041- return path
3042- }
3043-
3044- // If an explicit path is not provided by the output file map, attempt to
3045- // synthesize a path from the master swift dependency path. This is
3046- // important as we may other emit this file at the location where the
3047- // driver was invoked, which is normally the root of the package.
3048- if let path = outputFileMap? . existingOutputForSingleInput ( outputType: . swiftDeps) {
3049- return VirtualPath . lookup ( path)
3050- . parentDirectory
3051- . appending ( component: " \( moduleName) . \( type. rawValue) " )
3052- . intern ( )
3053- }
3039+ if type == . emitModuleDependencies,
3040+ let path = outputFileMap? . existingOutputForSingleInput ( outputType: type) {
3041+ return path
30543042 }
30553043
30563044 // If there is an output argument, derive the name from there.
@@ -3068,6 +3056,16 @@ extension Driver {
30683056 . intern ( )
30693057 }
30703058
3059+ // If an explicit path is not provided by the output file map, attempt to
3060+ // synthesize a path from the master swift dependency path. This is
3061+ // important as we may otherwise emit this file at the location where the
3062+ // driver was invoked, which is normally the root of the package.
3063+ if let path = outputFileMap? . existingOutputForSingleInput ( outputType: . swiftDeps) {
3064+ return VirtualPath . lookup ( path)
3065+ . parentDirectory
3066+ . appending ( component: " \( moduleName) . \( type. rawValue) " )
3067+ . intern ( )
3068+ }
30713069 return try VirtualPath . intern ( path: moduleName. appendingFileTypeExtension ( type) )
30723070 }
30733071
0 commit comments