@@ -34,20 +34,14 @@ extension Driver {
3434 private mutating func planStandardCompile( ) throws -> [ Job ] {
3535 var jobs = [ Job] ( )
3636
37- // If we've been asked to prebuild module dependencies, prescan the source
38- // files to produce a module dependency graph and turn it into a set
39- // of jobs required to build all dependencies.
40- // For the time being, just prints the jobs' compile commands.
37+ // If we've been asked to prebuild module dependencies,
38+ // for the time being, just print the jobs' compile commands.
4139 if parsedOptions. contains ( . driverPrintModuleDependenciesJobs) {
42- let moduleDependencyGraph = try computeModuleDependencyGraph ( )
40+ let modulePrebuildJobs = try generateExplicitModuleBuildJobs ( )
4341 let forceResponseFiles = parsedOptions. contains ( . driverForceResponseFiles)
44- if let dependencyGraph = moduleDependencyGraph {
45- let modulePrebuildJobs =
46- try planExplicitModuleDependenciesCompile ( dependencyGraph: dependencyGraph)
47- for job in modulePrebuildJobs {
48- try Self . printJob ( job, resolver: try ArgsResolver ( ) ,
49- forceResponseFiles: forceResponseFiles)
50- }
42+ for job in modulePrebuildJobs {
43+ try Self . printJob ( job, resolver: try ArgsResolver ( ) ,
44+ forceResponseFiles: forceResponseFiles)
5145 }
5246 }
5347
@@ -216,6 +210,18 @@ extension Driver {
216210 return jobs
217211 }
218212
213+ /// Prescan the source files to produce a module dependency graph and turn it into a set
214+ /// of jobs required to build all dependencies.
215+ public mutating func generateExplicitModuleBuildJobs( ) throws -> [ Job ] {
216+ let moduleDependencyGraph = try computeModuleDependencyGraph ( )
217+ if let dependencyGraph = moduleDependencyGraph {
218+ let modulePrebuildJobs =
219+ try planExplicitModuleDependenciesCompile ( dependencyGraph: dependencyGraph)
220+ return modulePrebuildJobs
221+ }
222+ return [ ]
223+ }
224+
219225 /// Create a job if needed for simple requests that can be immediately
220226 /// forwarded to the frontend.
221227 public mutating func immediateForwardingJob( ) throws -> Job ? {
0 commit comments