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(
7575static std::vector<std::string> getClangDepScanningInvocationArguments (
7676 ASTContext &ctx,
7777 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);
8480 addSearchPathInvocationArguments (commandLineArgs, ctx);
8581
8682 auto sourceFilePos = std::find (
@@ -114,6 +110,10 @@ static std::vector<std::string> getClangDepScanningInvocationArguments(
114110 *syntaxOnlyPos = " -c" ;
115111 }
116112
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+
117117 return commandLineArgs;
118118}
119119
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