[PATCH] D32341: Fix a bug that warnings generated with -M or -MM flags
Yuka Takahashi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 27 16:08:23 PDT 2017
yamaguchi updated this revision to Diff 97013.
yamaguchi added a comment.
show warnings with -M and -MD
https://reviews.llvm.org/D32341
Files:
lib/Driver/ToolChains/Clang.cpp
test/Driver/m_and_mm.c
Index: test/Driver/m_and_mm.c
===================================================================
--- test/Driver/m_and_mm.c
+++ test/Driver/m_and_mm.c
@@ -1,3 +1,7 @@
// RUN: %clang -### \
// RUN: -M -MM %s 2> %t
// RUN: not grep '"-sys-header-deps"' %t
+
+#warning "This warning shouldn't show up with -M and -MM"
+// RUN: %clang -M -MM %s 2> %t
+// RUN: not grep "warning" %t
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -980,6 +980,9 @@
DepTarget = Args.MakeArgString(llvm::sys::path::filename(P));
}
+ if (!A->getOption().matches(options::OPT_MD) && !A->getOption().matches(options::OPT_MMD)) {
+ CmdArgs.push_back("-w");
+ }
CmdArgs.push_back("-MT");
SmallString<128> Quoted;
QuoteTarget(DepTarget, Quoted);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32341.97013.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170427/73acd4d0/attachment-0001.bin>
More information about the cfe-commits
mailing list