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 @@ -478,10 +478,11 @@ def Ofast : Joined<["-"], "Ofast">, Group, Flags<[CC1Option]>; def P : Flag<["-"], "P">, Flags<[CC1Option]>, Group, HelpText<"Disable linemarker output in -E mode">; -def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>, - HelpText<"Emit metadata containing compiler name and version">; def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>, HelpText<"Do not emit metadata containing compiler name and version">; +def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>, + HelpText<"Emit metadata containing compiler name and version">, + MarshallingInfoBooleanFlag<"CodeGenOpts.EmitVersionIdentMetadata", "true", Qn>; def : Flag<["-"], "fident">, Group, Alias, Flags<[CC1Option]>; def : Flag<["-"], "fno-ident">, Group, Alias, Flags<[CC1Option]>; def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>, @@ -799,7 +800,11 @@ Group, Flags<[NoXarchOption, CC1Option]>, HelpText<"Disable '[[]]' attributes in all C and C++ language modes">; -defm autolink : OptOutFFlag<"autolink", "", "Disable generation of linker directives for automatic library linking">; +// todo: merge into one +def fautolink : Flag<["-"], "fautolink">, Group; +def fno_autolink : Flag<["-"], "fno-autolink">, Flags<[CC1Option]>, Group, + HelpText<"Disable generation of linker directives for automatic library linking">, + MarshallingInfoFlag<"CodeGenOpts.Autolink", "true">, IsNegative; // C++ Coroutines TS defm coroutines_ts : OptInFFlag<"coroutines-ts", "Enable support for the C++ Coroutines TS">; @@ -828,7 +833,8 @@ DocBrief<[{Specifies that the sample profile is accurate. If the sample profile is accurate, callsites without profile samples are marked as cold. Otherwise, treat callsites without profile samples as if - we have no profile}]>; + we have no profile}]>, + MarshallingInfoFlag<"CodeGenOpts.ProfileSampleAccurate">; def fno_profile_sample_accurate : Flag<["-"], "fno-profile-sample-accurate">, Group, Flags<[NoXarchOption]>; def fauto_profile : Flag<["-"], "fauto-profile">, Group, @@ -848,7 +854,7 @@ Group, Flags<[CC1Option, CC1AsOption, CoreOption]>, Alias; defm debug_info_for_profiling : OptInFFlag<"debug-info-for-profiling", - "Emit extra debug info to make sample profile more accurate">; + "Emit extra debug info to make sample profile more accurate", "", "", [], "CodeGenOpts.DebugInfoForProfiling">; def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">, Group, Flags<[CoreOption]>, HelpText<"Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">; @@ -867,7 +873,7 @@ Group, Flags<[CoreOption]>, Alias; defm coverage_mapping : OptInFFlag<"coverage-mapping", "Generate coverage mapping to enable code coverage analysis", "Disable code coverage analysis", "", - [CoreOption]>; + [CoreOption], "CodeGenOpts.CoverageMapping">; def fprofile_generate : Flag<["-"], "fprofile-generate">, Group, Flags<[CoreOption]>, HelpText<"Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">; @@ -904,12 +910,13 @@ HelpText<"Instrument only functions from files where names don't match all the regexes separated by a semi-colon">; def fprofile_update_EQ : Joined<["-"], "fprofile-update=">, Group, Flags<[CC1Option, CoreOption]>, Values<"atomic,prefer-atomic,single">, - MetaVarName<"">, HelpText<"Set update method of profile counters (atomic,prefer-atomic,single)">; + MetaVarName<"">, HelpText<"Set update method of profile counters (atomic,prefer-atomic,single)">, + MarshallingInfoFlag<"CodeGenOpts.AtomicProfileUpdate">; def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">, Group, Flags<[CC1Option, CoreOption]>, HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">; -defm addrsig : OptInFFlag<"addrsig", "Emit", "Don't emit", " an address-significance table", [CoreOption]>; +defm addrsig : OptInFFlag<"addrsig", "Emit", "Don't emit", " an address-significance table", [CoreOption], "CodeGenOpts.Addrsig">; defm blocks : OptInFFlag<"blocks", "Enable the 'blocks' language feature", "", "", [CoreOption]>; def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group; def fborland_extensions : Flag<["-"], "fborland-extensions">, Group, Flags<[CC1Option]>, @@ -942,7 +949,8 @@ def : Flag<["-"], "frecord-gcc-switches">, Alias; def : Flag<["-"], "fno-record-gcc-switches">, Alias; def fcommon : Flag<["-"], "fcommon">, Group, - Flags<[CoreOption, CC1Option]>, HelpText<"Place uninitialized global variables in a common block">; + Flags<[CoreOption, CC1Option]>, HelpText<"Place uninitialized global variables in a common block">, + MarshallingInfoFlag<"CodeGenOpts.NoCommon", "true">, IsNegative; def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group; def fcomplete_member_pointers : Flag<["-"], "fcomplete-member-pointers">, Group, Flags<[CoreOption, CC1Option]>, @@ -977,8 +985,8 @@ 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">; +defm diagnostics_show_hotness : OptInFFlag<"diagnostics-show-hotness", + "Enable profile hotness information in diagnostic line", "", "", [], "CodeGenOpts.DiagnosticsWithHotness">; def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">, Group, Flags<[CC1Option]>, MetaVarName<"">, HelpText<"Prevent optimization remarks from being output if they do not have at least this profile count">; @@ -1001,7 +1009,7 @@ HelpText<"Allow '$' in identifiers">, Flags<[CC1Option]>; def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group; def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group; -defm dwarf_directory_asm : OptOutFFlag<"dwarf-directory-asm", "", "">; +defm dwarf_directory_asm : OptOutFFlag<"dwarf-directory-asm", "", "", "", [], "CodeGenOpts.NoDwarfDirectoryAsm">; def felide_constructors : Flag<["-"], "felide-constructors">, Group; def fno_elide_type : Flag<["-"], "fno-elide-type">, Group, Flags<[CC1Option]>, @@ -1052,9 +1060,9 @@ def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group, Flags<[CoreOption]>; def fsignaling_math : Flag<["-"], "fsignaling-math">, Group; def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group; -defm jump_tables : OptOutFFlag<"jump-tables", "Use", "Do not use", " jump tables for lowering switches">; +defm jump_tables : OptOutFFlag<"jump-tables", "Use", "Do not use", " jump tables for lowering switches", [], "CodeGenOpts.NoUseJumpTables">; defm force_enable_int128 : OptInFFlag<"force-enable-int128", "Enable", "Disable", " support for int128_t type">; -defm keep_static_consts : OptInFFlag<"keep-static-consts", "Keep", "Don't keep", " static const variables if unused", [NoXarchOption]>; +defm keep_static_consts : OptInFFlag<"keep-static-consts", "Keep", "Don't keep", " static const variables if unused", [NoXarchOption], "CodeGenOpts.KeepStaticConsts">; defm fixed_point : OptInFFlag<"fixed-point", "Enable", "Disable", " fixed point types">; defm cxx_static_destructors : OptOutFFlag<"c++-static-destructors", "", "Disable C++ static destructor registration">; @@ -1116,41 +1124,39 @@ Group, Flags<[CoreOption, NoXarchOption]>, HelpText<"Disable origins tracking in MemorySanitizer">; -def fsanitize_memory_use_after_dtor : Flag<["-"], "fsanitize-memory-use-after-dtor">, - Group, - HelpText<"Enable use-after-destroy detection in MemorySanitizer">; -def fno_sanitize_memory_use_after_dtor : Flag<["-"], "fno-sanitize-memory-use-after-dtor">, - Group, - HelpText<"Disable use-after-destroy detection in MemorySanitizer">; +// todo: check if the help could be simplified with `OptInFFlag` +defm sanitize_memory_use_after_dtor : BooleanMarshalledFFlag<"sanitize-memory-use-after-dtor", + "CodeGenOpts.SanitizeMemoryUseAfterDtor", "false", + "Enable use-after-destroy detection in MemorySanitizer", "Disable use-after-destroy detection in MemorySanitizer">, + Group; def fsanitize_address_field_padding : Joined<["-"], "fsanitize-address-field-padding=">, Group, HelpText<"Level of field padding for AddressSanitizer">; -def fsanitize_address_use_after_scope : Flag<["-"], "fsanitize-address-use-after-scope">, - Group, - HelpText<"Enable use-after-scope detection in AddressSanitizer">; +// todo: join following two records into a single multiclass (with different Flags => cannot use current OptInFFlag) def fno_sanitize_address_use_after_scope : Flag<["-"], "fno-sanitize-address-use-after-scope">, Group, Flags<[CoreOption, NoXarchOption]>, HelpText<"Disable use-after-scope detection in AddressSanitizer">; -def fsanitize_address_poison_custom_array_cookie - : Flag<[ "-" ], "fsanitize-address-poison-custom-array-cookie">, - Group, - HelpText<"Enable poisoning array cookies when using custom operator new[] in AddressSanitizer">; -def fno_sanitize_address_poison_custom_array_cookie - : Flag<[ "-" ], "fno-sanitize-address-poison-custom-array-cookie">, - Group, - HelpText<"Disable poisoning array cookies when using custom operator new[] in AddressSanitizer">; -def fsanitize_address_globals_dead_stripping : Flag<["-"], "fsanitize-address-globals-dead-stripping">, +def fsanitize_address_use_after_scope : Flag<["-"], "fsanitize-address-use-after-scope">, Group, - HelpText<"Enable linker dead stripping of globals in AddressSanitizer">; -def fsanitize_address_use_odr_indicator - : Flag<["-"], "fsanitize-address-use-odr-indicator">, - Group, - HelpText<"Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size">; -def fno_sanitize_address_use_odr_indicator - : Flag<["-"], "fno-sanitize-address-use-odr-indicator">, - Group, - HelpText<"Disable ODR indicator globals">; + HelpText<"Enable use-after-scope detection in AddressSanitizer">, + MarshallingInfoBooleanFlag<"CodeGenOpts.SanitizeAddressUseAfterScope", "false", + fno_sanitize_address_use_after_scope>; +// todo: check if the help could be simplified with `OptInFFlag` +defm sanitize_address_poison_custom_array_cookie : BooleanMarshalledFFlag<"sanitize-address-poison-custom-array-cookie", + "CodeGenOpts.SanitizeAddressPoisonCustomArrayCookie", "false", + "Enable poisoning array cookies when using custom operator new[] in AddressSanitizer", + "Disable poisoning array cookies when using custom operator new[] in AddressSanitizer">, + Group; +def fsanitize_address_globals_dead_stripping : Flag<["-"], "fsanitize-address-globals-dead-stripping">, + Group, HelpText<"Enable linker dead stripping of globals in AddressSanitizer">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeAddressGlobalsDeadStripping", "false">; +// todo: check if the help could be simplified with `OptInFFlag` +defm sanitize_address_use_odr_indicator : BooleanMarshalledFFlag<"sanitize-address-use-odr-indicator", + "CodeGenOpts.SanitizeAddressUseOdrIndicator", "false", + "Enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size", + "Disable ODR indicator globals">, + Group; // Note: This flag was introduced when it was necessary to distinguish between // ABI for correct codegen. This is no longer needed, but the flag is // not removed since targeting either ABI will behave the same. @@ -1190,8 +1196,9 @@ def fno_sanitize_undefined_trap_on_error : Flag<["-"], "fno-sanitize-undefined-trap-on-error">, Group, Alias, AliasArgs<["undefined"]>; +// todo: check if the two following records could be simplified with `OptInFFlag` def fsanitize_minimal_runtime : Flag<["-"], "fsanitize-minimal-runtime">, - Group; + Group, MarshallingInfoFlag<"CodeGenOpts.SanitizeMinimalRuntime">; def fno_sanitize_minimal_runtime : Flag<["-"], "fno-sanitize-minimal-runtime">, Group; def fsanitize_link_runtime : Flag<["-"], "fsanitize-link-runtime">, @@ -1202,26 +1209,33 @@ Group; def fno_sanitize_link_cxx_runtime : Flag<["-"], "fno-sanitize-link-c++-runtime">, Group; +// todo: join following two records into a single multiclass (with different Flags => cannot use current OptInFFlag) def fsanitize_cfi_cross_dso : Flag<["-"], "fsanitize-cfi-cross-dso">, Group, - HelpText<"Enable control flow integrity (CFI) checks for cross-DSO calls.">; + HelpText<"Enable control flow integrity (CFI) checks for cross-DSO calls.">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCfiCrossDso">; def fno_sanitize_cfi_cross_dso : Flag<["-"], "fno-sanitize-cfi-cross-dso">, Flags<[CoreOption, NoXarchOption]>, Group, HelpText<"Disable control flow integrity (CFI) checks for cross-DSO calls.">; def fsanitize_cfi_icall_generalize_pointers : Flag<["-"], "fsanitize-cfi-icall-generalize-pointers">, Group, - HelpText<"Generalize pointers in CFI indirect call type signature checks">; + HelpText<"Generalize pointers in CFI indirect call type signature checks">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCfiICallGeneralizePointers">; +// todo: join following two records into a single multiclass (with different Flags => cannot use current OptInFFlag) def fsanitize_cfi_canonical_jump_tables : Flag<["-"], "fsanitize-cfi-canonical-jump-tables">, Group, - HelpText<"Make the jump table addresses canonical in the symbol table">; + HelpText<"Make the jump table addresses canonical in the symbol table">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCfiCanonicalJumpTables">; def fno_sanitize_cfi_canonical_jump_tables : Flag<["-"], "fno-sanitize-cfi-canonical-jump-tables">, Group, Flags<[CoreOption, NoXarchOption]>, HelpText<"Do not make the jump table addresses canonical in the symbol table">; +// todo: join following two records into a single multiclass (with different Flags => cannot use current OptInFFlag) def fsanitize_stats : Flag<["-"], "fsanitize-stats">, Group, - HelpText<"Enable sanitizer statistics gathering.">; + HelpText<"Enable sanitizer statistics gathering.">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeStats">; def fno_sanitize_stats : Flag<["-"], "fno-sanitize-stats">, Group, Flags<[CoreOption, NoXarchOption]>, @@ -1284,9 +1298,12 @@ " | on (according to FP_CONTRACT pragma) | off (never fuse). Default" " is 'fast' for CUDA/HIP and 'on' otherwise.">, Values<"fast,on,off">; -defm strict_float_cast_overflow : OptOutFFlag<"strict-float-cast-overflow", - "Assume that overflowing float-to-int casts are undefined (default)", - "Relax language rules and try to match the behavior of the target's native float-to-int conversion instructions">; +// todo: figure out why Daniel's patch split this into two records +def fstrict_float_cast_overflow : Flag<["-"], "fstrict-float-cast-overflow">, Group, + HelpText<"Assume that overflowing float-to-int casts are undefined (default)">; +def fno_strict_float_cast_overflow : Flag<["-"], "fno-strict-float-cast-overflow">, Group, Flags<[CC1Option]>, + HelpText<"Relax language rules and try to match the behavior of the target's native float-to-int conversion instructions">, + MarshallingInfoFlag<"CodeGenOpts.StrictFloatCastOverflow", "true">, IsNegative; def ffor_scope : Flag<["-"], "ffor-scope">, Group; def fno_for_scope : Flag<["-"], "fno-for-scope">, Group; @@ -1297,7 +1314,7 @@ defm delete_null_pointer_checks : OptOutFFlag<"delete-null-pointer-checks", "Treat usage of null pointers as undefined behavior (default)", "Do not treat usage of null pointers as undefined behavior", - "", [CoreOption]>; + "", [CoreOption], "CodeGenOpts.NullPointerIsValid">; def frewrite_map_file : Separate<["-"], "frewrite-map-file">, Group, @@ -1341,11 +1358,14 @@ def finput_charset_EQ : Joined<["-"], "finput-charset=">, Group; def fexec_charset_EQ : Joined<["-"], "fexec-charset=">, Group; def finstrument_functions : Flag<["-"], "finstrument-functions">, Group, Flags<[CC1Option]>, - HelpText<"Generate calls to instrument function entry and exit">; + HelpText<"Generate calls to instrument function entry and exit">, + MarshallingInfoFlag<"CodeGenOpts.InstrumentFunctions">; def finstrument_functions_after_inlining : Flag<["-"], "finstrument-functions-after-inlining">, Group, Flags<[CC1Option]>, - HelpText<"Like -finstrument-functions, but insert the calls after inlining">; + HelpText<"Like -finstrument-functions, but insert the calls after inlining">, + MarshallingInfoFlag<"CodeGenOpts.InstrumentFunctionsAfterInlining">; def finstrument_function_entry_bare : Flag<["-"], "finstrument-function-entry-bare">, Group, Flags<[CC1Option]>, - HelpText<"Instrument function entry only, after inlining, without arguments to the instrumentation call">; + HelpText<"Instrument function entry only, after inlining, without arguments to the instrumentation call">, + MarshallingInfoFlag<"CodeGenOpts.InstrumentFunctionEntryBare">; def fcf_protection_EQ : Joined<["-"], "fcf-protection=">, Flags<[CoreOption, CC1Option]>, Group, HelpText<"Instrument control-flow architecture protection. Options: return, branch, full, none.">, Values<"return,branch,full,none">; def fcf_protection : Flag<["-"], "fcf-protection">, Group, Flags<[CoreOption, CC1Option]>, @@ -1412,12 +1432,10 @@ HelpText<"When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1">; -def ffine_grained_bitfield_accesses : Flag<["-"], - "ffine-grained-bitfield-accesses">, Group, Flags<[CC1Option]>, - HelpText<"Use separate accesses for consecutive bitfield runs with legal widths and alignments.">; -def fno_fine_grained_bitfield_accesses : Flag<["-"], - "fno-fine-grained-bitfield-accesses">, Group, Flags<[CC1Option]>, - HelpText<"Use large-integer access for consecutive bitfield runs.">; +defm fine_grained_bitfield_accesses : BooleanMarshalledFFlag<"fine-grained-bitfield-accesses", + "CodeGenOpts.FineGrainedBitfieldAccesses", "false", + "Use separate accesses for consecutive bitfield runs with legal widths and alignments.", + "Use large-integer access for consecutive bitfield runs.">, Group, Flags<[CC1Option]>; def fexperimental_relative_cxx_abi_vtables : Flag<["-"], "fexperimental-relative-c++-abi-vtables">, Group, Flags<[CC1Option]>, @@ -1453,15 +1471,20 @@ HelpText<"Write minimized bitcode to for the ThinLTO thin link only">; def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">, Group, Flags<[NoXarchOption, CoreOption]>; +// todo: merge the following two records into one (different Flags => cannot use `OptOutFFlag`) def fmerge_all_constants : Flag<["-"], "fmerge-all-constants">, Group, - Flags<[CC1Option, CoreOption]>, HelpText<"Allow merging of constants">; + Flags<[CC1Option, CoreOption]>, HelpText<"Allow merging of constants">, + MarshallingInfoFlag<"CodeGenOpts.MergeAllConstants">; +def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group, + HelpText<"Disallow merging of constants">; def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group, Flags<[CC1Option]>, HelpText<"Format message diagnostics so that they fit within N columns">; def fms_extensions : Flag<["-"], "fms-extensions">, Group, Flags<[CC1Option, CoreOption]>, HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">; def fms_compatibility : Flag<["-"], "fms-compatibility">, Group, Flags<[CC1Option, CoreOption]>, HelpText<"Enable full Microsoft Visual C++ compatibility">; -def fms_volatile : Flag<["-"], "fms-volatile">, Group, Flags<[CC1Option]>; +def fms_volatile : Flag<["-"], "fms-volatile">, Group, Flags<[CC1Option]>, + MarshallingInfoFlag<"CodeGenOpts.MSVolatile">; def fmsc_version : Joined<["-"], "fmsc-version=">, Group, Flags<[NoXarchOption, CoreOption]>, HelpText<"Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default))">; def fms_compatibility_version @@ -1597,7 +1620,7 @@ def fno_asynchronous_unwind_tables : Flag<["-"], "fno-asynchronous-unwind-tables">, Group; def fno_assume_sane_operator_new : Flag<["-"], "fno-assume-sane-operator-new">, Group, HelpText<"Don't assume that C++'s global operator new can't alias any pointer">, - Flags<[CC1Option]>; + Flags<[CC1Option]>, MarshallingInfoFlag<"CodeGenOpts.AssumeSaneOperatorNew", "true">, IsNegative; def fno_borland_extensions : Flag<["-"], "fno-borland-extensions">, Group; def fno_builtin : Flag<["-"], "fno-builtin">, Group, Flags<[CC1Option, CoreOption]>, HelpText<"Disable implicit builtin knowledge of functions">; @@ -1614,7 +1637,6 @@ Flags<[NoXarchOption]>; def fno_diagnostics_fixit_info : Flag<["-"], "fno-diagnostics-fixit-info">, Group, Flags<[CC1Option]>, HelpText<"Do not include fixit information in diagnostics">; -def fno_diagnostics_show_hotness : Flag<["-"], "fno-diagnostics-show-hotness">, Group; def fno_diagnostics_show_option : Flag<["-"], "fno-diagnostics-show-option">, Group, Flags<[CC1Option]>; def fno_diagnostics_show_note_include_stack : Flag<["-"], "fno-diagnostics-show-note-include-stack">, Flags<[CC1Option]>, Group; @@ -1640,8 +1662,6 @@ HelpText<"Use the given vector functions library">, Values<"Accelerate,libmvec,MASSV,SVML,none">; def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group, Alias, AliasArgs<["none"]>; -def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group, - HelpText<"Disallow merging of constants">; def fno_modules : Flag <["-"], "fno-modules">, Group, Flags<[NoXarchOption]>; def fno_implicit_module_maps : Flag <["-"], "fno-implicit-module-maps">, Group, @@ -1686,8 +1706,6 @@ def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group; def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group; def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group; -def fno_strict_vtable_pointers: Flag<["-"], "fno-strict-vtable-pointers">, - Group; def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group; def fno_temp_file : Flag<["-"], "fno-temp-file">, Group, Flags<[CC1Option, CoreOption]>, HelpText< @@ -1695,25 +1713,29 @@ MarshallingInfoFlag<"FrontendOpts.UseTemporary", "true">, IsNegative; def fno_threadsafe_statics : Flag<["-"], "fno-threadsafe-statics">, Group, Flags<[CC1Option]>, HelpText<"Do not emit code to make initialization of local statics thread safe">; +// todo: merge the following into a single OptInFFlag +def fuse_cxa_atexit : Flag<["-"], "fuse-cxa-atexit">, Group; def fno_use_cxa_atexit : Flag<["-"], "fno-use-cxa-atexit">, Group, Flags<[CC1Option]>, - HelpText<"Don't use __cxa_atexit for calling destructors">; -def fno_register_global_dtors_with_atexit : Flag<["-"], "fno-register-global-dtors-with-atexit">, Group, - HelpText<"Don't use atexit or __cxa_atexit to register global destructors">; + HelpText<"Don't use __cxa_atexit for calling destructors">, + MarshallingInfoFlag<"CodeGenOpts.CXAAtExit", "true">, IsNegative; def fno_unit_at_a_time : Flag<["-"], "fno-unit-at-a-time">, Group; def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group; -def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group, Flags<[CC1Option]>; +def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group, Flags<[CC1Option]>, + MarshallingInfoFlag<"CodeGenOpts.AsmVerbose", "true">, IsNegative; def fno_working_directory : Flag<["-"], "fno-working-directory">, Group; def fno_wrapv : Flag<["-"], "fno-wrapv">, Group; def fobjc_arc : Flag<["-"], "fobjc-arc">, Group, Flags<[CC1Option]>, HelpText<"Synthesize retain and release calls for Objective-C pointers">; def fno_objc_arc : Flag<["-"], "fno-objc-arc">, Group; +// todo: merge the two following into a single OptOutFFlag def fobjc_convert_messages_to_runtime_calls : Flag<["-"], "fobjc-convert-messages-to-runtime-calls">, Group; def fno_objc_convert_messages_to_runtime_calls : - Flag<["-"], "fno-objc-convert-messages-to-runtime-calls">, Group, Flags<[CC1Option]>; -def fobjc_arc_exceptions : Flag<["-"], "fobjc-arc-exceptions">, Group, Flags<[CC1Option]>, - HelpText<"Use EH-safe code when synthesizing retains and releases in -fobjc-arc">; -def fno_objc_arc_exceptions : Flag<["-"], "fno-objc-arc-exceptions">, Group; + Flag<["-"], "fno-objc-convert-messages-to-runtime-calls">, Group, Flags<[CC1Option]>, + MarshallingInfoFlag<"CodeGenOpts.ObjCConvertMessagesToRuntimeCalls", "true">, IsNegative; +defm objc_arc_exceptions : OptInFFlag<"objc-arc-exceptions", + "Use EH-safe code when synthesizing retains and releases in -fobjc-arc", + "", "", [], "CodeGenOpts.ObjCAutoRefCountExceptions">; def fobjc_atdefs : Flag<["-"], "fobjc-atdefs">, Group; def fobjc_call_cxx_cdtors : Flag<["-"], "fobjc-call-cxx-cdtors">, Group; def fobjc_exceptions: Flag<["-"], "fobjc-exceptions">, Group, @@ -1814,8 +1836,7 @@ HelpText<"Use the static host OpenMP runtime while linking.">; def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group; def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group; -def fno_escaping_block_tail_calls : Flag<["-"], "fno-escaping-block-tail-calls">, Group, Flags<[CC1Option]>; -def fescaping_block_tail_calls : Flag<["-"], "fescaping-block-tail-calls">, Group; +defm escaping_block_tail_calls : OptOutFFlag<"escaping-block-tail-calls", "", "", "", [], "CodeGenOpts.NoEscapingBlockTailCalls">; def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">; def force__flat__namespace : Flag<["-"], "force_flat_namespace">; def force__load : Separate<["-"], "force_load">; @@ -1840,7 +1861,7 @@ def fpie : Flag<["-"], "fpie">, Group; def fno_pie : Flag<["-"], "fno-pie">, Group; defm plt : OptOutFFlag<"plt", "", - "Use GOT indirection instead of PLT to make external function calls (x86 only)">; + "Use GOT indirection instead of PLT to make external function calls (x86 only)", "", [], "CodeGenOpts.NoPLT">; defm ropi : OptInFFlag<"ropi", "Generate read-only position independent code (ARM only)">; defm rwpi : OptInFFlag<"rwpi", "Generate read-write position independent code (ARM only)">; def fplugin_EQ : Joined<["-"], "fplugin=">, Group, Flags<[NoXarchOption]>, MetaVarName<"">, @@ -1848,9 +1869,14 @@ def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">, Group, Flags<[CC1Option]>, MetaVarName<"">, HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">; -defm preserve_as_comments : OptOutFFlag<"preserve-as-comments", "", - "Do not preserve comments in inline assembly">; -def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group, Flags<[CC1Option,LinkOption]>; +// fixme: figure out why this was split into two +def fpreserve_as_comments : Flag<["-"], "fpreserve-as-comments">, Group; +def fno_preserve_as_comments : Flag<["-"], "fno-preserve-as-comments">, Flags<[CC1Option]>, Group, + HelpText<"Do not preserve comments in inline assembly">, + MarshallingInfoFlag<"CodeGenOpts.PreserveAsmComments", "true">, IsNegative; +// todo: join this +def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group, Flags<[CC1Option,LinkOption]>, + MarshallingInfoFlag<"CodeGenOpts.EmitGcovArcs">; def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group; def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>; def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group; @@ -1881,8 +1907,10 @@ def fsplit_stack : Flag<["-"], "fsplit-stack">, Group; def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group, HelpText<"Enable stack protectors for all functions">; +// todo: join the following two into OptInFFlag def fstack_clash_protection : Flag<["-"], "fstack-clash-protection">, Group, Flags<[CC1Option]>, - HelpText<"Enable stack clash protection">; + HelpText<"Enable stack clash protection">, + MarshallingInfoFlag<"CodeGenOpts.StackClashProtector">; def fno_stack_clash_protection : Flag<["-"], "fno-stack-clash-protection">, Group, HelpText<"Disable stack clash protection">; def fstack_protector_strong : Flag<["-"], "fstack-protector-strong">, Group, @@ -1923,11 +1951,12 @@ Flags<[NoXarchOption, CoreOption]>; def fstrict_enums : Flag<["-"], "fstrict-enums">, Group, Flags<[CC1Option]>, HelpText<"Enable optimizations based on the strict definition of an enum's " - "value range">; -def fstrict_vtable_pointers: Flag<["-"], "fstrict-vtable-pointers">, - Group, Flags<[CC1Option]>, - HelpText<"Enable optimizations based on the strict rules for overwriting " - "polymorphic C++ objects">; + "value range">, + MarshallingInfoFlag<"CodeGenOpts.StrictEnums">; +// fixme: finish the two below +defm strict_vtable_pointers : OptInFFlag<"strict-vtable-pointers", + "Enable optimizations based on the strict rules for overwriting polymorphic C++ objects", + "", "", [], "CodeGenOpts.StrictVTablePointers">; def fstrict_overflow : Flag<["-"], "fstrict-overflow">, Group; def fsyntax_only : Flag<["-"], "fsyntax-only">, Flags<[NoXarchOption,CoreOption,CC1Option]>, Group; @@ -1955,7 +1984,9 @@ HelpText<"Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)">, MetaVarName<"">; -def ftest_coverage : Flag<["-"], "ftest-coverage">, Flags<[CC1Option]>, Group; +// todo: merge this and point it to `CodeGenOpts.EmitGcovNotes` +def ftest_coverage : Flag<["-"], "ftest-coverage">, Flags<[CC1Option]>, Group, + MarshallingInfoFlag<"CodeGenOpts.EmitGcovNotes">; def fno_test_coverage : Flag<["-"], "fno-test-coverage">, Group; def fvectorize : Flag<["-"], "fvectorize">, Group, HelpText<"Enable the loop vectorization passes">; @@ -2011,7 +2042,7 @@ HelpText<"Turn on loop unroller">, Flags<[CC1Option]>; def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group, HelpText<"Turn off loop unroller">, Flags<[CC1Option]>; -defm reroll_loops : OptInFFlag<"reroll-loops", "Turn on loop reroller">; +defm reroll_loops : OptInFFlag<"reroll-loops", "Turn on loop reroller", "", "", [], "CodeGenOpts.RerollLoops">; def ftrigraphs : Flag<["-"], "ftrigraphs">, Group, HelpText<"Process trigraph sequences">, Flags<[CC1Option]>; def fno_trigraphs : Flag<["-"], "fno-trigraphs">, Group, @@ -2020,10 +2051,13 @@ def funsigned_char : Flag<["-"], "funsigned-char">, Group; def fno_unsigned_char : Flag<["-"], "fno-unsigned-char">; def funwind_tables : Flag<["-"], "funwind-tables">, Group; -def fuse_cxa_atexit : Flag<["-"], "fuse-cxa-atexit">, Group; -def fregister_global_dtors_with_atexit : Flag<["-"], "fregister-global-dtors-with-atexit">, Group, Flags<[CC1Option]>, - HelpText<"Use atexit or __cxa_atexit to register global destructors">; -defm use_init_array : OptOutFFlag<"use-init-array", "", "Use .ctors/.dtors instead of .init_array/.fini_array">; +defm register_global_dtors_with_atexit : OptInFFlag<"register-global-dtors-with-atexit", "Use", "Don't use", + " atexit or __cxa_atexit to register global destructors", [], "CodeGenOpts.RegisterGlobalDtorsWithAtExit">; +// todo: figure out why this needs to be split up +def fuse_init_array : Flag<["-"], "fuse-init-array">, Group; +def fno_use_init_array : Flag<["-"], "fno-use-init-array">, Group, Flags<[CC1Option]>, + HelpText<"Use .ctors/.dtors instead of .init_array/.fini_array">, + MarshallingInfoFlag<"CodeGenOpts.UseInitArray", "true">, IsNegative; def fno_var_tracking : Flag<["-"], "fno-var-tracking">, Group; def fverbose_asm : Flag<["-"], "fverbose-asm">, Group, HelpText<"Generate verbose assembly output">; @@ -2059,40 +2093,51 @@ def fvisibility_global_new_delete_hidden : Flag<["-"], "fvisibility-global-new-delete-hidden">, Group, HelpText<"Give global C++ operator new and delete declarations hidden visibility">, Flags<[CC1Option]>; defm whole_program_vtables : OptInFFlag<"whole-program-vtables", - "Enables whole-program vtable optimization. Requires -flto", "", "", [CoreOption]>; + "Enables whole-program vtable optimization. Requires -flto", "", "", [CoreOption], "CodeGenOpts.WholeProgramVTables">; defm split_lto_unit : OptInFFlag<"split-lto-unit", - "Enables splitting of the LTO unit", "", "", [CoreOption]>; + "Enables splitting of the LTO unit", "", "", [CoreOption], "CodeGenOpts.EnableSplitLTOUnit">; defm force_emit_vtables : OptInFFlag<"force-emit-vtables", - "Emits more virtual tables to improve devirtualization", "", "", [CoreOption]>; + "Emits more virtual tables to improve devirtualization", "", "", [CoreOption], "CodeGenOpts.ForceEmitVTables">; defm virtual_function_elimination : OptInFFlag<"virtual-function-elimination", - "Enables dead virtual function elimination optimization. Requires -flto=full", "", "", [CoreOption]>; + "Enables dead virtual function elimination optimization. Requires -flto=full", "", "", [CoreOption], + "CodeGenOpts.VirtualFunctionElimination">; def fwrapv : Flag<["-"], "fwrapv">, Group, Flags<[CC1Option]>, HelpText<"Treat signed integer overflow as two's complement">; def fwritable_strings : Flag<["-"], "fwritable-strings">, Group, Flags<[CC1Option]>, HelpText<"Store string literals as writable data">; -defm zero_initialized_in_bss : OptOutFFlag<"zero-initialized-in-bss", "", "Don't place zero initialized data in BSS">; +defm zero_initialized_in_bss : OptOutFFlag<"zero-initialized-in-bss", "", "Don't place zero initialized data in BSS", + "", [], "CodeGenOpts.NoZeroInitializedInBSS">; defm function_sections : OptInFFlag<"function-sections", "Place each function in its own section">; def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group, Flags<[CC1Option, CC1AsOption]>, HelpText<"Place each function's basic blocks in unique sections (ELF Only) : all | labels | none | list=">, DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>, Values<"all,labels,none,list=">; -defm data_sections : OptInFFlag<"data-sections", "Place each data in its own section">; -defm stack_size_section : OptInFFlag<"stack-size-section", "Emit section containing metadata on function stack sizes">; +defm data_sections : OptInFFlag<"data-sections", "Place each data in its own section", "", "", [], "CodeGenOpts.DataSections">; +defm stack_size_section : OptInFFlag<"stack-size-section", "Emit section containing metadata on function stack sizes", + "", "", [], "CodeGenOpts.StackSizeSection">; defm unique_basic_block_section_names : OptInFFlag<"unique-basic-block-section-names", - "Use unique names for basic block sections (ELF Only)">; + "Use unique names for basic block sections (ELF Only)", "", "", [], "CodeGenOpts.UniqueBasicBlockSectionNames">; defm unique_internal_linkage_names : OptInFFlag<"unique-internal-linkage-names", - "Uniqueify Internal Linkage Symbol Names by appending the MD5 hash of the module path">; -defm unique_section_names : OptOutFFlag<"unique-section-names", - "", "Don't use unique names for text and data sections">; + "Uniqueify Internal Linkage Symbol Names by appending the MD5 hash of the module path", "", "", [], + "CodeGenOpts.UniqueInternalLinkageNames">; +// todo: join into single OptInFFlag +def funique_section_names : Flag<["-"], "funique-section-names">, Group; +def fno_unique_section_names : Flag<["-"], "fno-unique-section-names">, Group, Flags<[CC1Option]>, + HelpText<"Don't use unique names for text and data sections">, + MarshallingInfoFlag<"CodeGenOpts.UniqueSectionNames", "true">, IsNegative; defm split_machine_functions: OptInFFlag<"split-machine-functions", - "Enable", "Disable", " late function splitting using profile information (x86 ELF)">; + "Enable", "Disable", " late function splitting using profile information (x86 ELF)", + [], "CodeGenOpts.SplitMachineFunctions">; -defm strict_return : OptOutFFlag<"strict-return", "", - "Don't treat control flow paths that fall off the end of a non-void function as unreachable">; +// todo: join into single OptInFFlag +def fstrict_return : Flag<["-"], "fstrict-return">, Group; +def fno_strict_return : Flag<["-"], "fno-strict-return">, Group, Flags<[CC1Option]>, + HelpText<"Don't treat control flow paths that fall off the end of a non-void function as unreachable">, + MarshallingInfoFlag<"CodeGenOpts.StrictReturn", "true">, IsNegative; def fenable_matrix : Flag<["-"], "fenable-matrix">, Group, Flags<[CC1Option]>, @@ -2103,11 +2148,12 @@ HelpText<"Place debug types in their own section (ELF Only)">; def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group; defm debug_ranges_base_address : OptInFFlag<"debug-ranges-base-address", - "Use DWARF base address selection entries in .debug_ranges">; + "Use DWARF base address selection entries in .debug_ranges", "", "", [], "CodeGenOpts.DebugRangesBaseAddress">; +// todo: join into single OptInFFlag def fsplit_dwarf_inlining: Flag <["-"], "fsplit-dwarf-inlining">, Group, HelpText<"Provide minimal debug info in the object/executable to facilitate online symbolication/stack traces in the absence of .dwo/.dwp files when using Split DWARF">; def fno_split_dwarf_inlining: Flag<["-"], "fno-split-dwarf-inlining">, Group, - Flags<[CC1Option]>; + Flags<[CC1Option]>, MarshallingInfoFlag<"CodeGenOpts.SplitDwarfInlining", "true">, IsNegative; def fdebug_default_version: Joined<["-"], "fdebug-default-version=">, Group, HelpText<"Default DWARF version to use, if a -g option caused DWARF debug info to be produced">; def fdebug_prefix_map_EQ @@ -2120,7 +2166,7 @@ def fmacro_prefix_map_EQ : Joined<["-"], "fmacro-prefix-map=">, Group, Flags<[CC1Option]>, HelpText<"remap file source paths in predefined preprocessor macros">; -defm force_dwarf_frame : OptInFFlag<"force-dwarf-frame", "Always emit a debug frame section">; +defm force_dwarf_frame : OptInFFlag<"force-dwarf-frame", "Always emit a debug frame section", "", "", [], "CodeGenOpts.ForceDwarfFrameSection">; def g_Flag : Flag<["-"], "g">, Group, HelpText<"Generate source-level debug information">; def gline_tables_only : Flag<["-"], "gline-tables-only">, Group, @@ -2154,14 +2200,18 @@ def gcodeview : Flag<["-"], "gcodeview">, HelpText<"Generate CodeView debug information">, - Flags<[CC1Option, CC1AsOption, CoreOption]>; + Flags<[CC1Option, CC1AsOption, CoreOption]>, + MarshallingInfoFlag<"CodeGenOpts.EmitCodeView">; def gcodeview_ghash : Flag<["-"], "gcodeview-ghash">, HelpText<"Emit type record hashes in a .debug$H section">, - Flags<[CC1Option, CoreOption]>; + Flags<[CC1Option, CoreOption]>, + MarshallingInfoFlag<"CodeGenOpts.CodeViewGHash">; def gno_codeview_ghash : Flag<["-"], "gno-codeview-ghash">, Flags<[CoreOption]>; +// todo: join following into single OptInFFlag (what about Flags though?) def ginline_line_tables : Flag<["-"], "ginline-line-tables">, Flags<[CoreOption]>; def gno_inline_line_tables : Flag<["-"], "gno-inline-line-tables">, - Flags<[CC1Option, CoreOption]>, HelpText<"Don't emit inline line tables">; + Flags<[CC1Option, CoreOption]>, HelpText<"Don't emit inline line tables">, + MarshallingInfoFlag<"CodeGenOpts.NoInlineLineTables">; def gfull : Flag<["-"], "gfull">, Group; def gused : Flag<["-"], "gused">, Group; @@ -2178,8 +2228,10 @@ def : Flag<["-"], "gno-record-gcc-switches">, Alias; def gstrict_dwarf : Flag<["-"], "gstrict-dwarf">, Group; def gno_strict_dwarf : Flag<["-"], "gno-strict-dwarf">, Group; +// todo: try to merge into one OptOutFlag def gcolumn_info : Flag<["-"], "gcolumn-info">, Group, Flags<[CoreOption]>; -def gno_column_info : Flag<["-"], "gno-column-info">, Group, Flags<[CoreOption, CC1Option]>; +def gno_column_info : Flag<["-"], "gno-column-info">, Group, Flags<[CoreOption, CC1Option]>, + MarshallingInfoFlag<"CodeGenOpts.DebugColumnInfo", "true">, IsNegative; def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group; def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group, HelpText<"Set DWARF fission mode to either 'split' or 'single'">, @@ -2196,7 +2248,8 @@ HelpText<"DWARF debug sections compression type">; def gz : Flag<["-"], "gz">, Alias, AliasArgs<["zlib"]>, Group; def gembed_source : Flag<["-"], "gembed-source">, Group, Flags<[CC1Option]>, - HelpText<"Embed source text in DWARF debug sections">; + HelpText<"Embed source text in DWARF debug sections">, + MarshallingInfoFlag<"CodeGenOpts.EmbedSource">; def gno_embed_source : Flag<["-"], "gno-embed-source">, Group, Flags<[NoXarchOption]>, HelpText<"Restore the default behavior of not embedding source text in DWARF debug sections">; @@ -2374,7 +2427,8 @@ def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group, HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">; def mstackrealign : Flag<["-"], "mstackrealign">, Group, Flags<[CC1Option]>, - HelpText<"Force realign the stack at entry to every function">; + HelpText<"Force realign the stack at entry to every function">, + MarshallingInfoFlag<"CodeGenOpts.StackRealignment">; def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group, Flags<[CC1Option]>, HelpText<"Set the stack alignment">; def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group, Flags<[CC1Option]>, @@ -2382,7 +2436,8 @@ def mstack_arg_probe : Flag<["-"], "mstack-arg-probe">, Group, HelpText<"Enable stack probes">; def mno_stack_arg_probe : Flag<["-"], "mno-stack-arg-probe">, Group, Flags<[CC1Option]>, - HelpText<"Disable stack probes which are enabled by default">; + HelpText<"Disable stack probes which are enabled by default">, + MarshallingInfoFlag<"CodeGenOpts.NoStackArgProbe">; def mthread_model : Separate<["-"], "mthread-model">, Group, Flags<[CC1Option]>, HelpText<"The thread model to use, e.g. posix, single (posix by default)">, Values<"posix,single">; def meabi : Separate<["-"], "meabi">, Group, Flags<[CC1Option]>, @@ -2395,7 +2450,8 @@ Alias; def mno_red_zone : Flag<["-"], "mno-red-zone">, Group; def mno_tls_direct_seg_refs : Flag<["-"], "mno-tls-direct-seg-refs">, Group, Flags<[CC1Option]>, - HelpText<"Disable direct TLS access through segment registers">; + HelpText<"Disable direct TLS access through segment registers">, + MarshallingInfoFlag<"CodeGenOpts.IndirectTlsSegRefs">; def mno_relax_all : Flag<["-"], "mno-relax-all">, Group; def mno_rtd: Flag<["-"], "mno-rtd">, Group; def mno_soft_float : Flag<["-"], "mno-soft-float">, Group; @@ -2404,7 +2460,8 @@ def mretpoline : Flag<["-"], "mretpoline">, Group, Flags<[CoreOption,NoXarchOption]>; def mno_retpoline : Flag<["-"], "mno-retpoline">, Group, Flags<[CoreOption,NoXarchOption]>; def mspeculative_load_hardening : Flag<["-"], "mspeculative-load-hardening">, - Group, Flags<[CoreOption,CC1Option]>; + Group, Flags<[CoreOption,CC1Option]>, + MarshallingInfoFlag<"CodeGenOpts.SpeculativeLoadHardening">; def mno_speculative_load_hardening : Flag<["-"], "mno-speculative-load-hardening">, Group, Flags<[CoreOption]>; def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group, Flags<[CoreOption,NoXarchOption]>, @@ -2468,7 +2525,8 @@ HelpText<"Allow use of CMSE (Armv8-M Security Extensions)">; def ForceAAPCSBitfieldLoad : Flag<["-"], "faapcs-bitfield-load">, Group, Flags<[NoXarchOption,CC1Option]>, - HelpText<"Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).">; + HelpText<"Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).">, + MarshallingInfoFlag<"CodeGenOpts.ForceAAPCSBitfieldLoad">; def ForceNoAAPCSBitfieldWidth : Flag<["-"], "fno-aapcs-bitfield-width">, Group, Flags<[NoXarchOption,CC1Option]>, HelpText<"Do not follow the AAPCS standard requirement that volatile bit-field width is dictated by the field container type. (ARM only).">; @@ -2647,8 +2705,10 @@ def mignore_xcoff_visibility : Flag<["-"], "mignore-xcoff-visibility">, Group, HelpText<"Not emit the visibility attribute for asm in AIX OS or give all symbols 'unspecified' visibility in XCOFF object file">, Flags<[CC1Option]>; +// todo: join into single OptOutMFlag def mbackchain : Flag<["-"], "mbackchain">, Group, Flags<[NoXarchOption,CC1Option]>, - HelpText<"Link stack frames through backchain on System Z">; + HelpText<"Link stack frames through backchain on System Z">, + MarshallingInfoFlag<"CodeGenOpts.Backchain">; def mno_backchain : Flag<["-"], "mno-backchain">, Group, Flags<[NoXarchOption,CC1Option]>; def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings">, Group; @@ -2662,10 +2722,12 @@ HelpText<"Enable direct TLS access through segment registers (default)">; def mregparm_EQ : Joined<["-"], "mregparm=">, Group; def mrelax_all : Flag<["-"], "mrelax-all">, Group, Flags<[CC1Option,CC1AsOption]>, - HelpText<"(integrated-as) Relax all machine instructions">; + HelpText<"(integrated-as) Relax all machine instructions">, + MarshallingInfoFlag<"CodeGenOpts.RelaxAll">; def mincremental_linker_compatible : Flag<["-"], "mincremental-linker-compatible">, Group, Flags<[CC1Option,CC1AsOption]>, - HelpText<"(integrated-as) Emit an object file which can be used with an incremental linker">; + HelpText<"(integrated-as) Emit an object file which can be used with an incremental linker">, + MarshallingInfoFlag<"CodeGenOpts.IncrementalLinkerCompatible">; def mno_incremental_linker_compatible : Flag<["-"], "mno-incremental-linker-compatible">, Group, HelpText<"(integrated-as) Emit an object file which cannot be used with an incremental linker">; def mrtd : Flag<["-"], "mrtd">, Group, Flags<[CC1Option]>, @@ -2673,7 +2735,8 @@ def msmall_data_threshold_EQ : Joined <["-"], "msmall-data-threshold=">, Group, Alias; def msoft_float : Flag<["-"], "msoft-float">, Group, Flags<[CC1Option]>, - HelpText<"Use software floating point">; + HelpText<"Use software floating point">, + MarshallingInfoFlag<"CodeGenOpts.SoftFloat">; def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group, HelpText<"Don't generate implicit floating point instructions">; def mimplicit_float : Flag<["-"], "mimplicit-float">, Group; @@ -2687,18 +2750,24 @@ HelpText<"Use the given offset for addressing the stack-protector guard">; def mstack_protector_guard_reg_EQ : Joined<["-"], "mstack-protector-guard-reg=">, Group, Flags<[CC1Option]>, HelpText<"Use the given reg for addressing the stack-protector guard">; +// todo: join into OptInMFlag def mpie_copy_relocations : Flag<["-"], "mpie-copy-relocations">, Group, Flags<[CC1Option]>, - HelpText<"Use copy relocations support for PIE builds">; + HelpText<"Use copy relocations support for PIE builds">, + MarshallingInfoFlag<"CodeGenOpts.PIECopyRelocations">; def mno_pie_copy_relocations : Flag<["-"], "mno-pie-copy-relocations">, Group; def mfentry : Flag<["-"], "mfentry">, HelpText<"Insert calls to fentry at function entry (x86/SystemZ only)">, - Flags<[CC1Option]>, Group; + Flags<[CC1Option]>, Group, + MarshallingInfoFlag<"CodeGenOpts.CallFEntry">; def mnop_mcount : Flag<["-"], "mnop-mcount">, HelpText<"Generate mcount/__fentry__ calls as nops. To activate they need to be patched in.">, - Flags<[CC1Option]>, Group; + Flags<[CC1Option]>, Group, + MarshallingInfoFlag<"CodeGenOpts.MNopMCount">; def mrecord_mcount : Flag<["-"], "mrecord-mcount">, HelpText<"Generate a __mcount_loc section entry for each __fentry__ call.">, - Flags<[CC1Option]>, Group; + Flags<[CC1Option]>, Group, + MarshallingInfoFlag<"CodeGenOpts.RecordMCount">; def mpacked_stack : Flag<["-"], "mpacked-stack">, HelpText<"Use packed stack layout (SystemZ only).">, - Flags<[CC1Option]>, Group; + Flags<[CC1Option]>, Group, + MarshallingInfoFlag<"CodeGenOpts.PackedStack">; def mno_packed_stack : Flag<["-"], "mno-packed-stack">, Flags<[CC1Option]>, Group; def mips16 : Flag<["-"], "mips16">, Group; def mno_mips16 : Flag<["-"], "mno-mips16">, Group; @@ -2893,7 +2962,8 @@ 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 pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC1Option]>, + MarshallingInfoFlag<"CodeGenOpts.InstrumentForProfiling">; def pipe : Flag<["-", "--"], "pipe">, HelpText<"Use pipes between commands, when possible">; def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">; @@ -3059,7 +3129,8 @@ MetaVarName<"">; def y : Joined<["-"], "y">; -defm integrated_as : OptOutFFlag<"integrated-as", "Enable the integrated assembler", "Disable the integrated assembler">; +defm integrated_as : OptOutFFlag<"integrated-as", "Enable", "Disable", " the integrated assembler", + [], "CodeGenOpts.DisableIntegratedAS">; def fintegrated_cc1 : Flag<["-"], "fintegrated-cc1">, Flags<[CoreOption, NoXarchOption]>, Group, @@ -3835,7 +3906,8 @@ let Flags = [CC1Option, CC1AsOption, NoDriverOption] in { def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">; def debug_info_macro : Flag<["-"], "debug-info-macro">, - HelpText<"Emit macro debug information">; + HelpText<"Emit macro debug information">, + MarshallingInfoFlag<"CodeGenOpts.MacroDebugInfo">; def default_function_attr : Separate<["-"], "default-function-attr">, HelpText<"Apply given attribute to all functions">; def dwarf_version_EQ : Joined<["-"], "dwarf-version=">; @@ -3849,17 +3921,22 @@ def compress_debug_sections : Flag<["-", "--"], "compress-debug-sections">, Alias, AliasArgs<["zlib"]>; def mno_exec_stack : Flag<["-"], "mnoexecstack">, - HelpText<"Mark the file as not needing an executable stack">; + HelpText<"Mark the file as not needing an executable stack">, + MarshallingInfoFlag<"CodeGenOpts.NoExecStack">; def massembler_no_warn : Flag<["-"], "massembler-no-warn">, - HelpText<"Make assembler not emit warnings">; + HelpText<"Make assembler not emit warnings">, + MarshallingInfoFlag<"CodeGenOpts.NoWarn">; def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">, - HelpText<"Make assembler warnings fatal">; + HelpText<"Make assembler warnings fatal">, + MarshallingInfoFlag<"CodeGenOpts.FatalWarnings">; def mrelax_relocations : Flag<["--"], "mrelax-relocations">, - HelpText<"Use relaxable elf relocations">; + HelpText<"Use relaxable elf relocations">, + MarshallingInfoFlag<"CodeGenOpts.RelaxELFRelocations">; def msave_temp_labels : Flag<["-"], "msave-temp-labels">, HelpText<"Save temporary labels in the symbol table. " "Note this may change .s semantics and shouldn't generally be used " - "on compiler-generated code.">; + "on compiler-generated code.">, + MarshallingInfoFlag<"CodeGenOpts.SaveTempLabels">; def mrelocation_model : Separate<["-"], "mrelocation-model">, HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">, NormalizedValuesScope<"llvm::Reloc">, @@ -3873,36 +3950,47 @@ } def disable_llvm_verifier : Flag<["-"], "disable-llvm-verifier">, - HelpText<"Don't run the LLVM IR verifier pass">; + HelpText<"Don't run the LLVM IR verifier pass">, + MarshallingInfoFlag<"CodeGenOpts.VerifyModule", "true">, IsNegative; def disable_llvm_passes : Flag<["-"], "disable-llvm-passes">, HelpText<"Use together with -emit-llvm to get pristine LLVM IR from the " - "frontend by not running any LLVM passes at all">; + "frontend by not running any LLVM passes at all">, + MarshallingInfoFlag<"CodeGenOpts.DisableLLVMPasses">; def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">, Alias; def disable_lifetimemarkers : Flag<["-"], "disable-lifetime-markers">, HelpText<"Disable lifetime-markers emission even when optimizations are " - "enabled">; + "enabled">, + MarshallingInfoFlag<"CodeGenOpts.DisableLifetimeMarkers">; def disable_O0_optnone : Flag<["-"], "disable-O0-optnone">, - HelpText<"Disable adding the optnone attribute to functions at O0">; + HelpText<"Disable adding the optnone attribute to functions at O0">, + MarshallingInfoFlag<"CodeGenOpts.DisableO0ImplyOptNone">; def disable_red_zone : Flag<["-"], "disable-red-zone">, - HelpText<"Do not emit code that uses the red zone.">; + HelpText<"Do not emit code that uses the red zone.">, + MarshallingInfoFlag<"CodeGenOpts.DisableRedZone">; def dwarf_ext_refs : Flag<["-"], "dwarf-ext-refs">, HelpText<"Generate debug info with external references to clang modules" - " or precompiled headers">; + " or precompiled headers">, + MarshallingInfoFlag<"CodeGenOpts.DebugTypeExtRefs">; def dwarf_explicit_import : Flag<["-"], "dwarf-explicit-import">, HelpText<"Generate explicit import from anonymous namespace to containing" - " scope">; + " scope">, + MarshallingInfoFlag<"CodeGenOpts.DebugExplicitImport">; def debug_forward_template_params : Flag<["-"], "debug-forward-template-params">, HelpText<"Emit complete descriptions of template parameters in forward" - " declarations">; + " declarations">, + MarshallingInfoFlag<"CodeGenOpts.DebugFwdTemplateParams">; def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">, - HelpText<"Emit an error if a C++ static local initializer would need a guard variable">; + HelpText<"Emit an error if a C++ static local initializer would need a guard variable">, + MarshallingInfoFlag<"CodeGenOpts.ForbidGuardVariables">; def no_implicit_float : Flag<["-"], "no-implicit-float">, - HelpText<"Don't generate implicit floating point instructions">; + HelpText<"Don't generate implicit floating point instructions">, + MarshallingInfoFlag<"CodeGenOpts.NoImplicitFloat">; def fdump_vtable_layouts : Flag<["-"], "fdump-vtable-layouts">, HelpText<"Dump the layouts of all vtables that will be emitted in a translation unit">; def fmerge_functions : Flag<["-"], "fmerge-functions">, - HelpText<"Permit merging of identical functions when optimizing.">; + HelpText<"Permit merging of identical functions when optimizing.">, + MarshallingInfoFlag<"CodeGenOpts.MergeFunctions">; def coverage_data_file : Separate<["-"], "coverage-data-file">, HelpText<"Emit coverage data to this filename.">; def coverage_data_file_EQ : Joined<["-"], "coverage-data-file=">, @@ -3914,13 +4002,17 @@ def coverage_version_EQ : Joined<["-"], "coverage-version=">, HelpText<"Four-byte version string for gcov files.">; def dump_coverage_mapping : Flag<["-"], "dump-coverage-mapping">, - HelpText<"Dump the coverage mapping records, for testing">; + HelpText<"Dump the coverage mapping records, for testing">, + MarshallingInfoFlag<"CodeGenOpts.DumpCoverageMapping">; def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">, - HelpText<"Use register sized accesses to bit-fields, when possible.">; + HelpText<"Use register sized accesses to bit-fields, when possible.">, + MarshallingInfoFlag<"CodeGenOpts.UseRegisterSizedBitfieldAccess">; def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">, - HelpText<"Turn off Type Based Alias Analysis">; + HelpText<"Turn off Type Based Alias Analysis">, + MarshallingInfoFlag<"CodeGenOpts.RelaxedAliasing">; def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">, - HelpText<"Turn off struct-path aware Type Based Alias Analysis">; + HelpText<"Turn off struct-path aware Type Based Alias Analysis">, + MarshallingInfoFlag<"CodeGenOpts.StructPathTBAA", "true">, IsNegative; def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">, HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">; def mdebug_pass : Separate<["-"], "mdebug-pass">, @@ -3928,7 +4020,8 @@ def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">, HelpText<"Specify which frame pointers to retain (all, non-leaf, none).">, Values<"all,non-leaf,none">; def mdisable_tail_calls : Flag<["-"], "mdisable-tail-calls">, - HelpText<"Disable tail call optimization, keeping the call stack accurate">; + HelpText<"Disable tail call optimization, keeping the call stack accurate">, + MarshallingInfoFlag<"CodeGenOpts.DisableTailCalls">; def menable_no_infinities : Flag<["-"], "menable-no-infs">, HelpText<"Allow optimization to assume there are no infinities.">, MarshallingInfoFlag<"LangOpts->NoHonorInfs">, ImpliedByAnyOf<[ffinite_math_only]>; @@ -3947,15 +4040,18 @@ def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">, HelpText<"Limit float precision to the given value">; def split_stacks : Flag<["-"], "split-stacks">, - HelpText<"Try to use a split stack if possible.">; + HelpText<"Try to use a split stack if possible.">, + MarshallingInfoFlag<"CodeGenOpts.EnableSegmentedStacks">; def mregparm : Separate<["-"], "mregparm">, HelpText<"Limit the number of registers available for integer arguments">; def msmall_data_limit : Separate<["-"], "msmall-data-limit">, HelpText<"Put global and static data smaller than the limit into a special section">; def munwind_tables : Flag<["-"], "munwind-tables">, - HelpText<"Generate unwinding tables for all functions">; + HelpText<"Generate unwinding tables for all functions">, + MarshallingInfoFlag<"CodeGenOpts.UnwindTables">; def mconstructor_aliases : Flag<["-"], "mconstructor-aliases">, - HelpText<"Emit complete constructors and destructors as aliases when possible">; + HelpText<"Emit complete constructors and destructors as aliases when possible">, + MarshallingInfoFlag<"CodeGenOpts.CXXCtorDtorAliases">; def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">, HelpText<"Link the given bitcode file before performing optimizations.">; def mlink_builtin_bitcode : Separate<["-"], "mlink-builtin-bitcode">, @@ -3964,9 +4060,11 @@ def mlink_cuda_bitcode : Separate<["-"], "mlink-cuda-bitcode">, Alias; def vectorize_loops : Flag<["-"], "vectorize-loops">, - HelpText<"Run the Loop vectorization passes">; + HelpText<"Run the Loop vectorization passes">, + MarshallingInfoFlag<"CodeGenOpts.VectorizeLoop">; def vectorize_slp : Flag<["-"], "vectorize-slp">, - HelpText<"Run the SLP vectorization passes">; + HelpText<"Run the SLP vectorization passes">, + MarshallingInfoFlag<"CodeGenOpts.VectorizeSLP">; def dependent_lib : Joined<["--"], "dependent-lib=">, HelpText<"Add dependent library">; def linker_option : Joined<["--"], "linker-option=">, @@ -3975,43 +4073,56 @@ HelpText<"Sanitizer coverage type">; def fsanitize_coverage_indirect_calls : Flag<["-"], "fsanitize-coverage-indirect-calls">, - HelpText<"Enable sanitizer coverage for indirect calls">; + HelpText<"Enable sanitizer coverage for indirect calls">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageIndirectCalls">; def fsanitize_coverage_trace_bb : Flag<["-"], "fsanitize-coverage-trace-bb">, - HelpText<"Enable basic block tracing in sanitizer coverage">; + HelpText<"Enable basic block tracing in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageTraceBB">; def fsanitize_coverage_trace_cmp : Flag<["-"], "fsanitize-coverage-trace-cmp">, - HelpText<"Enable cmp instruction tracing in sanitizer coverage">; + HelpText<"Enable cmp instruction tracing in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageTraceCmp">; def fsanitize_coverage_trace_div : Flag<["-"], "fsanitize-coverage-trace-div">, - HelpText<"Enable div instruction tracing in sanitizer coverage">; + HelpText<"Enable div instruction tracing in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageTraceDiv">; def fsanitize_coverage_trace_gep : Flag<["-"], "fsanitize-coverage-trace-gep">, - HelpText<"Enable gep instruction tracing in sanitizer coverage">; + HelpText<"Enable gep instruction tracing in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageTraceGep">; def fsanitize_coverage_8bit_counters : Flag<["-"], "fsanitize-coverage-8bit-counters">, - HelpText<"Enable frequency counters in sanitizer coverage">; + HelpText<"Enable frequency counters in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverage8bitCounters">; def fsanitize_coverage_inline_8bit_counters : Flag<["-"], "fsanitize-coverage-inline-8bit-counters">, - HelpText<"Enable inline 8-bit counters in sanitizer coverage">; + HelpText<"Enable inline 8-bit counters in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageInline8bitCounters">; def fsanitize_coverage_inline_bool_flag : Flag<["-"], "fsanitize-coverage-inline-bool-flag">, - HelpText<"Enable inline bool flag in sanitizer coverage">; + HelpText<"Enable inline bool flag in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageInlineBoolFlag">; def fsanitize_coverage_pc_table : Flag<["-"], "fsanitize-coverage-pc-table">, - HelpText<"Create a table of coverage-instrumented PCs">; + HelpText<"Create a table of coverage-instrumented PCs">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoveragePCTable">; def fsanitize_coverage_trace_pc : Flag<["-"], "fsanitize-coverage-trace-pc">, - HelpText<"Enable PC tracing in sanitizer coverage">; + HelpText<"Enable PC tracing in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageTracePC">; def fsanitize_coverage_trace_pc_guard : Flag<["-"], "fsanitize-coverage-trace-pc-guard">, - HelpText<"Enable PC tracing with guard in sanitizer coverage">; + HelpText<"Enable PC tracing with guard in sanitizer coverage">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageTracePCGuard">; def fsanitize_coverage_no_prune : Flag<["-"], "fsanitize-coverage-no-prune">, - HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">; + HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageNoPrune">; def fsanitize_coverage_stack_depth : Flag<["-"], "fsanitize-coverage-stack-depth">, - HelpText<"Enable max stack depth tracing">; + HelpText<"Enable max stack depth tracing">, + MarshallingInfoFlag<"CodeGenOpts.SanitizeCoverageStackDepth">; def fpatchable_function_entry_offset_EQ : Joined<["-"], "fpatchable-function-entry-offset=">, MetaVarName<"">, HelpText<"Generate M NOPs before function entry">; @@ -4026,17 +4137,17 @@ HelpText<"Specify the profile path in PGO use compilation">; def flto_visibility_public_std: Flag<["-"], "flto-visibility-public-std">, - HelpText<"Use public LTO visibility for classes in std and stdext namespaces">; -def flto_unit: Flag<["-"], "flto-unit">, - HelpText<"Emit IR to support LTO unit features (CFI, whole program vtable opt)">; -def fno_lto_unit: Flag<["-"], "fno-lto-unit">; -def fdebug_pass_manager : Flag<["-"], "fdebug-pass-manager">, - HelpText<"Prints debug information for the new pass manager">; -def fno_debug_pass_manager : Flag<["-"], "fno-debug-pass-manager">, - HelpText<"Disables debug printing for the new pass manager">; + HelpText<"Use public LTO visibility for classes in std and stdext namespaces">, + MarshallingInfoFlag<"CodeGenOpts.LTOVisibilityPublicStd">; +defm lto_unit : BooleanMarshalledFFlag<"lto-unit", "CodeGenOpts.LTOUnit", "false", + "Emit IR to support LTO unit features (CFI, whole program vtable opt)">; +defm debug_pass_manager : BooleanMarshalledFFlag<"debug-pass-manager", "CodeGenOpts.DebugPassManager", + "false", "Prints debug information for the new pass manager", + "Disables debug information for the new pass manager">; def fexperimental_debug_variable_locations : Flag<["-"], "fexperimental-debug-variable-locations">, - HelpText<"Use experimental new value-tracking variable locations">; + HelpText<"Use experimental new value-tracking variable locations">, + MarshallingInfoFlag<"CodeGenOpts.ValueTrackingVariableLocations">; // The driver option takes the key as a parameter to the -msign-return-address= // and -mbranch-protection= options, but CC1 has a separate option so we // don't have to parse the parameter twice. @@ -4045,9 +4156,11 @@ def mbranch_target_enforce : Flag<["-"], "mbranch-target-enforce">; def fno_dllexport_inlines : Flag<["-"], "fno-dllexport-inlines">; def cfguard_no_checks : Flag<["-"], "cfguard-no-checks">, - HelpText<"Emit Windows Control Flow Guard tables only (no checks)">; + HelpText<"Emit Windows Control Flow Guard tables only (no checks)">, + MarshallingInfoFlag<"CodeGenOpts.ControlFlowGuardNoChecks">; def cfguard : Flag<["-"], "cfguard">, - HelpText<"Emit Windows Control Flow Guard tables and checks">; + HelpText<"Emit Windows Control Flow Guard tables and checks">, + MarshallingInfoFlag<"CodeGenOpts.ControlFlowGuard">; def fdenormal_fp_math_f32_EQ : Joined<["-"], "fdenormal-fp-math-f32=">, Group; @@ -4159,7 +4272,8 @@ HelpText<"Disable freeing of memory on exit">, MarshallingInfoFlag<"FrontendOpts.DisableFree">; def discard_value_names : Flag<["-"], "discard-value-names">, - HelpText<"Discard value names in LLVM IR">; + HelpText<"Discard value names in LLVM IR">, + MarshallingInfoFlag<"CodeGenOpts.DiscardValueNames">; def load : Separate<["-"], "load">, MetaVarName<"">, HelpText<"Load the named plugin (dynamic shared object)">; def plugin : Separate<["-"], "plugin">, MetaVarName<"">, @@ -4300,10 +4414,12 @@ HelpText<"Print the output of the dependency directives source minimizer">; } -def emit_llvm_uselists : Flag<["-"], "emit-llvm-uselists">, - HelpText<"Preserve order of LLVM use-lists when serializing">; +// todo: join into one OptInFlag def no_emit_llvm_uselists : Flag<["-"], "no-emit-llvm-uselists">, HelpText<"Don't preserve order of LLVM use-lists when serializing">; +def emit_llvm_uselists : Flag<["-"], "emit-llvm-uselists">, + HelpText<"Preserve order of LLVM use-lists when serializing">, + MarshallingInfoBooleanFlag<"CodeGenOpts.EmitLLVMUseLists", "false", no_emit_llvm_uselists>; def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">, HelpText<"Directory for temporary files produced during ARC or ObjC migration">; @@ -4478,7 +4594,8 @@ def fdeclare_opencl_builtins : Flag<["-"], "fdeclare-opencl-builtins">, HelpText<"Add OpenCL builtin function declarations (experimental)">; def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">, - HelpText<"Preserve 3-component vector type">; + HelpText<"Preserve 3-component vector type">, + MarshallingInfoFlag<"CodeGenOpts.PreserveVec3Type">; def fwchar_type_EQ : Joined<["-"], "fwchar-type=">, HelpText<"Select underlying type for wchar_t">, Values<"char,short,int">; def fsigned_wchar : Flag<["-"], "fsigned-wchar">, @@ -4490,7 +4607,8 @@ "the type system guarantees when a parameter is qualified id">; def fpass_by_value_is_noalias: Flag<["-"], "fpass-by-value-is-noalias">, HelpText<"Allows assuming by-value parameters do not alias any other value. " - "Has no effect on non-trivially-copyable classes in C++.">, Group; + "Has no effect on non-trivially-copyable classes in C++.">, Group, + MarshallingInfoFlag<"CodeGenOpts.PassByValueIsNoAlias">; // FIXME: Remove these entirely once functionality/tests have been excised. def fobjc_gc_only : Flag<["-"], "fobjc-gc-only">, Group, 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 @@ -285,9 +285,11 @@ DiagnosticOptions &DiagOpts = Invocation.getDiagnosticOpts(); CodeGenOptions &CodeGenOpts = Invocation.getCodeGenOpts(); FrontendOptions &FrontendOpts = Invocation.getFrontendOpts(); + CodeGenOpts.XRayInstrumentFunctions = LangOpts.XRayInstrument; CodeGenOpts.XRayAlwaysEmitCustomEvents = LangOpts.XRayAlwaysEmitCustomEvents; CodeGenOpts.XRayAlwaysEmitTypedEvents = LangOpts.XRayAlwaysEmitTypedEvents; + CodeGenOpts.DisableFree = FrontendOpts.DisableFree; FrontendOpts.GenerateGlobalModuleIndex = FrontendOpts.UseGlobalModuleIndex; llvm::sys::Process::UseANSIEscapeCodes(DiagOpts.UseANSIEscapeCodes); @@ -826,10 +828,6 @@ } } - Opts.DebugPassManager = - Args.hasFlag(OPT_fdebug_pass_manager, OPT_fno_debug_pass_manager, - /* Default */ false); - if (Arg *A = Args.getLastArg(OPT_fveclib)) { StringRef Name = A->getValue(); if (Name == "Accelerate") @@ -881,23 +879,9 @@ Opts.setDebuggerTuning(static_cast(Val)); } Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags); - Opts.DebugColumnInfo = !Args.hasArg(OPT_gno_column_info); - Opts.EmitCodeView = Args.hasArg(OPT_gcodeview); - Opts.CodeViewGHash = Args.hasArg(OPT_gcodeview_ghash); - Opts.MacroDebugInfo = Args.hasArg(OPT_debug_info_macro); - Opts.WholeProgramVTables = Args.hasArg(OPT_fwhole_program_vtables); - Opts.VirtualFunctionElimination = - Args.hasArg(OPT_fvirtual_function_elimination); - Opts.LTOVisibilityPublicStd = Args.hasArg(OPT_flto_visibility_public_std); Opts.SplitDwarfFile = std::string(Args.getLastArgValue(OPT_split_dwarf_file)); Opts.SplitDwarfOutput = std::string(Args.getLastArgValue(OPT_split_dwarf_output)); - Opts.SplitDwarfInlining = !Args.hasArg(OPT_fno_split_dwarf_inlining); - Opts.DebugTypeExtRefs = Args.hasArg(OPT_dwarf_ext_refs); - Opts.DebugExplicitImport = Args.hasArg(OPT_dwarf_explicit_import); - Opts.DebugFwdTemplateParams = Args.hasArg(OPT_debug_forward_template_params); - Opts.EmbedSource = Args.hasArg(OPT_gembed_source); - Opts.ForceDwarfFrameSection = Args.hasArg(OPT_fforce_dwarf_frame); for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ)) { auto Split = StringRef(Arg).split('='); @@ -905,13 +889,6 @@ {std::string(Split.first), std::string(Split.second)}); } - if (const Arg *A = - Args.getLastArg(OPT_emit_llvm_uselists, OPT_no_emit_llvm_uselists)) - Opts.EmitLLVMUseLists = A->getOption().getID() == OPT_emit_llvm_uselists; - - Opts.DisableLLVMPasses = Args.hasArg(OPT_disable_llvm_passes); - Opts.DisableLifetimeMarkers = Args.hasArg(OPT_disable_lifetimemarkers); - const llvm::Triple::ArchType DebugEntryValueArchs[] = { llvm::Triple::x86, llvm::Triple::x86_64, llvm::Triple::aarch64, llvm::Triple::arm, llvm::Triple::armeb, llvm::Triple::mips, @@ -922,30 +899,12 @@ llvm::is_contained(DebugEntryValueArchs, T.getArch())) Opts.EmitCallSiteInfo = true; - Opts.ValueTrackingVariableLocations = - Args.hasArg(OPT_fexperimental_debug_variable_locations); - - Opts.DisableO0ImplyOptNone = Args.hasArg(OPT_disable_O0_optnone); - Opts.DisableRedZone = Args.hasArg(OPT_disable_red_zone); - Opts.IndirectTlsSegRefs = Args.hasArg(OPT_mno_tls_direct_seg_refs); - Opts.ForbidGuardVariables = Args.hasArg(OPT_fforbid_guard_variables); - Opts.UseRegisterSizedBitfieldAccess = Args.hasArg( - OPT_fuse_register_sized_bitfield_access); - Opts.RelaxedAliasing = Args.hasArg(OPT_relaxed_aliasing); - Opts.StructPathTBAA = !Args.hasArg(OPT_no_struct_path_tbaa); Opts.NewStructPathTBAA = !Args.hasArg(OPT_no_struct_path_tbaa) && Args.hasArg(OPT_new_struct_path_tbaa); - Opts.FineGrainedBitfieldAccesses = - Args.hasFlag(OPT_ffine_grained_bitfield_accesses, - OPT_fno_fine_grained_bitfield_accesses, false); Opts.DwarfDebugFlags = std::string(Args.getLastArgValue(OPT_dwarf_debug_flags)); Opts.RecordCommandLine = std::string(Args.getLastArgValue(OPT_record_command_line)); - Opts.MergeAllConstants = Args.hasArg(OPT_fmerge_all_constants); - Opts.NoCommon = !Args.hasArg(OPT_fcommon); - Opts.NoInlineLineTables = Args.hasArg(OPT_gno_inline_line_tables); - Opts.NoImplicitFloat = Args.hasArg(OPT_no_implicit_float); Opts.OptimizeSize = getOptimizationLevelSize(Args); Opts.SimplifyLibCalls = !(Args.hasArg(OPT_fno_builtin) || Args.hasArg(OPT_ffreestanding)); @@ -954,24 +913,17 @@ Opts.UnrollLoops = Args.hasFlag(OPT_funroll_loops, OPT_fno_unroll_loops, (Opts.OptimizationLevel > 1)); - Opts.RerollLoops = Args.hasArg(OPT_freroll_loops); - Opts.DisableIntegratedAS = Args.hasArg(OPT_fno_integrated_as); - Opts.Autolink = !Args.hasArg(OPT_fno_autolink); Opts.SampleProfileFile = std::string(Args.getLastArgValue(OPT_fprofile_sample_use_EQ)); - Opts.DebugInfoForProfiling = Args.hasFlag( - OPT_fdebug_info_for_profiling, OPT_fno_debug_info_for_profiling, false); Opts.DebugNameTable = static_cast( Args.hasArg(OPT_ggnu_pubnames) ? llvm::DICompileUnit::DebugNameTableKind::GNU : Args.hasArg(OPT_gpubnames) ? llvm::DICompileUnit::DebugNameTableKind::Default : llvm::DICompileUnit::DebugNameTableKind::None); - Opts.DebugRangesBaseAddress = Args.hasArg(OPT_fdebug_ranges_base_address); setPGOInstrumentor(Opts, Args, Diags); - Opts.AtomicProfileUpdate = Args.hasArg(OPT_fprofile_update_EQ); Opts.InstrProfileOutput = std::string(Args.getLastArgValue(OPT_fprofile_instrument_path_EQ)); Opts.ProfileInstrumentUsePath = @@ -986,17 +938,6 @@ << "-fexperimental-new-pass-manager"; } - Opts.CoverageMapping = - Args.hasFlag(OPT_fcoverage_mapping, OPT_fno_coverage_mapping, false); - Opts.DumpCoverageMapping = Args.hasArg(OPT_dump_coverage_mapping); - Opts.AsmVerbose = !Args.hasArg(OPT_fno_verbose_asm); - Opts.PreserveAsmComments = !Args.hasArg(OPT_fno_preserve_as_comments); - Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); - Opts.ObjCAutoRefCountExceptions = Args.hasArg(OPT_fobjc_arc_exceptions); - Opts.CXAAtExit = !Args.hasArg(OPT_fno_use_cxa_atexit); - Opts.RegisterGlobalDtorsWithAtExit = - Args.hasArg(OPT_fregister_global_dtors_with_atexit); - Opts.CXXCtorDtorAliases = Args.hasArg(OPT_mconstructor_aliases); Opts.CodeModel = TargetOpts.CodeModel; Opts.DebugPass = std::string(Args.getLastArgValue(OPT_mdebug_pass)); @@ -1020,40 +961,14 @@ Opts.setFramePointer(FP); } - Opts.DisableFree = Args.hasArg(OPT_disable_free); - Opts.DiscardValueNames = Args.hasArg(OPT_discard_value_names); - Opts.DisableTailCalls = Args.hasArg(OPT_mdisable_tail_calls); - Opts.NoEscapingBlockTailCalls = - Args.hasArg(OPT_fno_escaping_block_tail_calls); Opts.FloatABI = std::string(Args.getLastArgValue(OPT_mfloat_abi)); Opts.LimitFloatPrecision = std::string(Args.getLastArgValue(OPT_mlimit_float_precision)); Opts.Reciprocals = Args.getAllArgValues(OPT_mrecip_EQ); - Opts.StrictFloatCastOverflow = - !Args.hasArg(OPT_fno_strict_float_cast_overflow); - Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_fno_zero_initialized_in_bss); Opts.NumRegisterParameters = getLastArgIntValue(Args, OPT_mregparm, 0, Diags); - Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack); Opts.SmallDataLimit = getLastArgIntValue(Args, OPT_msmall_data_limit, 0, Diags); - Opts.FatalWarnings = Args.hasArg(OPT_massembler_fatal_warnings); - Opts.NoWarn = Args.hasArg(OPT_massembler_no_warn); - Opts.EnableSegmentedStacks = Args.hasArg(OPT_split_stacks); - Opts.RelaxAll = Args.hasArg(OPT_mrelax_all); - Opts.IncrementalLinkerCompatible = - Args.hasArg(OPT_mincremental_linker_compatible); - Opts.PIECopyRelocations = - Args.hasArg(OPT_mpie_copy_relocations); - Opts.NoPLT = Args.hasArg(OPT_fno_plt); - Opts.SaveTempLabels = Args.hasArg(OPT_msave_temp_labels); - Opts.NoDwarfDirectoryAsm = Args.hasArg(OPT_fno_dwarf_directory_asm); - Opts.SoftFloat = Args.hasArg(OPT_msoft_float); - Opts.StrictEnums = Args.hasArg(OPT_fstrict_enums); - Opts.StrictReturn = !Args.hasArg(OPT_fno_strict_return); - Opts.StrictVTablePointers = Args.hasArg(OPT_fstrict_vtable_pointers); - Opts.ForceEmitVTables = Args.hasArg(OPT_fforce_emit_vtables); - Opts.UnwindTables = Args.hasArg(OPT_munwind_tables); Opts.ThreadModel = std::string(Args.getLastArgValue(OPT_mthread_model, "posix")); if (Opts.ThreadModel != "posix" && Opts.ThreadModel != "single") @@ -1061,7 +976,6 @@ << Args.getLastArg(OPT_mthread_model)->getAsString(Args) << Opts.ThreadModel; Opts.TrapFuncName = std::string(Args.getLastArgValue(OPT_ftrap_function_EQ)); - Opts.UseInitArray = !Args.hasArg(OPT_fno_use_init_array); Opts.BBSections = std::string(Args.getLastArgValue(OPT_fbasic_block_sections_EQ, "none")); @@ -1071,24 +985,6 @@ Args.hasArg(OPT_ffunction_sections) || (Opts.BBSections != "none" && Opts.BBSections != "labels"); - 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.UniqueBasicBlockSectionNames = - Args.hasArg(OPT_funique_basic_block_section_names); - Opts.UniqueInternalLinkageNames = - Args.hasArg(OPT_funique_internal_linkage_names); - - Opts.SplitMachineFunctions = Args.hasArg(OPT_fsplit_machine_functions); - - Opts.MergeFunctions = Args.hasArg(OPT_fmerge_functions); - - Opts.NoUseJumpTables = Args.hasArg(OPT_fno_jump_tables); - - Opts.NullPointerIsValid = Args.hasArg(OPT_fno_delete_null_pointer_checks); - - Opts.ProfileSampleAccurate = Args.hasArg(OPT_fprofile_sample_accurate); - Opts.PrepareForLTO = Args.hasArg(OPT_flto, OPT_flto_EQ); Opts.PrepareForThinLTO = false; if (Arg *A = Args.getLastArg(OPT_flto_EQ)) { @@ -1098,8 +994,6 @@ else if (S != "full") Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << S; } - Opts.LTOUnit = Args.hasFlag(OPT_flto_unit, OPT_fno_lto_unit, false); - Opts.EnableSplitLTOUnit = Args.hasArg(OPT_fsplit_lto_unit); if (Arg *A = Args.getLastArg(OPT_fthinlto_index_EQ)) { if (IK.getLanguage() != Language::LLVM_IR) Diags.Report(diag::err_drv_argument_only_allowed_with) @@ -1126,21 +1020,11 @@ } else if (Args.hasArg(OPT_fmemory_profile)) Opts.MemoryProfileOutput = MemProfileBasename; - Opts.MSVolatile = Args.hasArg(OPT_fms_volatile); - - Opts.VectorizeLoop = Args.hasArg(OPT_vectorize_loops); - Opts.VectorizeSLP = Args.hasArg(OPT_vectorize_slp); - Opts.PreferVectorWidth = std::string(Args.getLastArgValue(OPT_mprefer_vector_width_EQ)); Opts.MainFileName = std::string(Args.getLastArgValue(OPT_main_file_name)); - Opts.VerifyModule = !Args.hasArg(OPT_disable_llvm_verifier); - Opts.ControlFlowGuardNoChecks = Args.hasArg(OPT_cfguard_no_checks); - Opts.ControlFlowGuard = Args.hasArg(OPT_cfguard); - - Opts.EmitGcovNotes = Args.hasArg(OPT_ftest_coverage); Opts.EmitGcovArcs = Args.hasArg(OPT_fprofile_arcs); if (Opts.EmitGcovArcs || Opts.EmitGcovNotes) { Opts.CoverageDataFile = @@ -1199,13 +1083,6 @@ } } - Opts.PreserveVec3Type = Args.hasArg(OPT_fpreserve_vec3_type); - Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions); - Opts.InstrumentFunctionsAfterInlining = - Args.hasArg(OPT_finstrument_functions_after_inlining); - Opts.InstrumentFunctionEntryBare = - Args.hasArg(OPT_finstrument_function_entry_bare); - Opts.XRayInstructionThreshold = getLastArgIntValue(Args, OPT_fxray_instruction_threshold_EQ, 200, Diags); Opts.XRayTotalFunctionGroups = @@ -1226,11 +1103,6 @@ getLastArgIntValue(Args, OPT_fpatchable_function_entry_EQ, 0, Diags); Opts.PatchableFunctionEntryOffset = getLastArgIntValue( Args, OPT_fpatchable_function_entry_offset_EQ, 0, Diags); - Opts.InstrumentForProfiling = Args.hasArg(OPT_pg); - Opts.CallFEntry = Args.hasArg(OPT_mfentry); - Opts.MNopMCount = Args.hasArg(OPT_mnop_mcount); - Opts.RecordMCount = Args.hasArg(OPT_mrecord_mcount); - Opts.PackedStack = Args.hasArg(OPT_mpacked_stack); if (const Arg *A = Args.getLastArg(OPT_fcf_protection_EQ)) { StringRef Name = A->getValue(); @@ -1256,7 +1128,6 @@ Opts.setCompressDebugSections(DCT); } - Opts.RelaxELFRelocations = Args.hasArg(OPT_mrelax_relocations); Opts.DebugCompilationDir = std::string(Args.getLastArgValue(OPT_fdebug_compilation_dir)); for (auto *A : @@ -1274,61 +1145,12 @@ } Opts.SanitizeCoverageType = getLastArgIntValue(Args, OPT_fsanitize_coverage_type, 0, Diags); - Opts.SanitizeCoverageIndirectCalls = - Args.hasArg(OPT_fsanitize_coverage_indirect_calls); - Opts.SanitizeCoverageTraceBB = Args.hasArg(OPT_fsanitize_coverage_trace_bb); - Opts.SanitizeCoverageTraceCmp = Args.hasArg(OPT_fsanitize_coverage_trace_cmp); - Opts.SanitizeCoverageTraceDiv = Args.hasArg(OPT_fsanitize_coverage_trace_div); - Opts.SanitizeCoverageTraceGep = Args.hasArg(OPT_fsanitize_coverage_trace_gep); - Opts.SanitizeCoverage8bitCounters = - Args.hasArg(OPT_fsanitize_coverage_8bit_counters); - Opts.SanitizeCoverageTracePC = Args.hasArg(OPT_fsanitize_coverage_trace_pc); - Opts.SanitizeCoverageTracePCGuard = - Args.hasArg(OPT_fsanitize_coverage_trace_pc_guard); - Opts.SanitizeCoverageNoPrune = Args.hasArg(OPT_fsanitize_coverage_no_prune); - Opts.SanitizeCoverageInline8bitCounters = - Args.hasArg(OPT_fsanitize_coverage_inline_8bit_counters); - Opts.SanitizeCoverageInlineBoolFlag = - Args.hasArg(OPT_fsanitize_coverage_inline_bool_flag); - Opts.SanitizeCoveragePCTable = Args.hasArg(OPT_fsanitize_coverage_pc_table); - Opts.SanitizeCoverageStackDepth = - Args.hasArg(OPT_fsanitize_coverage_stack_depth); Opts.SanitizeCoverageAllowlistFiles = Args.getAllArgValues(OPT_fsanitize_coverage_allowlist); Opts.SanitizeCoverageBlocklistFiles = Args.getAllArgValues(OPT_fsanitize_coverage_blocklist); Opts.SanitizeMemoryTrackOrigins = getLastArgIntValue(Args, OPT_fsanitize_memory_track_origins_EQ, 0, Diags); - Opts.SanitizeMemoryUseAfterDtor = - Args.hasFlag(OPT_fsanitize_memory_use_after_dtor, - OPT_fno_sanitize_memory_use_after_dtor, - false); - Opts.SanitizeMinimalRuntime = Args.hasArg(OPT_fsanitize_minimal_runtime); - Opts.SanitizeCfiCrossDso = Args.hasArg(OPT_fsanitize_cfi_cross_dso); - Opts.SanitizeCfiICallGeneralizePointers = - Args.hasArg(OPT_fsanitize_cfi_icall_generalize_pointers); - Opts.SanitizeCfiCanonicalJumpTables = - Args.hasArg(OPT_fsanitize_cfi_canonical_jump_tables); - Opts.SanitizeStats = Args.hasArg(OPT_fsanitize_stats); - if (Arg *A = Args.getLastArg( - OPT_fsanitize_address_poison_custom_array_cookie, - OPT_fno_sanitize_address_poison_custom_array_cookie)) { - Opts.SanitizeAddressPoisonCustomArrayCookie = - A->getOption().getID() == - OPT_fsanitize_address_poison_custom_array_cookie; - } - if (Arg *A = Args.getLastArg(OPT_fsanitize_address_use_after_scope, - OPT_fno_sanitize_address_use_after_scope)) { - Opts.SanitizeAddressUseAfterScope = - A->getOption().getID() == OPT_fsanitize_address_use_after_scope; - } - Opts.SanitizeAddressGlobalsDeadStripping = - Args.hasArg(OPT_fsanitize_address_globals_dead_stripping); - if (Arg *A = Args.getLastArg(OPT_fsanitize_address_use_odr_indicator, - OPT_fno_sanitize_address_use_odr_indicator)) { - Opts.SanitizeAddressUseOdrIndicator = - A->getOption().getID() == OPT_fsanitize_address_use_odr_indicator; - } Opts.SSPBufferSize = getLastArgIntValue(Args, OPT_stack_protector_buffer_size, 8, Diags); @@ -1346,7 +1168,6 @@ std::string(Args.getLastArgValue(OPT_mstack_protector_guard_reg_EQ, "none")); - Opts.StackRealignment = Args.hasArg(OPT_mstackrealign); if (Arg *A = Args.getLastArg(OPT_mstack_alignment)) { StringRef Val = A->getValue(); unsigned StackAlignment = Opts.StackAlignment; @@ -1361,10 +1182,6 @@ Opts.StackProbeSize = StackProbeSize; } - Opts.NoStackArgProbe = Args.hasArg(OPT_mno_stack_arg_probe); - - Opts.StackClashProtector = Args.hasArg(OPT_fstack_clash_protection); - if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) { StringRef Name = A->getValue(); unsigned Method = llvm::StringSwitch(Name) @@ -1382,9 +1199,6 @@ } - if (Args.hasArg(OPT_fno_objc_convert_messages_to_runtime_calls)) - Opts.ObjCConvertMessagesToRuntimeCalls = 0; - if (Args.getLastArg(OPT_femulated_tls) || Args.getLastArg(OPT_fno_emulated_tls)) { Opts.ExplicitEmulatedTLS = true; @@ -1486,8 +1300,6 @@ NeedLocTracking = true; } - Opts.DiagnosticsWithHotness = - Args.hasArg(options::OPT_fdiagnostics_show_hotness); bool UsingSampleProfile = !Opts.SampleProfileFile.empty(); bool UsingProfile = UsingSampleProfile || (Opts.getProfileUse() != CodeGenOptions::ProfileNone); @@ -1529,19 +1341,9 @@ Opts.CudaGpuBinaryFileName = std::string(Args.getLastArgValue(OPT_fcuda_include_gpubinary)); - Opts.Backchain = Args.hasArg(OPT_mbackchain); - Opts.EmitCheckPathComponentsToStrip = getLastArgIntValue( Args, OPT_fsanitize_undefined_strip_path_components_EQ, 0, Diags); - Opts.EmitVersionIdentMetadata = Args.hasFlag(OPT_Qy, OPT_Qn, true); - - Opts.Addrsig = Args.hasArg(OPT_faddrsig); - - Opts.KeepStaticConsts = Args.hasArg(OPT_fkeep_static_consts); - - Opts.SpeculativeLoadHardening = Args.hasArg(OPT_mspeculative_load_hardening); - Opts.DefaultFunctionAttrs = Args.getAllArgValues(OPT_default_function_attr); Opts.PassPlugins = Args.getAllArgValues(OPT_fpass_plugin_EQ); @@ -1549,12 +1351,9 @@ Opts.SymbolPartition = std::string(Args.getLastArgValue(OPT_fsymbol_partition_EQ)); - Opts.ForceAAPCSBitfieldLoad = Args.hasArg(OPT_ForceAAPCSBitfieldLoad); Opts.AAPCSBitfieldWidth = Args.hasFlag(OPT_AAPCSBitfieldWidth, OPT_ForceNoAAPCSBitfieldWidth, true); - Opts.PassByValueIsNoAlias = Args.hasArg(OPT_fpass_by_value_is_noalias); - return Success; }