<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Thu, Mar 19, 2015 at 5:00 AM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: klimek<br>
Date: Thu Mar 19 07:00:22 2015<br>
New Revision: 232721<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232721&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=232721&view=rev</a><br>
Log:<br>
Add option to switch off putting header modules into the dependency file.<br></blockquote><div><br></div></span><div>Why? It is not correct to use a .pch file after the corresponding .pcm file has been rebuilt. And why do you want a switch to turn on adding implicit module files to the .d file? (I think the right behavior here is that explicit modules are always listed, and implicit modules are never listed except when building a .pch file.)</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modified:<br>
cfe/trunk/include/clang/Driver/Options.td<br>
cfe/trunk/lib/Driver/Tools.cpp<br>
cfe/trunk/test/Driver/pch-deps.c<br>
<br>
Modified: cfe/trunk/include/clang/Driver/Options.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=232721&r1=232720&r2=232721&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=232721&r1=232720&r2=232721&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Driver/Options.td (original)<br>
+++ cfe/trunk/include/clang/Driver/Options.td Thu Mar 19 07:00:22 2015<br>
@@ -772,6 +772,10 @@ def fno_modules_strict_decluse : Flag <[<br>
Flags<[DriverOption]>;<br>
def fimplicit_modules : Flag <["-"], "fimplicit-modules">, Group<f_Group>,<br>
Flags<[DriverOption]>;<br>
+def fmodule_file_deps : Flag <["-"], "fmodule-file-deps">, Group<f_Group>,<br>
+ Flags<[DriverOption]>;<br>
+def fno_module_file_deps : Flag <["-"], "fno-module-file-deps">, Group<f_Group>,<br>
+ Flags<[DriverOption]>;<br>
def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group<f_Group>;<br>
def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group<f_Group>;<br>
def fno_delayed_template_parsing : Flag<["-"], "fno-delayed-template-parsing">, Group<f_Group>;<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=232721&r1=232720&r2=232721&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=232721&r1=232720&r2=232721&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Mar 19 07:00:22 2015<br>
@@ -324,8 +324,9 @@ void Clang::AddPreprocessingOptions(Comp<br>
if (A->getOption().matches(options::OPT_M) ||<br>
A->getOption().matches(options::OPT_MD))<br>
CmdArgs.push_back("-sys-header-deps");<br>
-<br>
- if (isa<PrecompileJobAction>(JA))<br>
+ if ((isa<PrecompileJobAction>(JA) &&<br>
+ !Args.hasArg(options::OPT_fno_module_file_deps)) ||<br>
+ Args.hasArg(options::OPT_fmodule_file_deps))<br>
CmdArgs.push_back("-module-file-deps");<br>
}<br>
<br>
<br>
Modified: cfe/trunk/test/Driver/pch-deps.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/pch-deps.c?rev=232721&r1=232720&r2=232721&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/pch-deps.c?rev=232721&r1=232720&r2=232721&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/pch-deps.c (original)<br>
+++ cfe/trunk/test/Driver/pch-deps.c Thu Mar 19 07:00:22 2015<br>
@@ -8,3 +8,14 @@<br>
// RUN: FileCheck %s -check-prefix=CHECK-NOPCH -input-file=%t<br>
// CHECK-NOPCH: -dependency-file<br>
// CHECK-NOPCH-NOT: -module-file-deps<br>
+<br>
+// RUN: %clang -x c-header %s -o %t.pch -MMD -MT dependencies -MF %t.d \<br>
+// RUN: -fno-module-file-deps -### 2> %t<br>
+// RUN: FileCheck %s -check-prefix=CHECK-EXPLICIT -input-file=%t<br>
+// CHECK-EXPLICIT: -dependency-file<br>
+// CHECK-EXPLICIT-NOT: -module-file-deps<br>
+<br>
+// RUN: %clang -x c++ %s -o %t.o -MMD -MT dependencies -MF %t.d -fmodule-file-deps -### 2> %t<br>
+// RUN: FileCheck %s -check-prefix=CHECK-EXPLICIT-NOPCH -input-file=%t<br>
+// CHECK-EXPLICIT-NOPCH: -dependency-file<br>
+// CHECK-EXPLICIT-NOPCH: -module-file-deps<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></div><br></div></div>
</div><br></div>