diff --git a/clang/include/clang/Driver/Options.def b/clang/include/clang/Driver/Options.def index 250899673d6b5f3765f918e88c8106f4700ff52a..a5f3ee5ea18532d5779ff6d1432d907807556176 100644 --- a/clang/include/clang/Driver/Options.def +++ b/clang/include/clang/Driver/Options.def @@ -99,6 +99,13 @@ OPTION("", u_Group, Group, INVALID, INVALID, "", 0) OPTION("", pedantic_Group, Group, INVALID, INVALID, "", 0) +// Temporary groups for clang options which we know we don't support, +// but don't want to verbosely warn the user about. +OPTION("", clang_ignored_W_Group, Group, W_Group, + INVALID, "", 0) +OPTION("", clang_ignored_f_Group, Group, f_Group, + INVALID, "", 0) + ////////// // Options @@ -255,18 +262,45 @@ OPTION("-T", T, JoinedOrSeparate, T_Group, INVALID, "", 0) OPTION("-U", U, JoinedOrSeparate, INVALID, INVALID, "", 0) OPTION("-V", V, JoinedOrSeparate, INVALID, INVALID, "u", 0) OPTION("-Wa,", Wa_COMMA, CommaJoined, INVALID, INVALID, "", 0) -OPTION("-Wall", Wall, Flag, W_Group, INVALID, "", 0) +OPTION("-Wall", Wall, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wcast-align", Wcast_align, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wchar-align", Wchar_align, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wchar-subscripts", Wchar_subscripts, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Werror", Werror, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wextra", Wextra, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wfloat-equal", Wfloat_equal, Flag, clang_W_Group, INVALID, "", 0) OPTION("-Wimplicit-function-declaration", Wimplicit_function_declaration, Flag, clang_W_Group, INVALID, "", 0) +OPTION("-Winline", Winline, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wint-to-pointer-cast", Wint_to_pointer_cast, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wl,", Wl_COMMA, CommaJoined, INVALID, INVALID, "li", 0) +OPTION("-Wmissing-braces", Wmissing_braces, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wmost", Wmost, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wnested-externs", Wnested_externs, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wno-format-nonliteral", Wno_format_nonliteral, Flag, clang_W_Group, INVALID, "", 0) +OPTION("-Wno-format-y2k", Wno_format_y2k, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wno-four-char-constants", Wno_four_char_constants, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wno-missing-field-initializers", Wno_missing_field_initializers, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wno-nonportable-cfstrings", Wno_nonportable_cfstrings, Joined, W_Group, INVALID, "", 0) OPTION("-Wno-strict-selector-match", Wno_strict_selector_match, Flag, clang_W_Group, INVALID, "", 0) +OPTION("-Wno-trigraphs", Wno_trigraphs, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wno-unknown-pragmas", Wno_unknown_pragmas, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wno-unused-parameter", Wno_unused_parameter, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wnonportable-cfstrings", Wnonportable_cfstrings, Joined, W_Group, INVALID, "", 0) OPTION("-Wp,", Wp_COMMA, CommaJoined, INVALID, INVALID, "", 0) +OPTION("-Wparentheses", Wparentheses, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wpointer-arith", Wpointer_arith, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wpointer-to-int-cast", Wpointer_to_int_cast, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wreadonly-setter-attrs", Wreadonly_setter_attrs, Flag, clang_W_Group, INVALID, "", 0) +OPTION("-Wreturn-type", Wreturn_type, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wshorten-64-to-32", Wshorten_64_to_32, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wswitch", Wswitch, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wundef", Wundef, Flag, clang_W_Group, INVALID, "", 0) +OPTION("-Wunused-function", Wunused_function, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wunused-label", Wunused_label, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-Wunused-macros", Wunused_macros, Flag, clang_W_Group, INVALID, "", 0) +OPTION("-Wunused-value", Wunused_value, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wunused-variable", Wunused_variable, Flag, clang_ignored_W_Group, INVALID, "", 0) +OPTION("-Wwrite-strings", Wwrite_strings, Flag, clang_ignored_W_Group, INVALID, "", 0) OPTION("-W", W, Joined, W_Group, INVALID, "", 0) OPTION("-Xanalyzer", Xanalyzer, Separate, INVALID, INVALID, "", 0) OPTION("-Xarch_", Xarch__, JoinedAndSeparate, INVALID, INVALID, "", 0) @@ -313,6 +347,7 @@ OPTION("-e", e, JoinedOrSeparate, INVALID, INVALID, "", 0) OPTION("-fPIC", fPIC, Flag, f_Group, INVALID, "", 0) OPTION("-fPIE", fPIE, Flag, f_Group, INVALID, "", 0) OPTION("-fapple-kext", fapple_kext, Flag, f_Group, INVALID, "", 0) +OPTION("-fasm-blocks", fasm_blocks, Flag, clang_ignored_f_Group, INVALID, "", 0) OPTION("-fastcp", fastcp, Flag, f_Group, INVALID, "", 0) OPTION("-fastf", fastf, Flag, f_Group, INVALID, "", 0) OPTION("-fast", fast, Flag, f_Group, INVALID, "", 0) @@ -332,13 +367,14 @@ OPTION("-fexceptions", fexceptions, Flag, clang_f_Group, INVALID, "", 0) OPTION("-fextdirs=", fextdirs_EQ, Joined, f_Group, INVALID, "", 0) OPTION("-ffreestanding", ffreestanding, Flag, clang_f_Group, INVALID, "", 0) OPTION("-fgnu-runtime", fgnu_runtime, Flag, clang_f_Group, INVALID, "", 0) -OPTION("-filelist", filelist, Separate, INVALID, INVALID, "l", 0) OPTION("-fheinous-gnu-extensions", fheinous_gnu_extensions, Flag, INVALID, INVALID, "", 0) +OPTION("-filelist", filelist, Separate, INVALID, INVALID, "l", 0) OPTION("-findirect-virtual-calls", findirect_virtual_calls, Flag, f_Group, INVALID, "", 0) OPTION("-flat_namespace", flat__namespace, Flag, INVALID, INVALID, "", 0) OPTION("-flax-vector-conversions", flax_vector_conversions, Flag, clang_f_Group, INVALID, "", 0) OPTION("-flimited-precision=", flimited_precision_EQ, Joined, f_Group, INVALID, "", 0) OPTION("-fmath-errno", fmath_errno, Flag, f_Group, INVALID, "", 0) +OPTION("-fmessage-length=", fmessage_length_EQ, Joined, clang_ignored_f_Group, INVALID, "", 0) OPTION("-fms-extensions", fms_extensions, Flag, clang_f_Group, INVALID, "", 0) OPTION("-fmudflapth", fmudflapth, Flag, f_Group, INVALID, "", 0) OPTION("-fmudflap", fmudflap, Flag, f_Group, INVALID, "", 0) diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index dac9a6e365242f12554663613c2fcd52c18ae8f0..bd8404b784ab5d715c3243839a3c32f7b19c328d 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -334,6 +334,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, 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,