From d600ab3bb51268b660e1ed62478d4bfa41294f54 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 23 Jan 2020 21:29:09 -0800 Subject: [Frontend] Delete some unneeded CC1 options --- clang/lib/Frontend/CompilerInvocation.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 40bcc95..847b613 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -952,14 +952,10 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.TrapFuncName = Args.getLastArgValue(OPT_ftrap_function_EQ); Opts.UseInitArray = !Args.hasArg(OPT_fno_use_init_array); - Opts.FunctionSections = Args.hasFlag(OPT_ffunction_sections, - OPT_fno_function_sections, false); - Opts.DataSections = Args.hasFlag(OPT_fdata_sections, - OPT_fno_data_sections, false); - Opts.StackSizeSection = - Args.hasFlag(OPT_fstack_size_section, OPT_fno_stack_size_section, false); - Opts.UniqueSectionNames = Args.hasFlag(OPT_funique_section_names, - OPT_fno_unique_section_names, true); + Opts.FunctionSections = Args.hasArg(OPT_ffunction_sections); + Opts.DataSections = Args.hasArg(OPT_fdata_sections); + Opts.StackSizeSection = Args.hasArg(OPT_fstack_size_section); + Opts.UniqueSectionNames = !Args.hasArg(OPT_fno_unique_section_names); Opts.MergeFunctions = Args.hasArg(OPT_fmerge_functions); @@ -1552,9 +1548,7 @@ bool clang::ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args, Opts.PedanticErrors = Args.hasArg(OPT_pedantic_errors); Opts.ShowCarets = !Args.hasArg(OPT_fno_caret_diagnostics); Opts.ShowColors = parseShowColorsArgs(Args, DefaultDiagColor); - Opts.ShowColumn = Args.hasFlag(OPT_fshow_column, - OPT_fno_show_column, - /*Default=*/true); + 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); @@ -3242,18 +3236,11 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, systemBlacklists.end()); // -fxray-instrument - Opts.XRayInstrument = - Args.hasFlag(OPT_fxray_instrument, OPT_fnoxray_instrument, false); - - // -fxray-always-emit-customevents + Opts.XRayInstrument = Args.hasArg(OPT_fxray_instrument); Opts.XRayAlwaysEmitCustomEvents = - Args.hasFlag(OPT_fxray_always_emit_customevents, - OPT_fnoxray_always_emit_customevents, false); - - // -fxray-always-emit-typedevents + Args.hasArg(OPT_fxray_always_emit_customevents); Opts.XRayAlwaysEmitTypedEvents = - Args.hasFlag(OPT_fxray_always_emit_typedevents, - OPT_fnoxray_always_emit_customevents, false); + Args.hasArg(OPT_fxray_always_emit_typedevents); // -fxray-{always,never}-instrument= filenames. Opts.XRayAlwaysInstrumentFiles = -- cgit v1.1