   }
 
   override func start(_ engine: LLTaskBuildEngine) {
+    // Requests all compilation jobs to be done
     engine.taskNeedsInput(ExecuteAllCompilationJobsRule.RuleKey(), inputID: allCompilationId)
   }
 
   override func provideValue(_ engine: LLTaskBuildEngine, inputID: Int, value: Value) {
     do {
       let subtaskSuccess = try DriverBuildValue(value).success
+      // After all compilation jobs are done, we can schedule post-compilation jobs,
+      // including merge module and linking jobs.
       if inputID == allCompilationId && !context.primaryIndices.isEmpty && subtaskSuccess {
         context.postCompileIndices.forEach {
           engine.taskNeedsInput(ExecuteJobRule.RuleKey(index: $0), inputID: $0)

  }
}

class ExecuteAllCompilationJobsRule: LLBuildRule {
  struct RuleKey: LLBuildKey {
    typealias BuildValue = DriverBuildValue

  override func provideValue(_ engine: LLTaskBuildEngine, inputID: Int, value: Value) {
    do {
      let buildSuccess = try DriverBuildValue(value).success
      // For each finished job, ask the incremental build oracle for additional
      // jobs to be scheduled and request them as the additional inputs for this
      // rule.
      if buildSuccess && !context.isBuildCancelled {
        try context.getIncrementalJobIndices(finishedJob: inputID).forEach {
          engine.taskNeedsInput(ExecuteJobRule.RuleKey(index: $0), inputID: $0)
