From: Daniel Dunbar Date: Thu, 16 Apr 2009 06:32:38 +0000 (+0000) Subject: Pass -fdiagnostics-show-option to clang-cc by default. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e820ee054fefe5422b4db3f681e567a8976747e;p=clang Pass -fdiagnostics-show-option to clang-cc by default. - implement -fdiagnostics-show-option git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69276 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.def b/include/clang/Driver/Options.def index 52627ecf22..bbc5901a03 100644 --- a/include/clang/Driver/Options.def +++ b/include/clang/Driver/Options.def @@ -364,6 +364,7 @@ OPTION("-fconstant-cfstrings", fconstant_cfstrings, Flag, clang_ignored_f_Group, OPTION("-fcreate-profile", fcreate_profile, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fdebug-pass-arguments", fdebug_pass_arguments, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fdebug-pass-structure", fdebug_pass_structure, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fdiagnostics-show-option", fdiagnostics_show_option, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fdollars-in-identifiers", fdollars_in_identifiers, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-feliminate-unused-debug-symbols", feliminate_unused_debug_symbols, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-femit-all-decls", femit_all_decls, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -394,6 +395,7 @@ OPTION("-fno-builtin", fno_builtin, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-caret-diagnostics", fno_caret_diagnostics, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-common", fno_common, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-constant-cfstrings", fno_constant_cfstrings, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-diagnostics-show-option", fno_diagnostics_show_option, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-eliminate-unused-debug-symbols", fno_eliminate_unused_debug_symbols, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-inline-functions", fno_inline_functions, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-inline", fno_inline, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 60bcb0ffd3..8e4abb1157 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -479,6 +479,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, D.Diag(clang::diag::warn_drv_clang_unsupported) << Args.getLastArg(options::OPT_funsigned_bitfields)->getAsString(Args); + // Enable -fdiagnostics-show-option by default. + if (Args.hasFlag(options::OPT_fdiagnostics_show_option, + options::OPT_fno_diagnostics_show_option)) + CmdArgs.push_back("-fdiagnostics-show-option"); + Args.AddLastArg(CmdArgs, options::OPT_dM); Args.AddLastArg(CmdArgs, options::OPT_dD);