@@ -292,7 +292,9 @@ public struct Driver {
292
292
self . sdkPath = Self . computeSDKPath ( & parsedOptions, compilerMode: compilerMode, toolchain: toolchain, diagnosticsEngine: diagnosticEngine, env: env)
293
293
294
294
self . importedObjCHeader = try Self . computeImportedObjCHeader ( & parsedOptions, compilerMode: compilerMode, diagnosticEngine: diagnosticEngine)
295
- self . bridgingPrecompiledHeader = try Self . computeBridgingPrecompiledHeader ( & parsedOptions, importedObjCHeader: importedObjCHeader)
295
+ self . bridgingPrecompiledHeader = try Self . computeBridgingPrecompiledHeader ( & parsedOptions,
296
+ importedObjCHeader: importedObjCHeader,
297
+ outputFileMap: outputFileMap)
296
298
297
299
self . enabledSanitizers = try Self . parseSanitizerArgValues ( & parsedOptions, diagnosticEngine: diagnosticEngine, toolchain: toolchain, targetTriple: targetTriple)
298
300
@@ -1340,12 +1342,17 @@ extension Driver {
1340
1342
}
1341
1343
1342
1344
/// Compute the path of the generated bridging PCH for the Objective-C header.
1343
- static func computeBridgingPrecompiledHeader( _ parsedOptions: inout ParsedOptions , importedObjCHeader: VirtualPath ? ) throws -> VirtualPath ? {
1345
+ static func computeBridgingPrecompiledHeader( _ parsedOptions: inout ParsedOptions ,
1346
+ importedObjCHeader: VirtualPath ? ,
1347
+ outputFileMap: OutputFileMap ? ) throws -> VirtualPath ? {
1344
1348
guard let input = importedObjCHeader,
1345
1349
parsedOptions. hasFlag ( positive: . enableBridgingPch, negative: . disableBridgingPch, default: true ) else {
1346
1350
return nil
1347
1351
}
1348
- // FIXME: Check OutputFileMap?
1352
+
1353
+ if let outputPath = outputFileMap? . existingOutput ( inputFile: input, outputType: . pch) {
1354
+ return outputPath
1355
+ }
1349
1356
1350
1357
// FIXME: should have '-.*' at the end of the filename, similar to llvm::sys::fs::createTemporaryFile
1351
1358
let pchFileName = input. basenameWithoutExt. appendingFileTypeExtension ( . pch)
0 commit comments