clang-cl: Don't warn about overriding /MD with /MT, /Fo with another /Fo, etc.
I put in the warnings because MSVC has them, but I don't think they're very
useful.
Clang does not warn about overriding flags in general, e.g. it's perfectly
fine to have -fomit-frame-pointer followed by -fno-omit-frame-pointer.
We should focus on warning where things get confusing, such as with the
/TP and /TC options. In "clang-cl /TC a.c /TP b.cc", the user might not
realize that the /TP flag will apply to both files, and we warn about that.
Differential Revision: http://llvm-reviews.chandlerc.com/D1718
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190964 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index a728b4d..c715140 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -3724,21 +3724,9 @@
// but defining _DEBUG is sticky.
RTOptionID = options::OPT__SLASH_MTd;
- if (Arg *A = Args.getLastArg(options::OPT__SLASH_M_Group)) {
+ if (Arg *A = Args.getLastArg(options::OPT__SLASH_M_Group))
RTOptionID = A->getOption().getID();
- // Diagnose overrides.
- arg_iterator it = Args.filtered_begin(options::OPT__SLASH_M_Group);
- Arg *Previous = *it++;
- const arg_iterator ie = Args.filtered_end();
- while (it != ie) {
- const Driver &D = getToolChain().getDriver();
- D.Diag(clang::diag::warn_drv_overriding_flag_option)
- << Previous->getSpelling() << (*it)->getSpelling();
- Previous = *it++;
- }
- }
-
switch(RTOptionID) {
case options::OPT__SLASH_MD:
if (Args.hasArg(options::OPT__SLASH_LDd))