File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,8 @@ static void addSearchPathInvocationArguments(
75
75
static std::vector<std::string> getClangDepScanningInvocationArguments (
76
76
ASTContext &ctx,
77
77
Optional<StringRef> sourceFileName = None) {
78
- std::vector<std::string> commandLineArgs;
79
-
80
- // Form the basic command line.
81
- commandLineArgs.push_back (" clang" );
82
- importer::getNormalInvocationArguments (commandLineArgs, ctx);
83
- importer::addCommonInvocationArguments (commandLineArgs, ctx);
78
+ std::vector<std::string> commandLineArgs =
79
+ ClangImporter::getClangArguments (ctx);
84
80
addSearchPathInvocationArguments (commandLineArgs, ctx);
85
81
86
82
auto sourceFilePos = std::find (
@@ -114,6 +110,10 @@ static std::vector<std::string> getClangDepScanningInvocationArguments(
114
110
*syntaxOnlyPos = " -c" ;
115
111
}
116
112
113
+ // The Clang modules produced by ClangImporter are always embedded in an
114
+ // ObjectFilePCHContainer and contain -gmodules debug info.
115
+ commandLineArgs.push_back (" -gmodules" );
116
+
117
117
return commandLineArgs;
118
118
}
119
119
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %empty-directory(%t/module-cache)
3
+ // RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -target %target-cpu-apple-macosx10.14
4
+ // RUN: %FileCheck %s < %t/deps.json
5
+
6
+ import X
7
+
8
+ // CHECK: "clang": "X"
9
+ // CHECK: "clang": "X"
10
+ // CHECK: "commandLine": [
11
+ // CHECK-DAG: "-fmodule-format=obj"
12
+ // CHECK-DAG: "-dwarf-ext-refs"
You can’t perform that action at this time.
0 commit comments