Driver: Add two special groups of "whitelisted" options which we know
clang doesn't support, and don't want to warn are unused. Eventually
these should disappear.
Here is a more readable list than is in the diff:
W options: -Wall, -Wcast-align, -Wchar-align, -Wchar-subscripts,
-Werror, -Wextra, -Winline, -Wint-to-pointer-cast, -Wmissing-braces,
-Wmost, -Wnested-externs, -Wno-format-y2k, -Wno-four-char-constants,
-Wno-missing-field-initializers, -Wno-trigraphs, -Wno-unknown-pragmas,
-Wno-unused-parameter, -Wparentheses, -Wpointer-arith,
-Wpointer-to-int-cast, -Wreturn-type, -Wshorten-64-to-32, -Wswitch,
-Wunused-function, -Wunused-label, -Wunused-value, -Wunused-variable,
-Wwrite-strings.
f options: -fasm-blocks, -fmessage-length=.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67549 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index dac9a6e..bd8404b 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -334,6 +334,18 @@
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath(C, "clang").c_str());
Dest.addCommand(new Command(Exec, CmdArgs));
+
+ // Claim some arguments which clang doesn't support, but we don't
+ // care to warn the user about.
+
+ // FIXME: Use iterator.
+ for (ArgList::const_iterator
+ it = Args.begin(), ie = Args.end(); it != ie; ++it) {
+ const Arg *A = *it;
+ if (A->getOption().matches(options::OPT_clang_ignored_W_Group) ||
+ A->getOption().matches(options::OPT_clang_ignored_f_Group))
+ A->claim();
+ }
}
void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,