Skip to content

Commit 3191ab2

Browse files
committed
Remove trailing whitespaces
1 parent 353940d commit 3191ab2

21 files changed

+180
-180
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public struct Driver {
4646
case subcommandPassedToDriver
4747
case relativeFrontendPath(String)
4848
}
49-
49+
5050
/// The set of environment variables that are visible to the driver and
5151
/// processes it launches. This is a hook for testing; in actual use
5252
/// it should be identical to the real environment.
@@ -441,7 +441,7 @@ extension Driver {
441441
var isEscaping = false
442442
// Indicates if we are currently parsing quoted text.
443443
var quoted = false
444-
444+
445445
for char in line {
446446
// Backslash escapes to the next character.
447447
if char == #"\"#, !isEscaping {
@@ -480,7 +480,7 @@ extension Driver {
480480
return content.split { $0 == "\n" || $0 == "\r\n" }
481481
.flatMap { tokenizeResponseFileLine($0) }
482482
}
483-
483+
484484
/// Recursively expands the response files.
485485
/// - Parameter visitedResponseFiles: Set containing visited response files to detect recursive parsing.
486486
private static func expandResponseFiles(
@@ -1251,7 +1251,7 @@ extension Driver {
12511251
// This value will fail the isSwiftIdentifier test below.
12521252
moduleName = ""
12531253
}
1254-
1254+
12551255
func fallbackOrDiagnose(_ error: Diagnostic.Message) {
12561256
// FIXME: Current driver notes that this is a "fallback module name".
12571257
if compilerOutputType == nil || maybeBuildingExecutable(&parsedOptions, linkerOutputType: linkerOutputType) {
@@ -1330,7 +1330,7 @@ extension Driver {
13301330
sdkPath = try? toolchain.defaultSDKPath()?.pathString
13311331
}
13321332
}
1333-
1333+
13341334
// An empty string explicitly clears the SDK.
13351335
if sdkPath == "" {
13361336
sdkPath = nil
@@ -1445,7 +1445,7 @@ extension Driver {
14451445
#else
14461446
static let defaultToolchainType: Toolchain.Type = GenericUnixToolchain.self
14471447
#endif
1448-
1448+
14491449
static func computeToolchain(
14501450
_ explicitTarget: Triple?,
14511451
diagnosticsEngine: DiagnosticsEngine,

Sources/SwiftDriver/Driver/DriverKind.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ extension DriverKind {
7070
return "Swift Module Wrapper"
7171
}
7272
}
73-
73+
7474
public var seeAlsoHelpMessage: String? {
7575
switch self {
7676
case .interactive:

Sources/SwiftDriver/Execution/JobExecutor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public final class JobExecutor {
119119

120120
/// The resolver for argument template.
121121
let argsResolver: ArgsResolver
122-
122+
123123
/// The environment variables.
124124
let env: [String: String]
125125

Sources/SwiftDriver/Jobs/DarwinToolchain+LinkerSupport.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ extension DarwinToolchain {
116116
targetTriple: Triple
117117
) {
118118
// FIXME: Properly handle deployment targets.
119-
119+
120120
let flag: String
121-
121+
122122
switch targetTriple.darwinPlatform! {
123123
case .iOS(.device):
124124
flag = "-iphoneos_version_min"
@@ -135,11 +135,11 @@ extension DarwinToolchain {
135135
case .watchOS(.simulator):
136136
flag = "-watchos_simulator_version_min"
137137
}
138-
138+
139139
commandLine.appendFlag(flag)
140140
commandLine.appendFlag(targetTriple.version().description)
141141
}
142-
142+
143143
private func addArgsToLinkARCLite(
144144
to commandLine: inout [Job.ArgTemplate],
145145
parsedOptions: inout ParsedOptions,
@@ -215,7 +215,7 @@ extension DarwinToolchain {
215215
commandLine.appendFlag(.F)
216216
commandLine.appendPath(try VirtualPath(path: opt.argument.asSingle))
217217
}
218-
218+
219219
// Linking sanitizers will add rpaths, which might negatively interact when
220220
// other rpaths are involved, so we should make sure we add the rpaths after
221221
// all user-specified rpaths.

Sources/SwiftDriver/Jobs/GeneratePCHJob.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ extension Driver {
1717
mutating func generatePCHJob(input: TypedVirtualPath, output: TypedVirtualPath) throws -> Job {
1818
var inputs = [TypedVirtualPath]()
1919
var outputs = [TypedVirtualPath]()
20-
20+
2121
var commandLine: [Job.ArgTemplate] = swiftCompilerPrefixArgs.map { Job.ArgTemplate.flag($0) }
2222

2323
commandLine.appendFlag("-frontend")
24-
24+
2525
try addCommonFrontendOptions(
2626
commandLine: &commandLine, bridgingHeaderHandling: .parsed)
27-
27+
2828
try commandLine.appendLast(.indexStorePath, from: &parsedOptions)
2929

3030
// TODO: Should this just be pch output with extension changed?
@@ -52,15 +52,15 @@ extension Driver {
5252
try commandLine.appendLast(.indexStorePath, from: &parsedOptions)
5353

5454
commandLine.appendFlag(.emitPch)
55-
55+
5656
if parsedOptions.hasArgument(.pchOutputDir) {
5757
try commandLine.appendLast(.pchOutputDir, from: &parsedOptions)
5858
} else {
5959
commandLine.appendFlag(.o)
6060
commandLine.appendPath(output.file)
6161
}
6262
outputs.append(output)
63-
63+
6464
return Job(
6565
kind: .generatePCH,
6666
tool: .absolute(try toolchain.getToolPath(.swiftCompiler)),

Sources/SwiftDriver/Jobs/Job.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public struct Job: Codable, Equatable, Hashable {
5656

5757
/// The outputs produced by the job.
5858
public var outputs: [TypedVirtualPath]
59-
59+
6060
/// Any extra environment variables which should be set while running the job.
6161
public var extraEnvironment: [String: String]
6262

Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ extension DarwinToolchain {
172172
commandLine.appendFlag(.L)
173173
commandLine.appendPath(path)
174174
}
175-
175+
176176
let rpaths = StdlibRpathRule(
177177
parsedOptions: &parsedOptions,
178178
targetTriple: targetTriple
@@ -182,21 +182,21 @@ extension DarwinToolchain {
182182
commandLine.appendPath(path)
183183
}
184184
}
185-
185+
186186
/// Represents the rpaths we need to add in order to find the
187187
/// desired standard library at runtime.
188188
fileprivate enum StdlibRpathRule {
189189
/// Add a set of rpaths that will allow the compiler resource directory
190190
/// to override Swift-in-the-OS dylibs.
191191
case toolchain
192-
192+
193193
/// Add an rpath that will search Swift-in-the-OS dylibs, but not
194194
/// compiler resource directory dylibs.
195195
case os
196196

197197
/// Do not add any rpaths at all.
198198
case none
199-
199+
200200
/// Determines the appropriate rule for the
201201
init(parsedOptions: inout ParsedOptions, targetTriple: Triple) {
202202
if parsedOptions.hasFlag(
@@ -244,7 +244,7 @@ extension DarwinToolchain {
244244
self = .os
245245
}
246246
}
247-
247+
248248
func paths(runtimeLibraryPaths: [AbsolutePath]) -> [AbsolutePath] {
249249
switch self {
250250
case .toolchain:

Sources/SwiftDriver/Options/Option.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// Attributes that describe where and how the option is used.
1313
public struct OptionAttributes: OptionSet, Hashable {
1414
public let rawValue: UInt
15-
15+
1616
public init(rawValue: UInt) {
1717
self.rawValue = rawValue
1818
}

Sources/SwiftDriver/Options/OptionTable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extension OptionTable {
6363
let rightPadding = String(
6464
repeating: " ",
6565
count: maxDisplayNameLength - displayName.count)
66-
66+
6767
print(" \(displayName)\(rightPadding) \(helpText)")
6868
} else {
6969
print(" \(displayName)")

Sources/SwiftDriver/Toolchains/DarwinToolchain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public final class DarwinToolchain: Toolchain {
1919

2020
/// Doubles as path cache and point for overriding normal lookup
2121
private var toolPaths = [Tool: AbsolutePath]()
22-
22+
2323
public init(env: [String: String]) {
2424
self.env = env
2525
}
26-
26+
2727
/// Retrieve the absolute path for a given tool.
2828
public func getToolPath(_ tool: Tool) throws -> AbsolutePath {
2929
// Check the cache

Sources/SwiftDriver/Toolchains/Toolchain.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public enum Tool {
2727
/// and other tools required to build Swift code.
2828
public protocol Toolchain {
2929
init(env: [String: String])
30-
30+
3131
var env: [String: String] { get }
32-
32+
3333
var searchPaths: [AbsolutePath] { get }
34-
34+
3535
/// Retrieve the absolute path to a particular tool.
3636
func getToolPath(_ tool: Tool) throws -> AbsolutePath
3737

@@ -76,14 +76,14 @@ extension Toolchain {
7676
public var searchPaths: [AbsolutePath] {
7777
getEnvSearchPaths(pathString: env["PATH"], currentWorkingDirectory: localFileSystem.currentWorkingDirectory)
7878
}
79-
79+
8080
public func swiftCompilerVersion() throws -> String {
8181
try Process.checkNonZeroExit(
8282
args: getToolPath(.swiftCompiler).pathString, "-version",
8383
environment: env
8484
).split(separator: "\n").first.map(String.init) ?? ""
8585
}
86-
86+
8787
/// Returns the target triple string for the current host.
8888
public func hostTargetTriple() throws -> Triple {
8989
let triple = try Process.checkNonZeroExit(
@@ -92,34 +92,34 @@ extension Toolchain {
9292
).spm_chomp()
9393
return Triple(triple)
9494
}
95-
95+
9696
/// Returns the `executablePath`'s directory.
9797
public var executableDir: AbsolutePath {
9898
guard let path = Bundle.main.executablePath else {
9999
fatalError("Could not find executable path.")
100100
}
101101
return AbsolutePath(path).parentDirectory
102102
}
103-
103+
104104
/// Looks for `SWIFT_DRIVER_TOOLNAME_EXEC` in the `env` property.
105105
/// - Returns: Environment variable value, if any.
106106
func envVar(forExecutable toolName: String) -> String? {
107107
return env[envVarName(for: toolName)]
108108
}
109-
109+
110110
/// - Returns: String in the form of: `SWIFT_DRIVER_TOOLNAME_EXEC`
111111
private func envVarName(for toolName: String) -> String {
112112
return "SWIFT_DRIVER_\(toolName.uppercased())_EXEC"
113113
}
114-
114+
115115
/// Use this property only for testing purposes, for example,
116116
/// to enable cross-compiling tests that depends on macOS tooling such as `dsymutil`.
117117
///
118118
/// Returns true if `SWIFT_DRIVER_TESTS_ENABLE_EXEC_PATH_FALLBACK` is set to `1`.
119119
private var fallbackToExecutableDefaultPath: Bool {
120120
env["SWIFT_DRIVER_TESTS_ENABLE_EXEC_PATH_FALLBACK"] == "1"
121121
}
122-
122+
123123
/// Looks for the executable in the `SWIFT_DRIVER_TOOLNAME_EXEC` environment variable, if found nothing,
124124
/// looks in the `executableDir`, `xcrunFind` or in the `searchPaths`.
125125
/// - Parameter executable: executable to look for [i.e. `swift`].
@@ -138,13 +138,13 @@ extension Toolchain {
138138
throw ToolchainError.unableToFind(tool: executable)
139139
}
140140
}
141-
141+
142142
private func xcrunFind(executable: String) throws -> AbsolutePath {
143143
let xcrun = "xcrun"
144144
guard lookupExecutablePath(filename: xcrun, searchPaths: searchPaths) != nil else {
145145
throw ToolchainError.unableToFind(tool: xcrun)
146146
}
147-
147+
148148
let path = try Process.checkNonZeroExit(
149149
arguments: [xcrun, "-sdk", "macosx", "--find", executable],
150150
environment: env

Sources/SwiftDriver/Utilities/PredictableRandomNumberGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public struct PredictableRandomNumberGenerator: RandomNumberGenerator {
2828
z = (z ^ (z &>> 27)) &* 0x94d049bb133111eb
2929
return z ^ (z &>> 31)
3030
}
31-
31+
3232
var initState = seed
3333
state = (initNext(&initState), initNext(&initState),
3434
initNext(&initState), initNext(&initState))

Sources/SwiftDriver/Utilities/RelativePathAdditions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension RelativePath {
2222

2323
return basename
2424
}
25-
25+
2626
/// Retrieve the basename of the relative path without any extensions,
2727
/// even if there are several, and without any leading dots. Roughly
2828
/// equivalent to the regex `/[^.]+/`.
@@ -42,12 +42,12 @@ extension AbsolutePath {
4242

4343
fileprivate func firstBasename(of name: String) -> String {
4444
var copy = name[...]
45-
45+
4646
// Remove leading dots, as in dotfiles.
4747
if let i = copy.firstIndex(where: { $0 != "." }) {
4848
copy.removeSubrange(..<i)
4949
}
50-
50+
5151
// Truncate at the first (obviously non-leading) dot.
5252
if let i = copy.firstIndex(of: ".") {
5353
copy.removeSubrange(i...)

0 commit comments

Comments
 (0)