<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, May 5, 2014 at 12:27 PM, Ben Langmuir <span dir="ltr"><<a href="mailto:blangmuir@apple.com" target="_blank">blangmuir@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Richard,</div><div><br></div>I agree in principle, but I was under the impression remark wasn’t fully baked for clang diagnostics yet.  For example, the commit message says:<div>
<br><blockquote type="cite">This patch is by intention minimal in terms of parameter handling. More<br>experience and more discussions will most likely lead to further enhancements<br>in the parameter handling.</blockquote>
</div><div><br></div><div>And indeed, I gave it a spin and immediately noticed that it prints out [ -Rmodule-build ] in the diagnostics, which is actively misleading when -R is not a supported diagnostic option spelling.</div>
</div></blockquote><div><br></div><div>Yeah, we don't support the command-line interface for it yet, but that should be straightforward. That burden has basically been deferred to the first "lucky" person who wants to add a remark. Looks like that might be you? :)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><div>Ben</div></font></span><div>
<div class="h5"><div><br><div><div>On May 5, 2014, at 11:39 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">
<div class="gmail_extra"><div class="gmail_quote">On Mon, May 5, 2014 at 9:58 AM, Ben Langmuir <span dir="ltr"><<a href="mailto:blangmuir@apple.com" target="_blank">blangmuir@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: benlangmuir<br>
Date: Mon May  5 11:58:47 2014<br>
New Revision: 207975<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=207975&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=207975&view=rev</a><br>
Log:<br>
Add -Wmodule-build to make it easy to see when modules are (re)built<br>
<br>
Warning is default ignore, and not in -Wall.<br></blockquote><div><br></div><div>This seems ideally suited to be a remark rather than a warning.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Added:<br>
    cfe/trunk/test/Modules/Wmodule-build.m<br>
Modified:<br>
    cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td<br>
    cfe/trunk/lib/Frontend/CompilerInstance.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=207975&r1=207974&r2=207975&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=207975&r1=207974&r2=207975&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)<br>
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Mon May  5 11:58:47 2014<br>
@@ -167,6 +167,8 @@ def warn_module_config_macro_undef : War<br>
   InGroup<ConfigMacros>;<br>
 def note_module_def_undef_here : Note<<br>
   "macro was %select{defined|#undef'd}0 here">;<br>
+def warn_module_build : Warning<"building module '%0' as '%1'">,<br>
+  InGroup<DiagGroup<"module-build">>, DefaultIgnore;<br>
<br>
 def err_missing_vfs_overlay_file : Error<<br>
   "virtual filesystem overlay file '%0' not found">, DefaultFatal;<br>
<br>
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=207975&r1=207974&r2=207975&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=207975&r1=207974&r2=207975&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Mon May  5 11:58:47 2014<br>
@@ -1219,6 +1219,9 @@ CompilerInstance::loadModule(SourceLocat<br>
         return ModuleLoadResult();<br>
       }<br>
<br>
+      getDiagnostics().Report(ImportLoc, diag::warn_module_build)<br>
+          << ModuleName << ModuleFileName;<br>
+<br>
       // Check whether we have already attempted to build this module (but<br>
       // failed).<br>
       if (getPreprocessorOpts().FailedModules &&<br>
<br>
Added: cfe/trunk/test/Modules/Wmodule-build.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Wmodule-build.m?rev=207975&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Wmodule-build.m?rev=207975&view=auto</a><br>


==============================================================================<br>
--- cfe/trunk/test/Modules/Wmodule-build.m (added)<br>
+++ cfe/trunk/test/Modules/Wmodule-build.m Mon May  5 11:58:47 2014<br>
@@ -0,0 +1,22 @@<br>
+// REQUIRES: shell<br>
+// RUN: rm -rf %t<br>
+// RUN: mkdir %t<br>
+// RUN: echo '// A' > %t/A.h<br>
+// RUN: echo '// B' > %t/B.h<br>
+// RUN: echo 'module A { header "A.h" }' > %t/module.modulemap<br>
+// RUN: echo 'module B { header "B.h" }' >> %t/module.modulemap<br>
+<br>
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -verify \<br>
+// RUN:            -I %t -Wmodule-build<br>
+<br>
+@import A; // expected-warning{{building module 'A' as}}<br>
+@import B; // expected-warning{{building module 'B' as}}<br>
+@import A; // no diagnostic<br>
+@import B; // no diagnostic<br>
+<br>
+// RUN: echo ' ' >> %t/B.h<br>
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fsyntax-only %s -I %t \<br>
+// RUN:            -Wmodule-build 2>&1 | FileCheck %s<br>
+<br>
+// CHECK-NOT: building module 'A'<br>
+// CHECK: building module 'B'<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" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>
</blockquote></div><br></div></div></div></div></div></blockquote></div><br></div></div>