Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions Sources/SwiftDriver/Driver/Driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,25 +369,27 @@ public struct Driver {
guard let modTime = try? fileSystem
.getFileInfo($0.file).modTime else { return nil }
return ($0, modTime)
})

let outputFileMap: OutputFileMap?
// Initialize an empty output file map, which will be populated when we start creating jobs.
if let outputFileMapArg = parsedOptions.getLastArgument(.outputFileMap)?.asSingle {
do {
let path = try VirtualPath(path: outputFileMapArg)
outputFileMap = try .load(fileSystem: fileSystem, file: path, diagnosticEngine: diagnosticEngine)
} catch {
throw Error.unableToLoadOutputFileMap(outputFileMapArg)
})

do {
let outputFileMap: OutputFileMap?
// Initialize an empty output file map, which will be populated when we start creating jobs.
if let outputFileMapArg = parsedOptions.getLastArgument(.outputFileMap)?.asSingle {
do {
let path = try VirtualPath(path: outputFileMapArg)
outputFileMap = try .load(fileSystem: fileSystem, file: path, diagnosticEngine: diagnosticEngine)
} catch {
throw Error.unableToLoadOutputFileMap(outputFileMapArg)
}
} else {
outputFileMap = nil
}
} else {
outputFileMap = nil
}

if let workingDirectory = self.workingDirectory {
self.outputFileMap = outputFileMap?.resolveRelativePaths(relativeTo: workingDirectory)
} else {
self.outputFileMap = outputFileMap
if let workingDirectory = self.workingDirectory {
self.outputFileMap = outputFileMap?.resolveRelativePaths(relativeTo: workingDirectory)
} else {
self.outputFileMap = outputFileMap
}
}

self.fileListThreshold = try Self.computeFileListThreshold(&self.parsedOptions, diagnosticsEngine: diagnosticsEngine)
Expand Down