Skip to content

Commit f0ca4cb

Browse files
authored
Formatting: remove trailing whitespaces (#1370)
Trailing whitespaces can trigger linter and formatting warnings and can also introduce formatting churn in unrelated PRs. Let's clean those up in a single commit.
1 parent 79a9365 commit f0ca4cb

File tree

63 files changed

+300
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+300
-300
lines changed

Sources/CSwiftScan/include/swiftscan_header.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ typedef struct {
9898
(*swiftscan_module_info_get_direct_dependencies)(swiftscan_dependency_info_t);
9999
swiftscan_module_details_t
100100
(*swiftscan_module_info_get_details)(swiftscan_dependency_info_t);
101-
101+
102102
//=== Dependency Module Info Details Functions ----------------------------===//
103103
swiftscan_dependency_info_kind_t
104104
(*swiftscan_module_detail_get_kind)(swiftscan_module_details_t);
@@ -222,7 +222,7 @@ typedef struct {
222222
swiftscan_string_set_t *
223223
(*swiftscan_compiler_supported_features_query)(void);
224224

225-
//=== Scanner Functions ---------------------------------------------------===//
225+
//=== Scanner Functions ---------------------------------------------------===//
226226
swiftscan_scanner_t (*swiftscan_scanner_create)(void);
227227
void (*swiftscan_scanner_dispose)(swiftscan_scanner_t);
228228
swiftscan_dependency_graph_t
@@ -233,7 +233,7 @@ typedef struct {
233233
swiftscan_scan_invocation_t);
234234
swiftscan_import_set_t
235235
(*swiftscan_import_set_create)(swiftscan_scanner_t, swiftscan_scan_invocation_t);
236-
236+
237237
//=== Scanner Diagnostics -------------------------------------------------===//
238238
swiftscan_diagnostic_set_t*
239239
(*swiftscan_scanner_diagnostics_query)(swiftscan_scanner_t);

Sources/SwiftDriver/Driver/Driver.swift

+20-20
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ public struct Driver {
259259
/// Only present when the driver will be writing the record.
260260
/// Only used for reading when compiling incrementally.
261261
@_spi(Testing) public let buildRecordInfo: BuildRecordInfo?
262-
262+
263263
/// Whether to consider incremental compilation.
264264
let shouldAttemptIncrementalCompilation: Bool
265-
265+
266266
/// Code & data for incremental compilation. Nil if not running in incremental mode.
267267
/// Set during planning because needs the jobs to look at outputs.
268268
@_spi(Testing) public private(set) var incrementalCompilationState: IncrementalCompilationState? = nil
@@ -292,7 +292,7 @@ public struct Driver {
292292

293293
/// Path to the dependencies file.
294294
let dependenciesFilePath: VirtualPath.Handle?
295-
295+
296296
/// Path to the references dependencies file.
297297
let referenceDependenciesPath: VirtualPath.Handle?
298298

@@ -760,7 +760,7 @@ public struct Driver {
760760
targetInfo: frontendTargetInfo)
761761

762762
Self.validateSanitizerAddressUseOdrIndicatorFlag(&parsedOptions, diagnosticEngine: diagnosticsEngine, addressSanitizerEnabled: enabledSanitizers.contains(.address))
763-
763+
764764
Self.validateSanitizerRecoverArgValues(&parsedOptions, diagnosticEngine: diagnosticsEngine, enabledSanitizers: enabledSanitizers)
765765

766766
Self.validateSanitizerCoverageArgs(&parsedOptions,
@@ -1595,7 +1595,7 @@ extension Driver {
15951595
// Added for the sake of compatibility with the legacy driver.
15961596
try? fileSystem.move(
15971597
from: absPath, to: absPath.appending(component: absPath.basename + "~"))
1598-
1598+
15991599
guard let contents = buildRecord.encode(diagnosticEngine: diagnosticEngine) else {
16001600
diagnosticEngine.emit(.warning_could_not_write_build_record(absPath))
16011601
return
@@ -1952,7 +1952,7 @@ extension Driver {
19521952
// FIXME: The object-file default is carried over from the existing
19531953
// driver, but seems odd.
19541954
let fileType = FileType(rawValue: fileExtension) ?? FileType.object
1955-
1955+
19561956
if fileType == .swift {
19571957
let basename = inputFile.basename
19581958
if let originalPath = swiftFiles[basename] {
@@ -1966,28 +1966,28 @@ extension Driver {
19661966

19671967
return TypedVirtualPath(file: inputHandle, type: fileType)
19681968
}
1969-
1969+
19701970
if parsedOptions.hasArgument(.e) {
19711971
if let mainPath = swiftFiles["main.swift"] {
19721972
diagnosticsEngine.emit(.error_two_files_same_name(basename: "main.swift", firstPath: mainPath, secondPath: "-e"))
19731973
diagnosticsEngine.emit(.note_explain_two_files_same_name)
19741974
throw ErrorDiagnostics.emitted
19751975
}
1976-
1976+
19771977
try withTemporaryDirectory(dir: fileSystem.tempDirectory, removeTreeOnDeinit: false) { absPath in
19781978
let filePath = VirtualPath.absolute(absPath.appending(component: "main.swift"))
1979-
1979+
19801980
try fileSystem.writeFileContents(filePath) { file in
19811981
file <<< ###"#sourceLocation(file: "-e", line: 1)\###n"###
19821982
for option in parsedOptions.arguments(for: .e) {
19831983
file <<< option.argument.asSingle <<< "\n"
19841984
}
19851985
}
1986-
1986+
19871987
paths.append(TypedVirtualPath(file: filePath.intern(), type: .swift))
19881988
}
19891989
}
1990-
1990+
19911991
return paths
19921992
}
19931993

@@ -2112,11 +2112,11 @@ extension Diagnostic.Message {
21122112
static var warn_ignore_embed_bitcode_marker: Diagnostic.Message {
21132113
.warning("ignoring -embed-bitcode-marker since no object file is being generated")
21142114
}
2115-
2115+
21162116
static func error_two_files_same_name(basename: String, firstPath: String, secondPath: String) -> Diagnostic.Message {
21172117
.error("filename \"\(basename)\" used twice: '\(firstPath)' and '\(secondPath)'")
21182118
}
2119-
2119+
21202120
static var note_explain_two_files_same_name: Diagnostic.Message {
21212121
.note("filenames are used to distinguish private declarations with the same name")
21222122
}
@@ -2381,7 +2381,7 @@ extension Diagnostic.Message {
23812381
static var verify_debug_info_requires_debug_option: Diagnostic.Message {
23822382
.warning("ignoring '-verify-debug-info'; no debug info is being generated")
23832383
}
2384-
2384+
23852385
static func warning_option_requires_sanitizer(currentOption: Option, currentOptionValue: String, sanitizerRequired: Sanitizer) -> Diagnostic.Message {
23862386
.warning("option '\(currentOption.spelling)\(currentOptionValue)' has no effect when '\(sanitizerRequired)' sanitizer is disabled. Use \(Option.sanitizeEQ.spelling)\(sanitizerRequired) to enable the sanitizer")
23872387
}
@@ -2562,7 +2562,7 @@ extension Driver {
25622562
}
25632563
return true
25642564
}
2565-
2565+
25662566
var used = [""]
25672567
for item in aliasArgs {
25682568
let arg = item.argument.asSingle
@@ -2906,7 +2906,7 @@ extension Driver {
29062906
}
29072907
}
29082908
}
2909-
2909+
29102910
private static func validateSanitizerAddressUseOdrIndicatorFlag(
29112911
_ parsedOptions: inout ParsedOptions,
29122912
diagnosticEngine: DiagnosticsEngine,
@@ -2917,7 +2917,7 @@ extension Driver {
29172917
.warning_option_requires_sanitizer(currentOption: .sanitizeAddressUseOdrIndicator, currentOptionValue: "", sanitizerRequired: .address))
29182918
}
29192919
}
2920-
2920+
29212921
/// Validates the set of `-sanitize-recover={sanitizer}` arguments
29222922
private static func validateSanitizerRecoverArgValues(
29232923
_ parsedOptions: inout ParsedOptions,
@@ -2941,14 +2941,14 @@ extension Driver {
29412941
.error_invalid_arg_value(arg: .sanitizeRecoverEQ, value: arg))
29422942
continue
29432943
}
2944-
2944+
29452945
// only -sanitize-recover=address is supported
29462946
if sanitizer != .address {
29472947
diagnosticEngine.emit(
29482948
.error_unsupported_argument(argument: arg, option: .sanitizeRecoverEQ))
29492949
continue
29502950
}
2951-
2951+
29522952
if !enabledSanitizers.contains(sanitizer) {
29532953
diagnosticEngine.emit(
29542954
.warning_option_requires_sanitizer(currentOption: .sanitizeRecoverEQ, currentOptionValue: arg, sanitizerRequired: sanitizer))
@@ -3251,7 +3251,7 @@ extension Driver {
32513251
outputType: type) {
32523252
return singleOutputPath
32533253
}
3254-
3254+
32553255
// Emit-module discovered dependencies are always specified as a single-output
32563256
// file
32573257
if type == .emitModuleDependencies,

Sources/SwiftDriver/Execution/ArgsResolver.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public final class ArgsResolver {
198198
guard useResponseFiles != .disabled else {
199199
return false
200200
}
201-
201+
202202
let forceResponseFiles = useResponseFiles == .forced
203203
if forceResponseFiles ||
204204
(job.supportsResponseFiles && !commandLineFitsWithinSystemLimits(path: resolvedArguments[0], args: resolvedArguments)) {

Sources/SwiftDriver/Execution/DriverExecutor.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public protocol DriverExecutor {
2626
func execute(job: Job,
2727
forceResponseFiles: Bool,
2828
recordedInputModificationDates: [TypedVirtualPath: TimePoint]) throws -> ProcessResult
29-
29+
3030
/// Execute multiple jobs, tracking job status using the provided execution delegate.
3131
/// Pass in the `IncrementalCompilationState` to allow for incremental compilation.
3232
func execute(workload: DriverExecutorWorkload,
@@ -90,7 +90,7 @@ extension DriverExecutor {
9090
let result = try execute(job: job,
9191
forceResponseFiles: forceResponseFiles,
9292
recordedInputModificationDates: recordedInputModificationDates)
93-
93+
9494
if (result.exitStatus != .terminated(code: EXIT_SUCCESS)) {
9595
let returnCode = Self.computeReturnCode(exitStatus: result.exitStatus)
9696
throw JobExecutionError.jobFailedWithNonzeroExitCode(returnCode, try result.utf8stderrOutput())
@@ -141,7 +141,7 @@ extension DriverExecutor {
141141
public protocol JobExecutionDelegate {
142142
/// Called when a job starts executing.
143143
func jobStarted(job: Job, arguments: [String], pid: Int)
144-
144+
145145
/// Called when a job finished.
146146
func jobFinished(job: Job, result: ProcessResult, pid: Int)
147147

Sources/SwiftDriver/ExplicitModuleBuilds/InterModuleDependencies/InterModuleDependencyGraph.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ internal extension InterModuleDependencyGraph {
306306

307307
public struct InterModuleDependencyImports: Codable {
308308
public var imports: [String]
309-
309+
310310
public init(imports: [String], moduleAliases: [String: String]? = nil) {
311311
var realImports = [String]()
312312
if let aliases = moduleAliases {

Sources/SwiftDriver/ExplicitModuleBuilds/InterModuleDependencies/InterModuleDependencyOracle.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ public class InterModuleDependencyOracle {
129129
}
130130
return swiftScan.hasBinarySwiftModuleIsFramework
131131
}
132-
132+
133133
@_spi(Testing) public func supportsScannerDiagnostics() throws -> Bool {
134134
guard let swiftScan = swiftScanLibInstance else {
135135
fatalError("Attempting to reset scanner cache with no scanner instance.")
136136
}
137137
return swiftScan.supportsScannerDiagnostics()
138138
}
139-
139+
140140
@_spi(Testing) public func getScannerDiagnostics() throws -> [ScannerDiagnosticPayload]? {
141141
guard let swiftScan = swiftScanLibInstance else {
142142
fatalError("Attempting to reset scanner cache with no scanner instance.")

Sources/SwiftDriver/ExplicitModuleBuilds/ModuleDependencyScanning.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public extension Driver {
210210
let scannerJob = try dependencyScanningJob()
211211
let forceResponseFiles = parsedOptions.hasArgument(.driverForceResponseFiles)
212212
let dependencyGraph: InterModuleDependencyGraph
213-
213+
214214
if parsedOptions.contains(.v) {
215215
let arguments: [String] = try executor.resolver.resolveArgumentList(for: scannerJob,
216216
useResponseFiles: .disabled)

Sources/SwiftDriver/IncrementalCompilation/Bitcode/Bits.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extension Bits {
5959
init(buffer: Bits) {
6060
self.buffer = buffer
6161
}
62-
62+
6363
init(buffer: ByteString) {
6464
self.init(buffer: Bits(buffer: buffer))
6565
}

Sources/SwiftDriver/IncrementalCompilation/Bitcode/BitstreamWriter.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
///
3434
/// Next, identify the kinds of records needed in the format and assign them
3535
/// unique, stable identifiers. For example:
36-
///
36+
///
3737
/// ```
3838
/// enum DiagnosticRecordID: UInt8 {
3939
/// case version = 1
@@ -525,7 +525,7 @@ extension BitstreamWriter {
525525
self.write(0 as UInt8, width: 8)
526526
}
527527
}
528-
528+
529529

530530
/// Writes the blockinfo block and allows emitting abbreviations
531531
/// and records in it.

Sources/SwiftDriver/IncrementalCompilation/DependencyGraphDotFileWriter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public struct DependencyGraphDotFileWriter {
2929
let basename = file.file.basename
3030
write(sfdg, basename: basename, internedStringTable: internedStringTable)
3131
}
32-
32+
3333
mutating func write(_ mdg: ModuleDependencyGraph) {
3434
write(mdg, basename: Self.moduleDependencyGraphBasename,
3535
internedStringTable: mdg.internedStringTable)

Sources/SwiftDriver/IncrementalCompilation/DependencyKey.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ import Dispatch
2727
self.fileName = fileName
2828
self.fileNameString = fileName.lookup(in: t)
2929
}
30-
30+
3131
static var dummy: Self {
3232
MockIncrementalCompilationSynchronizer.withInternedStringTable { t in
3333
return Self(fileName: ".".intern(in: t), t)
3434
}
3535
}
36-
36+
3737
public static func ==(lhs: ExternalDependency, rhs: ExternalDependency) -> Bool {
3838
lhs.fileName == rhs.fileName
3939
}
@@ -381,16 +381,16 @@ public func isInIncreasingOrder(_ lhs: DependencyKey.Designator,
381381
let (.nominal(ln), .nominal(rn)),
382382
let (.potentialMember(ln), .potentialMember(rn)):
383383
return f(ln) < f(rn)
384-
384+
385385
case let (.externalDepend(ld), .externalDepend(rd)):
386386
return ld < rd
387-
387+
388388
case let (.member(lc, ln), .member(rc, rn)):
389389
return lc == rc ? f(ln) < f(rn) : f(lc) < f(rc)
390-
390+
391391
default: break
392392
}
393-
393+
394394
/// Preserves the ordering that obtained before interned strings were introduced.
395395
func kindOrdering(_ d: DependencyKey.Designator) -> Int {
396396
switch d {

0 commit comments

Comments
 (0)