@@ -259,10 +259,10 @@ public struct Driver {
259
259
/// Only present when the driver will be writing the record.
260
260
/// Only used for reading when compiling incrementally.
261
261
@_spi ( Testing) public let buildRecordInfo : BuildRecordInfo ?
262
-
262
+
263
263
/// Whether to consider incremental compilation.
264
264
let shouldAttemptIncrementalCompilation : Bool
265
-
265
+
266
266
/// Code & data for incremental compilation. Nil if not running in incremental mode.
267
267
/// Set during planning because needs the jobs to look at outputs.
268
268
@_spi ( Testing) public private( set) var incrementalCompilationState : IncrementalCompilationState ? = nil
@@ -292,7 +292,7 @@ public struct Driver {
292
292
293
293
/// Path to the dependencies file.
294
294
let dependenciesFilePath : VirtualPath . Handle ?
295
-
295
+
296
296
/// Path to the references dependencies file.
297
297
let referenceDependenciesPath : VirtualPath . Handle ?
298
298
@@ -760,7 +760,7 @@ public struct Driver {
760
760
targetInfo: frontendTargetInfo)
761
761
762
762
Self . validateSanitizerAddressUseOdrIndicatorFlag ( & parsedOptions, diagnosticEngine: diagnosticsEngine, addressSanitizerEnabled: enabledSanitizers. contains ( . address) )
763
-
763
+
764
764
Self . validateSanitizerRecoverArgValues ( & parsedOptions, diagnosticEngine: diagnosticsEngine, enabledSanitizers: enabledSanitizers)
765
765
766
766
Self . validateSanitizerCoverageArgs ( & parsedOptions,
@@ -1595,7 +1595,7 @@ extension Driver {
1595
1595
// Added for the sake of compatibility with the legacy driver.
1596
1596
try ? fileSystem. move (
1597
1597
from: absPath, to: absPath. appending ( component: absPath. basename + " ~ " ) )
1598
-
1598
+
1599
1599
guard let contents = buildRecord. encode ( diagnosticEngine: diagnosticEngine) else {
1600
1600
diagnosticEngine. emit ( . warning_could_not_write_build_record( absPath) )
1601
1601
return
@@ -1952,7 +1952,7 @@ extension Driver {
1952
1952
// FIXME: The object-file default is carried over from the existing
1953
1953
// driver, but seems odd.
1954
1954
let fileType = FileType ( rawValue: fileExtension) ?? FileType . object
1955
-
1955
+
1956
1956
if fileType == . swift {
1957
1957
let basename = inputFile. basename
1958
1958
if let originalPath = swiftFiles [ basename] {
@@ -1966,28 +1966,28 @@ extension Driver {
1966
1966
1967
1967
return TypedVirtualPath ( file: inputHandle, type: fileType)
1968
1968
}
1969
-
1969
+
1970
1970
if parsedOptions. hasArgument ( . e) {
1971
1971
if let mainPath = swiftFiles [ " main.swift " ] {
1972
1972
diagnosticsEngine. emit ( . error_two_files_same_name( basename: " main.swift " , firstPath: mainPath, secondPath: " -e " ) )
1973
1973
diagnosticsEngine. emit ( . note_explain_two_files_same_name)
1974
1974
throw ErrorDiagnostics . emitted
1975
1975
}
1976
-
1976
+
1977
1977
try withTemporaryDirectory ( dir: fileSystem. tempDirectory, removeTreeOnDeinit: false ) { absPath in
1978
1978
let filePath = VirtualPath . absolute ( absPath. appending ( component: " main.swift " ) )
1979
-
1979
+
1980
1980
try fileSystem. writeFileContents ( filePath) { file in
1981
1981
file <<< ###"#sourceLocation(file: "-e", line: 1)\###n"###
1982
1982
for option in parsedOptions. arguments ( for: . e) {
1983
1983
file <<< option. argument. asSingle <<< " \n "
1984
1984
}
1985
1985
}
1986
-
1986
+
1987
1987
paths. append ( TypedVirtualPath ( file: filePath. intern ( ) , type: . swift) )
1988
1988
}
1989
1989
}
1990
-
1990
+
1991
1991
return paths
1992
1992
}
1993
1993
@@ -2112,11 +2112,11 @@ extension Diagnostic.Message {
2112
2112
static var warn_ignore_embed_bitcode_marker : Diagnostic . Message {
2113
2113
. warning( " ignoring -embed-bitcode-marker since no object file is being generated " )
2114
2114
}
2115
-
2115
+
2116
2116
static func error_two_files_same_name( basename: String , firstPath: String , secondPath: String ) -> Diagnostic . Message {
2117
2117
. error( " filename \" \( basename) \" used twice: ' \( firstPath) ' and ' \( secondPath) ' " )
2118
2118
}
2119
-
2119
+
2120
2120
static var note_explain_two_files_same_name : Diagnostic . Message {
2121
2121
. note( " filenames are used to distinguish private declarations with the same name " )
2122
2122
}
@@ -2381,7 +2381,7 @@ extension Diagnostic.Message {
2381
2381
static var verify_debug_info_requires_debug_option : Diagnostic . Message {
2382
2382
. warning( " ignoring '-verify-debug-info'; no debug info is being generated " )
2383
2383
}
2384
-
2384
+
2385
2385
static func warning_option_requires_sanitizer( currentOption: Option , currentOptionValue: String , sanitizerRequired: Sanitizer ) -> Diagnostic . Message {
2386
2386
. warning( " option ' \( currentOption. spelling) \( currentOptionValue) ' has no effect when ' \( sanitizerRequired) ' sanitizer is disabled. Use \( Option . sanitizeEQ. spelling) \( sanitizerRequired) to enable the sanitizer " )
2387
2387
}
@@ -2562,7 +2562,7 @@ extension Driver {
2562
2562
}
2563
2563
return true
2564
2564
}
2565
-
2565
+
2566
2566
var used = [ " " ]
2567
2567
for item in aliasArgs {
2568
2568
let arg = item. argument. asSingle
@@ -2906,7 +2906,7 @@ extension Driver {
2906
2906
}
2907
2907
}
2908
2908
}
2909
-
2909
+
2910
2910
private static func validateSanitizerAddressUseOdrIndicatorFlag(
2911
2911
_ parsedOptions: inout ParsedOptions ,
2912
2912
diagnosticEngine: DiagnosticsEngine ,
@@ -2917,7 +2917,7 @@ extension Driver {
2917
2917
. warning_option_requires_sanitizer( currentOption: . sanitizeAddressUseOdrIndicator, currentOptionValue: " " , sanitizerRequired: . address) )
2918
2918
}
2919
2919
}
2920
-
2920
+
2921
2921
/// Validates the set of `-sanitize-recover={sanitizer}` arguments
2922
2922
private static func validateSanitizerRecoverArgValues(
2923
2923
_ parsedOptions: inout ParsedOptions ,
@@ -2941,14 +2941,14 @@ extension Driver {
2941
2941
. error_invalid_arg_value( arg: . sanitizeRecoverEQ, value: arg) )
2942
2942
continue
2943
2943
}
2944
-
2944
+
2945
2945
// only -sanitize-recover=address is supported
2946
2946
if sanitizer != . address {
2947
2947
diagnosticEngine. emit (
2948
2948
. error_unsupported_argument( argument: arg, option: . sanitizeRecoverEQ) )
2949
2949
continue
2950
2950
}
2951
-
2951
+
2952
2952
if !enabledSanitizers. contains ( sanitizer) {
2953
2953
diagnosticEngine. emit (
2954
2954
. warning_option_requires_sanitizer( currentOption: . sanitizeRecoverEQ, currentOptionValue: arg, sanitizerRequired: sanitizer) )
@@ -3251,7 +3251,7 @@ extension Driver {
3251
3251
outputType: type) {
3252
3252
return singleOutputPath
3253
3253
}
3254
-
3254
+
3255
3255
// Emit-module discovered dependencies are always specified as a single-output
3256
3256
// file
3257
3257
if type == . emitModuleDependencies,
0 commit comments