@@ -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
@@ -1365,9 +1334,9 @@ public struct Driver {
1365
1334
}
1366
1335
1367
1336
public mutating func planBuild( ) throws -> [ Job ] {
1368
- let ( jobs, incrementalCompilationState, intermoduleDependencyGraph ) = try planPossiblyIncrementalBuild ( )
1337
+ let ( jobs, incrementalCompilationState, explicitModulePlanner ) = try planPossiblyIncrementalBuild ( )
1369
1338
self . incrementalCompilationState = incrementalCompilationState
1370
- self . intermoduleDependencyGraph = intermoduleDependencyGraph
1339
+ self . intermoduleDependencyGraph = explicitModulePlanner ? . dependencyGraph
1371
1340
return jobs
1372
1341
}
1373
1342
}
@@ -1756,11 +1725,9 @@ extension Diagnostic.Message {
1756
1725
}
1757
1726
1758
1727
extension Driver {
1759
- func explainModuleDependency( _ explainModuleName: String , allPaths: Bool ) throws {
1760
- guard let dependencyPlanner = explicitDependencyBuildPlanner else {
1761
- fatalError ( " Cannot explain dependency without Explicit Build Planner " )
1762
- }
1763
- guard let dependencyPaths = try dependencyPlanner. explainDependency ( explainModuleName, allPaths: allPaths) else {
1728
+ func explainModuleDependency( _ explainModuleName: String , allPaths: Bool ,
1729
+ moduleDependencyGraph: InterModuleDependencyGraph ) throws {
1730
+ guard let dependencyPaths = try moduleDependencyGraph. explainDependency ( explainModuleName, allPaths: allPaths) else {
1764
1731
diagnosticEngine. emit ( . remark( " No such module dependency found: ' \( explainModuleName) ' " ) )
1765
1732
return
1766
1733
}
@@ -1832,13 +1799,6 @@ extension Driver {
1832
1799
return
1833
1800
}
1834
1801
1835
- // If we're only supposed to explain a dependency on a given module, do so now.
1836
- if let explainModuleName = parsedOptions. getLastArgument ( . explainModuleDependencyDetailed) {
1837
- try explainModuleDependency ( explainModuleName. asSingle, allPaths: true )
1838
- } else if let explainModuleNameDetailed = parsedOptions. getLastArgument ( . explainModuleDependency) {
1839
- try explainModuleDependency ( explainModuleNameDetailed. asSingle, allPaths: false )
1840
- }
1841
-
1842
1802
if parsedOptions. contains ( . driverPrintOutputFileMap) {
1843
1803
if let outputFileMap = self . outputFileMap {
1844
1804
stderrStream. send ( outputFileMap. description)
@@ -2031,7 +1991,7 @@ extension Driver {
2031
1991
2032
1992
// Put bridging header as first input if we have it
2033
1993
let allInputs : [ TypedVirtualPath ]
2034
- if let objcHeader = importedObjCHeader , bridgingPrecompiledHeader != nil {
1994
+ if let objcHeader = originalObjCHeaderFile {
2035
1995
allInputs = [ TypedVirtualPath ( file: objcHeader, type: . objcHeader) ] + inputFiles
2036
1996
} else {
2037
1997
allInputs = inputFiles
@@ -2056,10 +2016,7 @@ extension Driver {
2056
2016
// All input action IDs for this action.
2057
2017
var inputIds = [ UInt] ( )
2058
2018
2059
- var jobInputs = job. primaryInputs. isEmpty ? job. inputs : job. primaryInputs
2060
- if let pchPath = bridgingPrecompiledHeader, job. kind == . compile {
2061
- jobInputs. append ( TypedVirtualPath ( file: pchPath, type: . pch) )
2062
- }
2019
+ let jobInputs = job. primaryInputs. isEmpty ? job. inputs : job. primaryInputs
2063
2020
// Collect input job IDs.
2064
2021
for input in jobInputs {
2065
2022
if let id = inputIdMap [ input] {
0 commit comments