@@ -229,7 +229,6 @@ extension Driver {
229229 try commandLine. appendLast ( . nostdimport, from: & parsedOptions)
230230 try commandLine. appendLast ( . nostdlibimport, from: & parsedOptions)
231231 try commandLine. appendLast ( . parseStdlib, from: & parsedOptions)
232- try commandLine. appendLast ( . solverMemoryThreshold, from: & parsedOptions)
233232 try commandLine. appendLast ( . valueRecursionThreshold, from: & parsedOptions)
234233 try commandLine. appendLast ( . warnSwift3ObjcInference, from: & parsedOptions)
235234 try commandLine. appendLast ( . remarkLoadingModule, from: & parsedOptions)
@@ -475,14 +474,17 @@ extension Driver {
475474 try computeCanonicalObjCHeader ( explicitModulePlanner: explicitModulePlanner)
476475 let objcHeaderFile = ( kind == . scanDependencies) ? originalObjCHeaderFile : importedObjCHeader
477476 if let importedObjCHeader = objcHeaderFile, bridgingHeaderHandling != . ignored {
477+ let importBridgingHeaderFlag : Option = importBridgingHeaderAsInternal
478+ ? . internalImportBridgingHeader
479+ : . importObjcHeader
478480 if bridgingHeaderHandling == . precompiled, let pch = precompiledObjCHeader {
479481 // For explicit module build, we directly pass the compiled pch to
480482 // swift-frontend, rather than rely on swift-frontend to locate
481483 // the pch in the pchOutputDir and can start an implicit build in case
482484 // of a lookup failure.
483485 if parsedOptions. contains ( . pchOutputDir) &&
484486 !parsedOptions. contains ( . driverExplicitModuleBuild) {
485- commandLine. appendFlag ( . importObjcHeader )
487+ commandLine. appendFlag ( importBridgingHeaderFlag )
486488 try addPathArgument ( VirtualPath . lookup ( importedObjCHeader) , to: & commandLine, remap: jobNeedPathRemap)
487489 try commandLine. appendLast ( . pchOutputDir, from: & parsedOptions)
488490 if !compilerMode. isSingleCompilation {
@@ -491,21 +493,21 @@ extension Driver {
491493 } else {
492494 // If header chaining is enabled, pass objc header through `-import-objc-header` and
493495 // PCH file through `-import-pch`. Otherwise, pass either the PCH or header through
494- // `-import-objc-header` option.
496+ // `-import-objc-header` option (or its internal variant) .
495497 if isFrontendArgSupported ( . importPch) , importedObjCHeader != originalObjCHeaderFile {
496- commandLine. appendFlag ( . importPch)
498+ commandLine. appendFlag ( importBridgingHeaderAsInternal ? . internalImportPch : . importPch)
497499 try addPathArgument ( VirtualPath . lookup ( pch) , to: & commandLine, remap: jobNeedPathRemap)
498500 if let originalHeader = originalObjCHeaderFile {
499- commandLine. appendFlag ( . importObjcHeader )
501+ commandLine. appendFlag ( importBridgingHeaderFlag )
500502 try addPathArgument ( VirtualPath . lookup ( originalHeader) , to: & commandLine, remap: jobNeedPathRemap)
501503 }
502504 } else {
503- commandLine. appendFlag ( . importObjcHeader )
505+ commandLine. appendFlag ( importBridgingHeaderFlag )
504506 try addPathArgument ( VirtualPath . lookup ( pch) , to: & commandLine, remap: jobNeedPathRemap)
505507 }
506508 }
507509 } else {
508- commandLine. appendFlag ( . importObjcHeader )
510+ commandLine. appendFlag ( importBridgingHeaderFlag )
509511 try addPathArgument ( VirtualPath . lookup ( importedObjCHeader) , to: & commandLine, remap: jobNeedPathRemap)
510512 }
511513 }
0 commit comments