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 @@ -908,8 +908,10 @@ def fno_cuda_flush_denormals_to_zero : Flag<["-"], "fno-cuda-flush-denormals-to-zero">; defm cuda_approx_transcendentals : OptInFFlag<"cuda-approx-transcendentals", "Use", "Don't use", " approximate transcendental functions">; -defm gpu_rdc : OptInFFlag<"gpu-rdc", - "Generate relocatable device code, also known as separate compilation mode", "", "">; +defm gpu_rdc : BoolFOption<"gpu-rdc", + "LangOpts->GPURelocatableDeviceCode", DefaultsToFalse, + ChangedBy, + ResetBy>; def : Flag<["-"], "fcuda-rdc">, Alias; def : Flag<["-"], "fno-cuda-rdc">, Alias; defm cuda_short_ptr : OptInFFlag<"cuda-short-ptr", @@ -926,16 +928,21 @@ HelpText<"HIP version in the format of major.minor.patch">; def fhip_dump_offload_linker_script : Flag<["-"], "fhip-dump-offload-linker-script">, Group, Flags<[NoArgumentUnused, HelpHidden]>; -defm hip_new_launch_api : OptInFFlag<"hip-new-launch-api", - "Use", "Don't use", " new kernel launching API for HIP">; +defm hip_new_launch_api : BoolFOption<"hip-new-launch-api", + "LangOpts->HIPUseNewLaunchAPI", DefaultsToFalse, + ChangedBy, ResetBy, + BothFlags<[], " new kernel launching API for HIP">>; defm gpu_allow_device_init : OptInFFlag<"gpu-allow-device-init", "Allow", "Don't allow", " device side init function in HIP">; -defm gpu_defer_diag : OptInFFlag<"gpu-defer-diag", - "Defer", "Don't defer", " host/device related diagnostic messages" - " for CUDA/HIP">; -defm gpu_exclude_wrong_side_overloads : OptInFFlag<"gpu-exclude-wrong-side-overloads", - "Always exclude wrong side overloads", "Exclude wrong side overloads only if there are same side overloads", - " in overloading resolution for CUDA/HIP", [HelpHidden]>; +defm gpu_defer_diag : BoolFOption<"gpu-defer-diag", + "LangOpts->GPUDeferDiag", DefaultsToFalse, + ChangedBy, ResetBy, + BothFlags<[], " host/device related diagnostic messages for CUDA/HIP">>; +defm gpu_exclude_wrong_side_overloads : BoolFOption<"gpu-exclude-wrong-side-overloads", + "LangOpts->GPUExcludeWrongSideOverloads", DefaultsToFalse, + ChangedBy, + ResetBy, + BothFlags<[HelpHidden], " in overloading resolution for CUDA/HIP">>; def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">, Flags<[CC1Option]>, HelpText<"Default max threads per block for kernel launch bounds for HIP">; @@ -989,16 +996,25 @@ def fno_PIC : Flag<["-"], "fno-PIC">, Group; def fPIE : Flag<["-"], "fPIE">, Group; def fno_PIE : Flag<["-"], "fno-PIE">, Group; -defm access_control : OptOutFFlag<"access-control", "", "Disable C++ access control">; +defm access_control : BoolFOption<"access-control", + "LangOpts->AccessControl", DefaultsToTrue, + ChangedBy, + ResetBy>; def falign_functions : Flag<["-"], "falign-functions">, Group; def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group; def fno_align_functions: Flag<["-"], "fno-align-functions">, Group; -defm allow_editor_placeholders : OptInFFlag<"allow-editor-placeholders", "Treat editor placeholders as valid source code">; +defm allow_editor_placeholders : BoolFOption<"allow-editor-placeholders", + "LangOpts->AllowEditorPlaceholders", DefaultsToFalse, + ChangedBy, + ResetBy>; def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group; def fapple_kext : Flag<["-"], "fapple-kext">, Group, Flags<[CC1Option]>, - HelpText<"Use Apple's kernel extensions ABI">; -def fapple_pragma_pack : Flag<["-"], "fapple-pragma-pack">, Group, Flags<[CC1Option]>, - HelpText<"Enable Apple gcc-compatible #pragma pack handling">; + HelpText<"Use Apple's kernel extensions ABI">, + MarshallingInfoFlag<"LangOpts->AppleKext">; +defm apple_pragma_pack : BoolFOption<"apple-pragma-pack", + "LangOpts->ApplePragmaPack", DefaultsToFalse, + ChangedBy, + ResetBy>; def shared_libsan : Flag<["-"], "shared-libsan">, HelpText<"Dynamically link the sanitizer runtime">; def static_libsan : Flag<["-"], "static-libsan">, @@ -1038,7 +1054,9 @@ def fembed_bitcode_marker : Flag<["-"], "fembed-bitcode-marker">, Alias, AliasArgs<["marker"]>, HelpText<"Embed placeholder LLVM IR data as a marker">; -defm gnu_inline_asm : OptOutFFlag<"gnu-inline-asm", "", "Disable GNU style inline asm">; +defm gnu_inline_asm : BoolFOption<"gnu-inline-asm", + "LangOpts->GNUAsm", DefaultsToTrue, + ChangedBy, ResetBy>; def fprofile_sample_use : Flag<["-"], "fprofile-sample-use">, Group, Flags<[CoreOption]>; @@ -1149,8 +1167,10 @@ BothFlags<[CoreOption], " an address-significance table">>; 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]>, - HelpText<"Accept non-standard constructs supported by the Borland compiler">; +defm borland_extensions : BoolFOption<"borland-extensions", + "LangOpts->Borland", DefaultsToFalse, + ChangedBy, + ResetBy>; def fbuiltin : Flag<["-"], "fbuiltin">, Group, Flags<[CoreOption]>; def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group, Flags<[NoXarchOption]>, HelpText<"Load the clang builtins module map file.">; @@ -1182,27 +1202,33 @@ 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]>, - HelpText<"Require member pointer base types to be complete if they would be significant under the Microsoft ABI">; -def fno_complete_member_pointers : Flag<["-"], "fno-complete-member-pointers">, Group, - Flags<[CoreOption]>, - HelpText<"Do not require member pointer base types to be complete if they would be significant under the Microsoft ABI">; +defm complete_member_pointers : BoolOption<"complete-member-pointers", + "LangOpts->CompleteMemberPointers", DefaultsToFalse, + ChangedBy, ResetBy, + BothFlags<[CoreOption], " member pointer base types to be complete if they" + " would be significant under the Microsoft ABI">, "f">, + Group; def fcf_runtime_abi_EQ : Joined<["-"], "fcf-runtime-abi=">, Group, Flags<[CC1Option]>; -def fconstant_cfstrings : Flag<["-"], "fconstant-cfstrings">, Group; +defm constant_cfstrings : BoolFOption<"constant-cfstrings", + "LangOpts->NoConstantCFStrings", DefaultsToFalse, + ChangedBy, + ResetBy>; def fconstant_string_class_EQ : Joined<["-"], "fconstant-string-class=">, Group; def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group; def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group; def fexperimental_new_constant_interpreter : Flag<["-"], "fexperimental-new-constant-interpreter">, Group, - HelpText<"Enable the experimental new constant interpreter">, Flags<[CC1Option]>; + HelpText<"Enable the experimental new constant interpreter">, Flags<[CC1Option]>, + MarshallingInfoFlag<"LangOpts->EnableNewConstInterp">; def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">, Group; def fno_crash_diagnostics : Flag<["-"], "fno-crash-diagnostics">, Group, Flags<[NoArgumentUnused, CoreOption]>, HelpText<"Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash">; def fcrash_diagnostics_dir : Joined<["-"], "fcrash-diagnostics-dir=">, Group, Flags<[NoArgumentUnused, CoreOption]>; def fcreate_profile : Flag<["-"], "fcreate-profile">, Group; -defm cxx_exceptions: OptInFFlag<"cxx-exceptions", "Enable C++ exceptions">; +defm cxx_exceptions: BoolFOption<"cxx-exceptions", + "LangOpts->CXXExceptions", DefaultsToFalse, + ChangedBy, ResetBy>; def fcxx_modules : Flag <["-"], "fcxx-modules">, Group, Flags<[NoXarchOption]>; def fdebug_pass_arguments : Flag<["-"], "fdebug-pass-arguments">, Group; @@ -1245,7 +1271,10 @@ defm dwarf_directory_asm : BoolFOption<"dwarf-directory-asm", "CodeGenOpts.NoDwarfDirectoryAsm", DefaultsToFalse, ChangedBy, ResetBy>; -def felide_constructors : Flag<["-"], "felide-constructors">, Group; +defm elide_constructors : BoolFOption<"elide-constructors", + "LangOpts->ElideConstructors", DefaultsToTrue, + ChangedBy, + ResetBy>; def fno_elide_type : Flag<["-"], "fno-elide-type">, Group, Flags<[CC1Option]>, HelpText<"Do not elide types when printing diagnostics">; @@ -1253,13 +1282,17 @@ defm eliminate_unused_debug_types : OptOutFFlag<"eliminate-unused-debug-types", "Do not emit ", "Emit ", " debug info for defined but unused types">; def femit_all_decls : Flag<["-"], "femit-all-decls">, Group, Flags<[CC1Option]>, - HelpText<"Emit all declarations, even if unused">; + HelpText<"Emit all declarations, even if unused">, + MarshallingInfoFlag<"LangOpts->EmitAllDecls">; def femulated_tls : Flag<["-"], "femulated-tls">, Group, Flags<[CC1Option]>, HelpText<"Use emutls functions to access thread_local variables">; def fno_emulated_tls : Flag<["-"], "fno-emulated-tls">, Group, Flags<[CC1Option]>; def fencoding_EQ : Joined<["-"], "fencoding=">, Group; def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group, Flags<[CoreOption]>; -defm exceptions : OptInFFlag<"exceptions", "Enable", "Disable", " support for exception handling">; +defm exceptions : BoolFOption<"exceptions", + "LangOpts->Exceptions", DefaultsToFalse, + ChangedBy, ResetBy, + BothFlags<[], " support for exception handling">>; def fdwarf_exceptions : Flag<["-"], "fdwarf-exceptions">, Group, HelpText<"Use DWARF style exceptions">; def fsjlj_exceptions : Flag<["-"], "fsjlj-exceptions">, Group, @@ -1278,7 +1311,8 @@ def exception_model_EQ : Joined<["-"], "exception-model=">, Flags<[CC1Option, NoDriverOption]>, Alias; def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group, Flags<[CC1Option]>, - HelpText<"Enable support for ignoring exception handling constructs">; + HelpText<"Enable support for ignoring exception handling constructs">, + MarshallingInfoFlag<"LangOpts->IgnoreExceptions">; def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group; def : Flag<["-"], "fexpensive-optimizations">, Group; @@ -1314,8 +1348,10 @@ ChangedBy, ResetBy, BothFlags<[NoXarchOption], " static const variables if unused">>; defm fixed_point : OptInFFlag<"fixed-point", "Enable", "Disable", " fixed point types">; -defm cxx_static_destructors : OptOutFFlag<"c++-static-destructors", "", - "Disable C++ static destructor registration">; +defm cxx_static_destructors : BoolFOption<"c++-static-destructors", + "LangOpts->RegisterStaticDestructors", DefaultsToTrue, + ChangedBy, + ResetBy>; def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group, Flags<[CC1Option]>; @@ -1523,7 +1559,9 @@ // This option was originally misspelt "infinites" [sic]. def : Flag<["-"], "fhonor-infinites">, Alias; def : Flag<["-"], "fno-honor-infinites">, Alias; -def frounding_math : Flag<["-"], "frounding-math">, Group, Flags<[CC1Option]>; +def frounding_math : Flag<["-"], "frounding-math">, Group, Flags<[CC1Option]>, + MarshallingInfoFlag<"LangOpts->FPRoundingMode", "llvm::RoundingMode::NearestTiesToEven">, + Normalizer<"makeFlagToValueNormalizer(llvm::RoundingMode::Dynamic)">; def fno_rounding_math : Flag<["-"], "fno-rounding-math">, Group, Flags<[CC1Option]>; def ftrapping_math : Flag<["-"], "ftrapping-math">, Group, Flags<[CC1Option]>; def fno_trapping_math : Flag<["-"], "fno-trapping-math">, Group, Flags<[CC1Option]>; @@ -1570,7 +1608,8 @@ ChangedBy, ResetBy>; def ffreestanding : Flag<["-"], "ffreestanding">, Group, Flags<[CC1Option]>, - HelpText<"Assert that the compilation takes place in a freestanding environment">; + HelpText<"Assert that the compilation takes place in a freestanding environment">, + MarshallingInfoFlag<"LangOpts->Freestanding">; def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group, HelpText<"Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)">, Flags<[CC1Option, CoreOption]>; @@ -1579,7 +1618,8 @@ defm gnu89_inline : OptInFFlag<"gnu89-inline", "Use the gnu89 inline semantics">; def fgnu_runtime : Flag<["-"], "fgnu-runtime">, Group, HelpText<"Generate output compatible with the standard GNU Objective-C runtime">; -def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">, Flags<[CC1Option]>; +def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">, Flags<[CC1Option]>, + MarshallingInfoFlag<"LangOpts->HeinousExtensions">; def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>, Group; def : Flag<["-"], "findirect-virtual-calls">, Alias; @@ -1689,12 +1729,10 @@ BothFlags<[CC1Option]>, "f">, Group; -def fexperimental_relative_cxx_abi_vtables : Flag<["-"], "fexperimental-relative-c++-abi-vtables">, - Group, Flags<[CC1Option]>, - HelpText<"Use the experimental C++ class ABI for classes with virtual tables">; -def fno_experimental_relative_cxx_abi_vtables : Flag<["-"], "fno-experimental-relative-c++-abi-vtables">, - Group, Flags<[CC1Option]>, - HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">; +defm experimental_relative_cxx_abi_vtables : BoolFOption<"experimental-relative-c++-abi-vtables", + "LangOpts->RelativeCXXABIVTables", DefaultsToFalse, + ChangedBy, ResetBy, + BothFlags<[CC1Option], " the experimental C++ class ABI for classes with virtual tables">>; def flat__namespace : Flag<["-"], "flat_namespace">; def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, Group, @@ -1732,7 +1770,8 @@ 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">; + HelpText<"Enable full Microsoft Visual C++ compatibility">, + MarshallingInfoFlag<"LangOpts->MSVCCompat">; def fms_volatile : Flag<["-"], "fms-volatile">, Group, Flags<[CC1Option]>, MarshallingInfoFlag<"CodeGenOpts.MSVolatile">; def fmsc_version : Joined<["-"], "fmsc-version=">, Group, Flags<[NoXarchOption, CoreOption]>, @@ -1744,9 +1783,11 @@ HelpText<"Dot-separated value representing the Microsoft compiler " "version number to report in _MSC_VER (0 = don't define it " "(default))">; -def fdelayed_template_parsing : Flag<["-"], "fdelayed-template-parsing">, Group, - HelpText<"Parse templated function definitions at the end of the " - "translation unit">, Flags<[CC1Option, CoreOption]>; +defm delayed_template_parsing : BoolFOption<"delayed-template-parsing", + "LangOpts->DelayedTemplateParsing", DefaultsToFalse, + ChangedBy, + ResetBy, + BothFlags<[CoreOption]>>; def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group, Flags<[CC1Option]>; def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group, Flags<[NoXarchOption, CC1Option]>, MetaVarName<"">, @@ -1810,13 +1851,10 @@ def fno_pch_validate_input_files_content: Flag <["-"], "fno_pch-validate-input-files-content">, Group, Flags<[NoXarchOption]>; -def fpch_instantiate_templates: - Flag <["-"], "fpch-instantiate-templates">, - Group, Flags<[CC1Option, CoreOption]>, - HelpText<"Instantiate templates already while building a PCH">; -def fno_pch_instantiate_templates: - Flag <["-"], "fno-pch-instantiate-templates">, - Group, Flags<[CC1Option, CoreOption]>; +defm pch_instantiate_templates : BoolFOption<"pch-instantiate-templates", + "LangOpts->PCHInstantiateTemplates", DefaultsToFalse, + ChangedBy, + ResetBy, BothFlags<[CC1Option, CoreOption]>>; defm pch_codegen: OptInFFlag<"pch-codegen", "Generate ", "Do not generate ", "code for uses of this PCH that assumes an explicit object file will be built for the PCH">; defm pch_debuginfo: OptInFFlag<"pch-debuginfo", "Generate ", "Do not generate ", @@ -1830,7 +1868,8 @@ HelpText<"Implicitly search the file system for module map files.">, MarshallingInfoFlag<"HeaderSearchOpts->ImplicitModuleMaps">; def fmodules_ts : Flag <["-"], "fmodules-ts">, Group, - Flags<[CC1Option]>, HelpText<"Enable support for the C++ Modules TS">; + Flags<[CC1Option]>, HelpText<"Enable support for the C++ Modules TS">, + MarshallingInfoFlag<"LangOpts->ModulesTS">; def fmodule_maps : Flag <["-"], "fmodule-maps">, Alias; def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group, Flags<[NoXarchOption,CC1Option]>, MetaVarName<"">, @@ -1854,25 +1893,25 @@ HelpText<"Require declaration of modules used within a module">; def fmodules_strict_decluse : Flag <["-"], "fmodules-strict-decluse">, Group, Flags<[NoXarchOption,CC1Option]>, - HelpText<"Like -fmodules-decluse but requires all headers to be in modules">; + HelpText<"Like -fmodules-decluse but requires all headers to be in modules">, + MarshallingInfoFlag<"LangOpts->ModulesStrictDeclUse">; def fno_modules_search_all : Flag <["-"], "fno-modules-search-all">, Group, Flags<[NoXarchOption, CC1Option]>; -def fno_implicit_modules : - Flag <["-"], "fno-implicit-modules">, - Group, Flags<[NoXarchOption, CC1Option]>; -def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group, Flags<[CC1Option]>; +defm implicit_modules : BoolFOption<"implicit-modules", + "LangOpts->ImplicitModules", DefaultsToTrue, + ChangedBy, ResetBy, BothFlags<[NoXarchOption]>>; +def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group, Flags<[CC1Option]>, + MarshallingInfoFlag<"LangOpts->RetainCommentsFromSystemHeaders">; def fmudflapth : Flag<["-"], "fmudflapth">, Group; def fmudflap : Flag<["-"], "fmudflap">, Group; def fnested_functions : Flag<["-"], "fnested-functions">, Group; def fnext_runtime : Flag<["-"], "fnext-runtime">, Group; -def fno_apple_pragma_pack : Flag<["-"], "fno-apple-pragma-pack">, Group; def fno_asm : Flag<["-"], "fno-asm">, Group; 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]>, 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">; def fno_builtin_ : Joined<["-"], "fno-builtin-">, Group, Flags<[CC1Option, CoreOption]>, @@ -1881,9 +1920,6 @@ Flags<[CoreOption, NoXarchOption]>; def fno_common : Flag<["-"], "fno-common">, Group, Flags<[CC1Option]>, HelpText<"Compile common globals like normal definitions">; -def fno_constant_cfstrings : Flag<["-"], "fno-constant-cfstrings">, Group, - Flags<[CC1Option]>, - HelpText<"Disable creation of CodeFoundation-type constant strings">; def fno_cxx_modules : Flag <["-"], "fno-cxx-modules">, Group, Flags<[NoXarchOption]>; def fno_diagnostics_fixit_info : Flag<["-"], "fno-diagnostics-fixit-info">, Group, @@ -1899,8 +1935,6 @@ HelpText<"Disallow __declspec as a keyword">, Flags<[CC1Option]>; def fno_dollars_in_identifiers : Flag<["-"], "fno-dollars-in-identifiers">, Group, HelpText<"Disallow '$' in identifiers">, Flags<[CC1Option]>; -def fno_elide_constructors : Flag<["-"], "fno-elide-constructors">, Group, - HelpText<"Disable C++ copy constructor elision">, Flags<[CC1Option]>; def fno_eliminate_unused_debug_symbols : Flag<["-"], "fno-eliminate-unused-debug-symbols">, Group; def fno_gnu_keywords : Flag<["-"], "fno-gnu-keywords">, Group, Flags<[CC1Option]>; def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group, Flags<[CC1Option]>; @@ -1922,8 +1956,6 @@ Flags<[NoXarchOption]>; def fno_modules_strict_decluse : Flag <["-"], "fno-strict-modules-decluse">, Group, Flags<[NoXarchOption]>; -def fimplicit_modules : Flag <["-"], "fimplicit-modules">, Group, - Flags<[NoXarchOption]>; def fmodule_file_deps : Flag <["-"], "fmodule-file-deps">, Group, Flags<[NoXarchOption]>; def fno_module_file_deps : Flag <["-"], "fno-module-file-deps">, Group, @@ -1932,24 +1964,16 @@ Flags<[CoreOption]>; def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group, Flags<[CoreOption]>; -def fno_delayed_template_parsing : Flag<["-"], "fno-delayed-template-parsing">, Group, - HelpText<"Disable delayed template parsing">, - Flags<[NoXarchOption, CoreOption]>; -def fno_objc_exceptions: Flag<["-"], "fno-objc-exceptions">, Group; def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group; def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group, Flags<[CC1Option]>; def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group; def fno_operator_names : Flag<["-"], "fno-operator-names">, Group, HelpText<"Do not treat C++ operator name keywords as synonyms for operators">, Flags<[CC1Option]>; -def fno_pascal_strings : Flag<["-"], "fno-pascal-strings">, Group; -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, HelpText<"Disable the use of stack protectors">; def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group, @@ -1962,8 +1986,6 @@ Flags<[CC1Option, CoreOption]>, HelpText< "Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes">, 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">; defm use_cxa_atexit : BoolFOption<"use-cxa-atexit", "CodeGenOpts.CXAAtExit", DefaultsToTrue, ChangedBy, @@ -1985,21 +2007,21 @@ "", "", [], "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, - HelpText<"Enable Objective-C exceptions">, Flags<[CC1Option]>; -def fapplication_extension : Flag<["-"], "fapplication-extension">, - Group, Flags<[CC1Option]>, - HelpText<"Restrict code to those available for App Extensions">; -def fno_application_extension : Flag<["-"], "fno-application-extension">, - Group; -def frelaxed_template_template_args : Flag<["-"], "frelaxed-template-template-args">, - Flags<[CC1Option]>, HelpText<"Enable C++17 relaxed template template argument matching">, - Group; -def fno_relaxed_template_template_args : Flag<["-"], "fno-relaxed-template-template-args">, - Group; -def fsized_deallocation : Flag<["-"], "fsized-deallocation">, Flags<[CC1Option]>, - HelpText<"Enable C++14 sized global deallocation functions">, Group; -def fno_sized_deallocation: Flag<["-"], "fno-sized-deallocation">, Group; +defm objc_exceptions : BoolFOption<"objc-exceptions", + "LangOpts->ObjCExceptions", DefaultsToFalse, + ChangedBy, ResetBy>; +defm application_extension : BoolFOption<"application-extension", + "LangOpts->AppExt", DefaultsToFalse, + ChangedBy, + ResetBy>; +defm relaxed_template_template_args : BoolFOption<"relaxed-template-template-args", + "LangOpts->RelaxedTemplateTemplateArgs", DefaultsToFalse, + ChangedBy, + ResetBy>; +defm sized_deallocation : BoolFOption<"sized-deallocation", + "LangOpts->SizedDeallocation", DefaultsToFalse, + ChangedBy, + ResetBy>; def faligned_allocation : Flag<["-"], "faligned-allocation">, Flags<[CC1Option]>, HelpText<"Enable C++17 aligned allocation functions">, Group; def fno_aligned_allocation: Flag<["-"], "fno-aligned-allocation">, @@ -2014,13 +2036,10 @@ def fobjc_legacy_dispatch : Flag<["-"], "fobjc-legacy-dispatch">, Group; def fobjc_new_property : Flag<["-"], "fobjc-new-property">, Group; -def fobjc_infer_related_result_type : Flag<["-"], "fobjc-infer-related-result-type">, - Group; -def fno_objc_infer_related_result_type : Flag<["-"], - "fno-objc-infer-related-result-type">, Group, - HelpText< - "do not infer Objective-C related result type based on method family">, - Flags<[CC1Option]>; +defm objc_infer_related_result_type : BoolFOption<"objc-infer-related-result-type", + "LangOpts->ObjCInferRelatedResultType", DefaultsToTrue, + ChangedBy, + ResetBy>; def fobjc_link_runtime: Flag<["-"], "fobjc-link-runtime">, Group; def fobjc_weak : Flag<["-"], "fobjc-weak">, Group, Flags<[CC1Option]>, HelpText<"Enable ARC-style weak references in Objective-C">; @@ -2036,7 +2055,8 @@ def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group; def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group; def fopenmp : Flag<["-"], "fopenmp">, Group, Flags<[CC1Option, NoArgumentUnused]>, - HelpText<"Parse OpenMP pragmas and generate parallel code.">; + HelpText<"Parse OpenMP pragmas and generate parallel code.">, + MarshallingInfoFlag<"LangOpts->OpenMP", "0u">, Normalizer<"makeFlagToValueNormalizer(50u)">; def fno_openmp : Flag<["-"], "fno-openmp">, Group, Flags<[NoArgumentUnused]>; def fopenmp_version_EQ : Joined<["-"], "fopenmp-version=">, Group, Flags<[CC1Option, NoArgumentUnused]>; def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group; @@ -2069,10 +2089,9 @@ Flags<[CC1Option, NoArgumentUnused, HelpHidden]>; def fopenmp_cuda_teams_reduction_recs_num_EQ : Joined<["-"], "fopenmp-cuda-teams-reduction-recs-num=">, Group, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>; -def fopenmp_optimistic_collapse : Flag<["-"], "fopenmp-optimistic-collapse">, Group, - Flags<[CC1Option, NoArgumentUnused, HelpHidden]>; -def fno_openmp_optimistic_collapse : Flag<["-"], "fno-openmp-optimistic-collapse">, Group, - Flags<[NoArgumentUnused, HelpHidden]>; +defm openmp_optimistic_collapse : BoolFOption<"openmp-optimistic-collapse", + "LangOpts->OpenMPOptimisticCollapse", DefaultsToFalse, + ChangedBy, ResetBy, BothFlags<[NoArgumentUnused, HelpHidden]>>; def fopenmp_cuda_parallel_target_regions : Flag<["-"], "fopenmp-cuda-parallel-target-regions">, Group, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>, HelpText<"Support parallel execution of target regions on Cuda-based devices.">; @@ -2098,8 +2117,10 @@ def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group, Flags<[CC1Option]>, HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">; def fno_max_type_align : Flag<["-"], "fno-max-type-align">, Group; -def fpascal_strings : Flag<["-"], "fpascal-strings">, Group, Flags<[CC1Option]>, - HelpText<"Recognize and construct Pascal-style string literals">; +defm pascal_strings : BoolFOption<"pascal-strings", + "LangOpts->PascalStrings", DefaultsToFalse, + ChangedBy, + ResetBy>; def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group, Flags<[CC1Option]>, MetaVarName<"">, HelpText<"Generate M NOPs before function entry and N-M NOPs after function entry">; def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group, Flags<[CC1Option]>, @@ -2113,8 +2134,14 @@ "CodeGenOpts.NoPLT", DefaultsToFalse, ChangedBy, ResetBy>; -defm ropi : OptInFFlag<"ropi", "Generate read-only position independent code (ARM only)">; -defm rwpi : OptInFFlag<"rwpi", "Generate read-write position independent code (ARM only)">; +defm ropi : BoolFOption<"ropi", + "LangOpts->ROPI", DefaultsToFalse, + ChangedBy, + ResetBy>; +defm rwpi : BoolFOption<"rwpi", + "LangOpts->RWPI", DefaultsToFalse, + ChangedBy, + ResetBy>; def fplugin_EQ : Joined<["-"], "fplugin=">, Group, Flags<[NoXarchOption]>, MetaVarName<"">, HelpText<"Load the named plugin (dynamic shared object)">; def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">, @@ -2134,8 +2161,11 @@ defm rtti : OptOutFFlag<"rtti", "", "Disable generation of rtti information">; defm rtti_data : OptOutFFlag<"rtti-data", "", "Disable generation of RTTI data">; def : Flag<["-"], "fsched-interblock">, Group; -def fshort_enums : Flag<["-"], "fshort-enums">, Group, Flags<[CC1Option]>, - HelpText<"Allocate to an enum type only as many bytes as it needs for the declared range of possible values">; +defm short_enums : BoolFOption<"short-enums", + "LangOpts->ShortEnums", DefaultsToFalse, + ChangedBy, + ResetBy>; def fchar8__t : Flag<["-"], "fchar8_t">, Group, Flags<[CC1Option]>, HelpText<"Enable C++ builtin type char8_t">; def fno_char8__t : Flag<["-"], "fno-char8_t">, Group, Flags<[CC1Option]>, @@ -2149,7 +2179,9 @@ "best|all; defaults to all">, Values<"best,all">; defm show_column : OptOutFFlag<"show-column", "", "Do not include column number on diagnostics">; def fshow_source_location : Flag<["-"], "fshow-source-location">, Group; -def fspell_checking : Flag<["-"], "fspell-checking">, Group; +defm spell_checking : BoolFOption<"spell-checking", + "LangOpts->SpellChecking", DefaultsToTrue, + ChangedBy, ResetBy>; def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group; def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group; defm signed_char : OptOutFFlag<"signed-char", "char is signed", "char is unsigned">; @@ -2257,7 +2289,10 @@ def Wframe_larger_than_EQ : Joined<["-"], "Wframe-larger-than=">, Group, Flags<[NoXarchOption]>; def : Flag<["-"], "fterminated-vtables">, Alias; -def fthreadsafe_statics : Flag<["-"], "fthreadsafe-statics">, Group; +defm threadsafe_statics : BoolFOption<"threadsafe-statics", + "LangOpts->ThreadsafeStatics", DefaultsToTrue, + ChangedBy, + ResetBy>; def ftime_report : Flag<["-"], "ftime-report">, Group, Flags<[CC1Option]>, MarshallingInfoFlag<"CodeGenOpts.TimePasses">; def ftime_report_EQ: Joined<["-"], "ftime-report=">, Group, @@ -2330,23 +2365,19 @@ HelpText<"Set the default symbol visibility for all global declarations">, Values<"hidden,default">; def fvisibility_inlines_hidden : Flag<["-"], "fvisibility-inlines-hidden">, Group, HelpText<"Give inline C++ member functions hidden visibility by default">, - Flags<[CC1Option]>; -def fvisibility_inlines_hidden_static_local_var : - Flag<["-"], "fvisibility-inlines-hidden-static-local-var">, Group, - HelpText<"When -fvisibility-inlines-hidden is enabled, static variables in " - "inline C++ member functions will also be given hidden visibility " - "by default">, - Flags<[CC1Option]>; -def fno_visibility_inlines_hidden_static_local_var : - Flag<["-"], "fno-visibility-inlines-hidden-static-local-var">, Group, - HelpText<"Disables -fvisibility-inlines-hidden-static-local-var " - "(this is the default on non-darwin targets)">, - Flags<[CC1Option]>; + Flags<[CC1Option]>, MarshallingInfoFlag<"LangOpts->InlineVisibilityHidden">; +defm visibility_inlines_hidden_static_local_var : BoolFOption<"visibility-inlines-hidden-static-local-var", + "LangOpts->VisibilityInlinesHiddenStaticLocalVar", DefaultsToFalse, + ChangedBy