@@ -341,38 +341,15 @@ public struct Driver {
341
341
/// Original ObjC Header passed from command-line
342
342
let originalObjCHeaderFile : VirtualPath . Handle ?
343
343
344
-
345
344
/// Enable bridging header chaining.
346
345
let bridgingHeaderChaining : Bool
347
346
348
- /// The path to the imported Objective-C header.
349
- lazy var importedObjCHeader : VirtualPath . Handle ? = {
350
- assert ( explicitDependencyBuildPlanner != nil ||
351
- !parsedOptions. hasArgument ( . driverExplicitModuleBuild) ||
352
- !inputFiles. contains { $0. type == . swift } ,
353
- " should not be queried before scanning " )
354
- let chainedBridgingHeader = try ? explicitDependencyBuildPlanner? . getChainedBridgingHeaderFile ( )
355
- return try ? computeImportedObjCHeader ( & parsedOptions, compilerMode: compilerMode,
356
- chainedBridgingHeader: chainedBridgingHeader) ?? originalObjCHeaderFile
357
- } ( )
358
-
359
347
/// The directory to emit PCH file.
360
348
lazy var bridgingPrecompiledHeaderOutputDir : VirtualPath ? = {
361
349
return try ? computePrecompiledBridgingHeaderDir ( & parsedOptions,
362
350
compilerMode: compilerMode)
363
351
} ( )
364
352
365
- /// The path to the pch for the imported Objective-C header.
366
- lazy var bridgingPrecompiledHeader : VirtualPath . Handle ? = {
367
- let contextHash = try ? explicitDependencyBuildPlanner? . getMainModuleContextHash ( )
368
- return computeBridgingPrecompiledHeader ( & parsedOptions,
369
- compilerMode: compilerMode,
370
- importedObjCHeader: importedObjCHeader,
371
- outputFileMap: outputFileMap,
372
- outputDirectory: bridgingPrecompiledHeaderOutputDir,
373
- contextHash: contextHash)
374
- } ( )
375
-
376
353
/// Path to the dependencies file.
377
354
let dependenciesFilePath : VirtualPath . Handle ?
378
355
@@ -621,14 +598,6 @@ public struct Driver {
621
598
/// The mode the API digester should run in.
622
599
let digesterMode : DigesterMode
623
600
624
- // FIXME: We should soon be able to remove this from being in the Driver's state.
625
- // Its only remaining use outside of actual dependency build planning is in
626
- // command-line input option generation for the explicit main module compile job.
627
- /// Planner for constructing module build jobs using Explicit Module Builds.
628
- /// Constructed during the planning phase only when all module dependencies will be prebuilt and treated
629
- /// as explicit inputs by the various compilation jobs.
630
- @_spi ( Testing) public var explicitDependencyBuildPlanner : ExplicitDependencyBuildPlanner ? = nil
631
-
632
601
/// A reference to the instance of libSwiftScan which is shared with the driver's
633
602
/// `InterModuleDependencyOracle`, but also used for non-scanning tasks, such as target info
634
603
/// and supported compiler feature queries
@@ -1383,9 +1352,9 @@ public struct Driver {
1383
1352
}
1384
1353
1385
1354
public mutating func planBuild( ) throws -> [ Job ] {
1386
- let ( jobs, incrementalCompilationState, intermoduleDependencyGraph ) = try planPossiblyIncrementalBuild ( )
1355
+ let ( jobs, incrementalCompilationState, explicitModulePlanner ) = try planPossiblyIncrementalBuild ( )
1387
1356
self . incrementalCompilationState = incrementalCompilationState
1388
- self . intermoduleDependencyGraph = intermoduleDependencyGraph
1357
+ self . intermoduleDependencyGraph = explicitModulePlanner ? . dependencyGraph
1389
1358
return jobs
1390
1359
}
1391
1360
}
@@ -1774,11 +1743,9 @@ extension Diagnostic.Message {
1774
1743
}
1775
1744
1776
1745
extension Driver {
1777
- func explainModuleDependency( _ explainModuleName: String , allPaths: Bool ) throws {
1778
- guard let dependencyPlanner = explicitDependencyBuildPlanner else {
1779
- fatalError ( " Cannot explain dependency without Explicit Build Planner " )
1780
- }
1781
- guard let dependencyPaths = try dependencyPlanner. explainDependency ( explainModuleName, allPaths: allPaths) else {
1746
+ func explainModuleDependency( _ explainModuleName: String , allPaths: Bool ,
1747
+ moduleDependencyGraph: InterModuleDependencyGraph ) throws {
1748
+ guard let dependencyPaths = try moduleDependencyGraph. explainDependency ( explainModuleName, allPaths: allPaths) else {
1782
1749
diagnosticEngine. emit ( . remark( " No such module dependency found: ' \( explainModuleName) ' " ) )
1783
1750
return
1784
1751
}
@@ -1848,13 +1815,6 @@ extension Driver {
1848
1815
return
1849
1816
}
1850
1817
1851
- // If we're only supposed to explain a dependency on a given module, do so now.
1852
- if let explainModuleName = parsedOptions. getLastArgument ( . explainModuleDependencyDetailed) {
1853
- try explainModuleDependency ( explainModuleName. asSingle, allPaths: true )
1854
- } else if let explainModuleNameDetailed = parsedOptions. getLastArgument ( . explainModuleDependency) {
1855
- try explainModuleDependency ( explainModuleNameDetailed. asSingle, allPaths: false )
1856
- }
1857
-
1858
1818
if parsedOptions. contains ( . driverPrintOutputFileMap) {
1859
1819
if let outputFileMap = self . outputFileMap {
1860
1820
stderrStream. send ( outputFileMap. description)
@@ -2047,7 +2007,7 @@ extension Driver {
2047
2007
2048
2008
// Put bridging header as first input if we have it
2049
2009
let allInputs : [ TypedVirtualPath ]
2050
- if let objcHeader = importedObjCHeader , bridgingPrecompiledHeader != nil {
2010
+ if let objcHeader = originalObjCHeaderFile {
2051
2011
allInputs = [ TypedVirtualPath ( file: objcHeader, type: . objcHeader) ] + inputFiles
2052
2012
} else {
2053
2013
allInputs = inputFiles
@@ -2072,10 +2032,7 @@ extension Driver {
2072
2032
// All input action IDs for this action.
2073
2033
var inputIds = [ UInt] ( )
2074
2034
2075
- var jobInputs = job. primaryInputs. isEmpty ? job. inputs : job. primaryInputs
2076
- if let pchPath = bridgingPrecompiledHeader, job. kind == . compile {
2077
- jobInputs. append ( TypedVirtualPath ( file: pchPath, type: . pch) )
2078
- }
2035
+ let jobInputs = job. primaryInputs. isEmpty ? job. inputs : job. primaryInputs
2079
2036
// Collect input job IDs.
2080
2037
for input in jobInputs {
2081
2038
if let id = inputIdMap [ input] {
0 commit comments