Skip to content

Commit d758e98

Browse files
committed
Args resolver: createFileList does not need the option to quote paths because it already does.
1 parent 52e7bb7 commit d758e98

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/SwiftDriver/Execution/ArgsResolver.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public final class ArgsResolver {
9999
case let .fileList(_, .list(items)):
100100
try createFileList(path: actualPath, contents: items, quotePaths: quotePaths)
101101
case let .fileList(_, .outputFileMap(map)):
102-
try createFileList(path: actualPath, outputFileMap: map, quotePaths: quotePaths)
102+
try createFileList(path: actualPath, outputFileMap: map)
103103
case .relative, .absolute, .standardInput, .standardOutput:
104104
fatalError("Not a temporary path.")
105105
}
@@ -126,7 +126,7 @@ public final class ArgsResolver {
126126
}
127127
}
128128

129-
private func createFileList(path: VirtualPath, outputFileMap: OutputFileMap, quotePaths: Bool)
129+
private func createFileList(path: VirtualPath, outputFileMap: OutputFileMap)
130130
throws {
131131
// FIXME: Need a way to support this for distributed build systems...
132132
if let absPath = path.absolutePath {
@@ -135,22 +135,22 @@ public final class ArgsResolver {
135135
// and the frontend (llvm) only seems to support implicit block format.
136136
try fileSystem.writeFileContents(absPath) { out in
137137
for (input, map) in outputFileMap.entries {
138-
out <<< quoteAndEscape(path: input, quotePaths: quotePaths) <<< ":"
138+
out <<< quoteAndEscape(path: input) <<< ":"
139139
if map.isEmpty {
140140
out <<< " {}\n"
141141
} else {
142142
out <<< "\n"
143143
for (type, output) in map {
144-
out <<< " " <<< type.name <<< ": " <<< quoteAndEscape(path: output, quotePaths: quotePaths) <<< "\n"
144+
out <<< " " <<< type.name <<< ": " <<< quoteAndEscape(path: output) <<< "\n"
145145
}
146146
}
147147
}
148148
}
149149
}
150150
}
151151

152-
private func quoteAndEscape(path: VirtualPath, quotePaths: Bool) -> String {
153-
let inputNode = Node.scalar(Node.Scalar(try! unsafeResolve(path: path, quotePaths: quotePaths),
152+
private func quoteAndEscape(path: VirtualPath) -> String {
153+
let inputNode = Node.scalar(Node.Scalar(try! unsafeResolve(path: path, quotePaths: false),
154154
Tag(.str), .doubleQuoted))
155155
// Width parameter of -1 sets preferred line-width to unlimited so that no extraneous
156156
// line-breaks will be inserted during serialization.

0 commit comments

Comments
 (0)