Skip to content

Commit 12e8f17

Browse files
committed
[Explicit Module Builds] Adapt to Clang dependency scanner changes
As of swiftlang/swift#60882 and swiftlang/swift#61303, emit-pcm will accept clang frontend arguments with '-Xcc', instead of clang driver arguments.
1 parent effef46 commit 12e8f17

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT
243243
commandLine.appendFlags("-emit-pcm", "-module-name", moduleId.moduleName,
244244
"-o", targetEncodedModulePath.description)
245245

246-
// Fixup "-o -Xcc -Xclang -Xcc '<replace-me>'"
246+
// Fixup "-o -Xcc '<replace-me>'"
247247
if let outputIndex = commandLine.firstIndex(of: .flag("<replace-me>")) {
248248
commandLine[outputIndex] = .path(VirtualPath.lookup(targetEncodedModulePath))
249249
}
@@ -275,8 +275,8 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT
275275
commandLine: inout [Job.ArgTemplate]) throws {
276276
// Prohibit the frontend from implicitly building textual modules into binary modules.
277277
commandLine.appendFlags("-disable-implicit-swift-modules",
278-
"-Xcc", "-Xclang", "-Xcc", "-fno-implicit-modules",
279-
"-Xcc", "-Xclang", "-Xcc", "-fno-implicit-module-maps")
278+
"-Xcc", "-fno-implicit-modules",
279+
"-Xcc", "-fno-implicit-module-maps")
280280
var swiftDependencyArtifacts: [SwiftModuleArtifactInfo] = []
281281
var clangDependencyArtifacts: [ClangModuleArtifactInfo] = []
282282
try addModuleDependencies(moduleId: moduleId, pcmArgs: pcmArgs,
@@ -308,14 +308,14 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT
308308
if let existingIndex = commandLine.firstIndex(of: .flag("-fmodule-file=" + moduleArtifactInfo.moduleName + "=<replace-me>")) {
309309
commandLine[existingIndex] = .flag("-fmodule-file=\(moduleArtifactInfo.moduleName)=\(clangModulePath.file.description)")
310310
} else {
311-
commandLine.appendFlags("-Xcc", "-Xclang", "-Xcc",
311+
commandLine.appendFlags("-Xcc",
312312
"-fmodule-file=\(moduleArtifactInfo.moduleName)=\(clangModulePath.file.description)")
313313
}
314314

315315
let clangModuleMapPath =
316316
TypedVirtualPath(file: moduleArtifactInfo.moduleMapPath.path,
317317
type: .clangModuleMap)
318-
commandLine.appendFlags("-Xcc", "-Xclang", "-Xcc",
318+
commandLine.appendFlags("-Xcc",
319319
"-fmodule-map-file=\(clangModuleMapPath.file.description)")
320320
inputs.append(clangModulePath)
321321
inputs.append(clangModuleMapPath)

0 commit comments

Comments
 (0)