Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 9b51993

Browse files
committed
[Modules] Use -skip-unused-modulemap-deps by default
This defaults dependency file generation to use -skip-unused-modulemap-deps It should allow build systems dependend on .d files to only take into consideration module maps that are used. rdar://problem/38394973 (cherry picked from commit 0ba15a4)
1 parent 16cfd7f commit 9b51993

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
10431043
}
10441044
CmdArgs.push_back("-dependency-file");
10451045
CmdArgs.push_back(DepFile);
1046+
CmdArgs.push_back("-skip-unused-modulemap-deps");
10461047

10471048
// Add a default target if one wasn't specified.
10481049
if (!Args.hasArg(options::OPT_MT) && !Args.hasArg(options::OPT_MQ)) {
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
// RUN: rm -rf %t.cache %t.d
1+
// RUN: rm -rf %t.cache %t.d %t.cmd
22
// RUN: %clang_cc1 -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.cache -dependency-file %t.d -MT dependencies -I%S/Inputs/dependency-skip-unused/x -I%S/Inputs/dependency-skip-unused/y -I%S/Inputs/dependency-skip-unused -skip-unused-modulemap-deps %s
33
// RUN: FileCheck %s < %t.d
44
// CHECK-NOT: dependency-skip-unused{{.}}x{{.}}module.modulemap
55
// CHECK-NOT: dependency-skip-unused{{.}}y{{.}}module.modulemap
66

7+
// RUN: %clang -fsyntax-only -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.cache -MMD -MT dependencies -MF %t.d -I%S/Inputs/dependency-skip-unused/x -I%S/Inputs/dependency-skip-unused/y -I%S/Inputs/dependency-skip-unused %s -### 2>&1 | FileCheck -check-prefix=CC1_INV %s
8+
// CC1_INV: -skip-unused-modulemap-deps
9+
710
@import A;

0 commit comments

Comments
 (0)