     var moduleInputs = [TypedVirtualPath]()
     var moduleInputsFromJobOutputs = [TypedVirtualPath]()
 
+    // Passing in these functions instead of inout parameters clarifies that
+    // the code is only adding to the collections in question.
     func addJob(_ j: Job) { jobs.append(j) }
     func addJobs(_ js: [Job]) { jobs.append(contentsOf: js) }
     func addLinkerInput(_ li: TypedVirtualPath) { linkerInputs.append(li) }

    }
  }

  private mutating func linkJobIfNeeded(linkerInputs: [TypedVirtualPath]) throws -> Job? {
    if linkerOutputType != nil && !linkerInputs.isEmpty {
      return try linkJob(inputs: linkerInputs)
    }
    return nil
  }

  private  func computeDsymAndVerifyDebugInfoJobsIfNeeded(
    link: Job?, targetTriple: Triple, debugInfo: DebugInfo
  ) throws -> [Job] {
    guard let linkJob = link, targetTriple.isDarwin, debugInfo.level != nil
    else {
      return []
    }
    let dsymJob = try generateDSYMJob(inputs: linkJob.outputs)
    if !debugInfo.shouldVerify { return [dsymJob] }
    let verifyJob = try verifyDebugInfoJob(inputs: dsymJob.outputs)
    return [dsymJob, verifyJob]
  }


  /// Prescan the source files to produce a module dependency graph and turn it into a set
  /// of jobs required to build all dependencies.

        addJob: addJob,
        addLinkerInputs: addLinkerInputs)
     }
    try addLinkAndPostLinkJobs(linkerInputs: linkerInputs,
                               debugInfo: debugInfo,
                               addJob: addJob)
    return jobs
  }


