[PATCH] Add option to switch off putting header modules into the dependency file.

Manuel Klimek klimek at google.com
Tue Mar 17 06:42:21 PDT 2015


Hi rsmith, djasper,

http://reviews.llvm.org/D8378

Files:
  include/clang/Driver/Options.td
  lib/Driver/Tools.cpp
  test/Driver/pch-deps.c

Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -770,6 +770,8 @@
   Flags<[DriverOption]>;
 def fimplicit_modules : Flag <["-"], "fimplicit-modules">, Group<f_Group>,
   Flags<[DriverOption]>;
+def fno_module_file_deps : Flag <["-"], "fno-module-file-deps">, Group<f_Group>,
+  Flags<[DriverOption]>;
 def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group<f_Group>;
 def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group<f_Group>;
 def fno_delayed_template_parsing : Flag<["-"], "fno-delayed-template-parsing">, Group<f_Group>;
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -325,7 +325,8 @@
         A->getOption().matches(options::OPT_MD))
       CmdArgs.push_back("-sys-header-deps");
 
-    if (isa<PrecompileJobAction>(JA))
+    if (isa<PrecompileJobAction>(JA) &&
+        !Args.hasArg(options::OPT_fno_module_file_deps))
       CmdArgs.push_back("-module-file-deps");
   }
 
Index: test/Driver/pch-deps.c
===================================================================
--- test/Driver/pch-deps.c
+++ test/Driver/pch-deps.c
@@ -8,3 +8,8 @@
 // RUN: FileCheck %s -check-prefix=CHECK-NOPCH -input-file=%t
 // CHECK-NOPCH: -dependency-file
 // CHECK-NOPCH-NOT: -module-file-deps
+
+// RUN: %clang -x c-header %s -o %t.pch -MMD -MT dependencies -MF %t.d -fno-module-file-deps -### 2> %t
+// RUN: FileCheck %s -check-prefix=CHECK-EXPLICIT-NOPCH -input-file=%t
+// CHECK-EXPLICIT-NOPCH: -dependency-file
+// CHECK-EXPLICIT-NOPCH-NOT: -module-file-deps

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8378.22090.patch
Type: text/x-patch
Size: 1718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150317/acdeadf1/attachment.bin>


More information about the cfe-commits mailing list