diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -417,6 +417,47 @@ } // Flags = [CC1Option, NoDriverOption] +// Diagnostic Options + +def fdiagnostics_parseable_fixits : Flag<["-"], "fdiagnostics-parseable-fixits">, Group, + Flags<[CoreOption, CC1Option]>, HelpText<"Print fix-its in machine parseable form">, + MarshallingInfoFlag<"DiagnosticOpts->ShowParseableFixits", "false">; +def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group, + Flags<[CoreOption, CC1Option]>, HelpText<"Use ANSI escape codes for diagnostics">, + MarshallingInfoFlag<"DiagnosticOpts->UseANSIEscapeCodes", "false">; +def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">, + Group, Flags<[CC1Option]>, + HelpText<"Print source range spans in numeric form">, + MarshallingInfoFlag<"DiagnosticOpts->ShowSourceRanges", "false">; +def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">, + Group, Flags<[CC1Option]>, + HelpText<"Print a template comparison tree for differing templates">, + MarshallingInfoFlag<"DiagnosticOpts->ShowTemplateTree", "false">; +def fno_elide_type : Flag<["-"], "fno-elide-type">, Group, + Flags<[CC1Option]>, + HelpText<"Do not elide types when printing diagnostics">, + MarshallingInfoFlag<"DiagnosticOpts->ElideType", "true">, IsNegative; +def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group, + Flags<[CC1Option, CoreOption]>, HelpText<"Print absolute paths in diagnostics">, + MarshallingInfoFlag<"DiagnosticOpts->AbsolutePath", "false">; +def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group, Flags<[CC1Option]>, + MarshallingInfoFlag<"DiagnosticOpts->PedanticErrors", "false">; +def pedantic : Flag<["-", "--"], "pedantic">, Group, Flags<[CC1Option]>, + MarshallingInfoFlag<"DiagnosticOpts->Pedantic", "false">; +def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">, Flags<[CC1Option]>, + MarshallingInfoFlag<"DiagnosticOpts->IgnoreWarnings", "false">; + +let Flags = [CC1Option, NoDriverOption] in { + +def fno_diagnostics_use_presumed_location : Flag<["-"], "fno-diagnostics-use-presumed-location">, + HelpText<"Ignore #line directives when displaying diagnostic locations">, + MarshallingInfoFlag<"DiagnosticOpts->ShowPresumedLoc", "true">, IsNegative; +def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">, + HelpText<"Silence ObjC rewriting warnings">, + MarshallingInfoFlag<"DiagnosticOpts->NoRewriteMacros", "false">; + +} // Flags = [CC1Option, NoDriverOption] + // Standard Options def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[DriverOption, CoreOption]>, @@ -909,9 +950,6 @@ def fdiagnostics_color : Flag<["-"], "fdiagnostics-color">, Group, Flags<[CoreOption, DriverOption]>; def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group; -def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group, - Flags<[CoreOption, CC1Option]>, HelpText<"Use ANSI escape codes for diagnostics">, - MarshallingInfoFlag<"DiagnosticOpts->UseANSIEscapeCodes", "false">; def fcomment_block_commands : CommaJoined<["-"], "fcomment-block-commands=">, Group, Flags<[CC1Option]>, HelpText<"Treat each comma separated argument in as a documentation comment block command">, MetaVarName<"">; @@ -952,11 +990,6 @@ def fdepfile_entry : Joined<["-"], "fdepfile-entry=">, Group, Flags<[CC1Option]>; def fdiagnostics_fixit_info : Flag<["-"], "fdiagnostics-fixit-info">, Group; -def fdiagnostics_parseable_fixits : Flag<["-"], "fdiagnostics-parseable-fixits">, Group, - Flags<[CoreOption, CC1Option]>, HelpText<"Print fix-its in machine parseable form">; -def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">, - Group, Flags<[CC1Option]>, - HelpText<"Print source range spans in numeric form">; def fdiagnostics_show_hotness : Flag<["-"], "fdiagnostics-show-hotness">, Group, Flags<[CC1Option]>, HelpText<"Enable profile hotness information in diagnostic line">; def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">, @@ -968,9 +1001,6 @@ Group, Flags<[CC1Option]>, HelpText<"Display include stacks for diagnostic notes">; def fdiagnostics_format_EQ : Joined<["-"], "fdiagnostics-format=">, Group; def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">, Group; -def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">, - Group, Flags<[CC1Option]>, - HelpText<"Print a template comparison tree for differing templates">; def fdeclspec : Flag<["-"], "fdeclspec">, Group, HelpText<"Allow __declspec as a keyword">, Flags<[CC1Option]>; def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">, Group, @@ -983,9 +1013,6 @@ def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group; defm dwarf_directory_asm : OptOutFFlag<"dwarf-directory-asm", "", "">; def felide_constructors : Flag<["-"], "felide-constructors">, Group; -def fno_elide_type : Flag<["-"], "fno-elide-type">, Group, - Flags<[CC1Option]>, - HelpText<"Do not elide types when printing diagnostics">; def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group; def femit_all_decls : Flag<["-"], "femit-all-decls">, Group, Flags<[CC1Option]>, HelpText<"Emit all declarations, even if unused">; @@ -1617,8 +1644,6 @@ def fno_short_enums : Flag<["-"], "fno-short-enums">, Group; def fno_show_source_location : Flag<["-"], "fno-show-source-location">, Group, Flags<[CC1Option]>, HelpText<"Do not include source location information with diagnostics">; -def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group, - Flags<[CC1Option, CoreOption]>, HelpText<"Print absolute paths in diagnostics">; def fno_spell_checking : Flag<["-"], "fno-spell-checking">, Group, Flags<[CC1Option]>, HelpText<"Disable spell-checking">; def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group, @@ -2768,9 +2793,6 @@ HelpText<"Write output to ">, MetaVarName<"">; def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">; def pass_exit_codes : Flag<["-", "--"], "pass-exit-codes">, Flags<[Unsupported]>; -def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group, Flags<[CC1Option]>; -def pedantic : Flag<["-", "--"], "pedantic">, Group, Flags<[CC1Option]>; -def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC1Option]>; def pipe : Flag<["-", "--"], "pipe">, HelpText<"Use pipes between commands, when possible">; def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">; @@ -2929,7 +2951,6 @@ def weak__reference__mismatches : Separate<["-"], "weak_reference_mismatches">; def whatsloaded : Flag<["-"], "whatsloaded">; def whyload : Flag<["-"], "whyload">; -def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">, Flags<[CC1Option]>; def x : JoinedOrSeparate<["-"], "x">, Flags<[DriverOption,CC1Option]>, HelpText<"Treat subsequent input files as having type ">, MetaVarName<"">; @@ -3937,8 +3958,6 @@ HelpText<"Change diagnostic formatting to match IDE and command line tools">, Values<"clang,msvc,msvc-fallback,vi">; def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">, HelpText<"Print diagnostic category">, Values<"none,id,name">; -def fno_diagnostics_use_presumed_location : Flag<["-"], "fno-diagnostics-use-presumed-location">, - HelpText<"Ignore #line directives when displaying diagnostic locations">; def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"">, HelpText<"Set the tab stop distance.">; def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"">, @@ -3964,8 +3983,6 @@ HelpText<"Ignore unexpected diagnostic messages">; def verify_ignore_unexpected_EQ : CommaJoined<["-"], "verify-ignore-unexpected=">, HelpText<"Ignore unexpected diagnostic messages">; -def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">, - HelpText<"Silence ObjC rewriting warnings">; //===----------------------------------------------------------------------===// // Frontend Options diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1632,16 +1632,11 @@ if (Arg *A = Args.getLastArg(OPT_diagnostic_serialized_file, OPT__serialize_diags)) Opts.DiagnosticSerializationFile = A->getValue(); - Opts.IgnoreWarnings = Args.hasArg(OPT_w); - Opts.NoRewriteMacros = Args.hasArg(OPT_Wno_rewrite_macros); - Opts.Pedantic = Args.hasArg(OPT_pedantic); - Opts.PedanticErrors = Args.hasArg(OPT_pedantic_errors); Opts.ShowCarets = !Args.hasArg(OPT_fno_caret_diagnostics); Opts.ShowColors = parseShowColorsArgs(Args, DefaultDiagColor); Opts.ShowColumn = !Args.hasArg(OPT_fno_show_column); Opts.ShowFixits = !Args.hasArg(OPT_fno_diagnostics_fixit_info); Opts.ShowLocation = !Args.hasArg(OPT_fno_show_source_location); - Opts.AbsolutePath = Args.hasArg(OPT_fdiagnostics_absolute_paths); Opts.ShowOptionNames = !Args.hasArg(OPT_fno_diagnostics_show_option); // Default behavior is to not to show note include stacks. @@ -1700,9 +1695,6 @@ << Format; } - Opts.ShowSourceRanges = Args.hasArg(OPT_fdiagnostics_print_source_range_info); - Opts.ShowParseableFixits = Args.hasArg(OPT_fdiagnostics_parseable_fixits); - Opts.ShowPresumedLoc = !Args.hasArg(OPT_fno_diagnostics_use_presumed_location); Opts.VerifyDiagnostics = Args.hasArg(OPT_verify) || Args.hasArg(OPT_verify_EQ); Opts.VerifyPrefixes = Args.getAllArgValues(OPT_verify_EQ); if (Args.hasArg(OPT_verify)) @@ -1722,8 +1714,6 @@ if (Args.hasArg(OPT_verify_ignore_unexpected)) DiagMask = DiagnosticLevelMask::All; Opts.setVerifyIgnoreUnexpected(DiagMask); - Opts.ElideType = !Args.hasArg(OPT_fno_elide_type); - Opts.ShowTemplateTree = Args.hasArg(OPT_fdiagnostics_show_template_tree); Opts.ErrorLimit = getLastArgIntValue(Args, OPT_ferror_limit, 0, Diags); Opts.MacroBacktraceLimit = getLastArgIntValue(Args, OPT_fmacro_backtrace_limit,