From 9cb7d9ba94769d77b077b813536d35f27a9918f1 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Wed, 18 Sep 2013 22:26:39 +0000 Subject: 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 llvm-svn: 190964 --- clang/lib/Driver/Driver.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'clang/lib/Driver/Driver.cpp') diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 7ad09accd8c..a2cf06a20cd 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -284,26 +284,6 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const { return DAL; } -/// \brief Check whether there are multiple instances of OptionID in Args, and -/// if so, issue a diagnostics about it. -static void DiagnoseOptionOverride(const Driver &D, const DerivedArgList &Args, - unsigned OptionID) { - assert(Args.hasArg(OptionID)); - - arg_iterator it = Args.filtered_begin(OptionID); - arg_iterator ie = Args.filtered_end(); - Arg *Previous = *it; - ++it; - - while (it != ie) { - D.Diag(clang::diag::warn_drv_overriding_joined_option) - << Previous->getSpelling() << Previous->getValue() - << (*it)->getSpelling() << (*it)->getValue(); - Previous = *it; - ++it; - } -} - Compilation *Driver::BuildCompilation(ArrayRef ArgList) { llvm::PrettyStackTraceString CrashInfo("Compilation construction"); @@ -1158,7 +1138,6 @@ void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args, // Diagnose misuse of /Fo. if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fo)) { - DiagnoseOptionOverride(*this, Args, options::OPT__SLASH_Fo); StringRef V = A->getValue(); if (V.empty()) { // It has to have a value. @@ -1174,7 +1153,6 @@ void Driver::BuildActions(const ToolChain &TC, DerivedArgList &Args, // Diagnose misuse of /Fe. if (Arg *A = Args.getLastArg(options::OPT__SLASH_Fe)) { - DiagnoseOptionOverride(*this, Args, options::OPT__SLASH_Fe); if (A->getValue()[0] == '\0') { // It has to have a value. Diag(clang::diag::err_drv_missing_argument) << A->getSpelling() << 1; -- cgit v1.2.3