Skip to content

Commit 55c39c1

Browse files
authored
Merge pull request #34291 from artemcm/NeverForgetAnArgument
[Dependency Scanner] Always add NonPathCommandLine arguments from Clang scan-deps result
2 parents a253c40 + a09ae48 commit 55c39c1

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

lib/ClangImporter/ClangModuleDependencyScanner.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,15 @@ void ClangImporter::recordModuleDependencies(
245245
}
246246
}
247247

248+
// Add all args the non-path arguments required to be passed in, according
249+
// to the Clang scanner
250+
for (const auto &clangArg : clangModuleDep.NonPathCommandLine) {
251+
swiftArgs.push_back("-Xcc");
252+
swiftArgs.push_back("-Xclang");
253+
swiftArgs.push_back("-Xcc");
254+
swiftArgs.push_back(clangArg);
255+
}
256+
248257
// Swift frontend action: -emit-pcm
249258
swiftArgs.push_back("-emit-pcm");
250259
swiftArgs.push_back("-module-name");

test/ScanDependencies/Inputs/CHeaders/module.modulemap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module B {
88
export *
99
}
1010

11-
module C {
11+
module C [system] {
1212
header "C.h"
1313
export *
1414
}

test/ScanDependencies/module_deps.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ import SubE
105105
// CHECK-NEXT: "-only-use-extra-clang-opts"
106106
// CHECK-NEXT: "-Xcc"
107107
// CHECK-NEXT: "clang"
108+
// CHECK: "-fsystem-module",
109+
// CHECK-NEXT: "-emit-pcm",
110+
// CHECK-NEXT: "-module-name",
111+
// CHECK-NEXT: "C"
108112

109113
/// --------Swift module E
110114
// CHECK: "swift": "E"

0 commit comments

Comments
 (0)