//===--- Options.td - Options for clang -----------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines the options accepted by clang. // //===----------------------------------------------------------------------===// // Include the common option parsing interfaces. include "llvm/Option/OptParser.td" ///////// // Flags // The option is a "driver"-only option, and should not be forwarded to other // tools via `-Xarch` options. def NoXarchOption : OptionFlag; // LinkerInput - The option is a linker input. def LinkerInput : OptionFlag; // NoArgumentUnused - Don't report argument unused warnings for this option; this // is useful for options like -static or -dynamic which a user may always end up // passing, even if the platform defaults to (or only supports) that option. def NoArgumentUnused : OptionFlag; // Unsupported - The option is unsupported, and the driver will reject command // lines that use it. def Unsupported : OptionFlag; // Ignored - The option is unsupported, and the driver will silently ignore it. def Ignored : OptionFlag; // CoreOption - This is considered a "core" Clang option, available in both // clang and clang-cl modes. def CoreOption : OptionFlag; // CLOption - This is a cl.exe compatibility option. Options with this flag // are made available when the driver is running in CL compatibility mode. def CLOption : OptionFlag; // CC1Option - This option should be accepted by clang -cc1. def CC1Option : OptionFlag; // CC1AsOption - This option should be accepted by clang -cc1as. def CC1AsOption : OptionFlag; // DXCOption - This is a dxc.exe compatibility option. Options with this flag // are made available when the driver is running in DXC compatibility mode. def DXCOption : OptionFlag; // CLDXCOption - This is a cl.exe/dxc.exe compatibility option. Options with this flag // are made available when the driver is running in CL/DXC compatibility mode. def CLDXCOption : OptionFlag; // NoDriverOption - This option should not be accepted by the driver. def NoDriverOption : OptionFlag; // If an option affects linking, but has a primary group (so Link_Group cannot // be used), add this flag. def LinkOption : OptionFlag; // FlangOption - This is considered a "core" Flang option, available in // flang mode. def FlangOption : OptionFlag; // FlangOnlyOption - This option should only be used by Flang (i.e. it is not // available for Clang) def FlangOnlyOption : OptionFlag; // FC1Option - This option should be accepted by flang -fc1. def FC1Option : OptionFlag; // A short name to show in documentation. The name will be interpreted as rST. class DocName { string DocName = name; } // A brief description to show in documentation, interpreted as rST. class DocBrief { code DocBrief = descr; } // Indicates that this group should be flattened into its parent when generating // documentation. class DocFlatten { bit DocFlatten = 1; } // Indicates that this warning is ignored, but accepted with a warning for // GCC compatibility. class IgnoredGCCCompat : Flags<[HelpHidden]> {} ///////// // Groups def Action_Group : OptionGroup<"">, DocName<"Actions">, DocBrief<[{The action to perform on the input.}]>; // Meta-group for options which are only used for compilation, // and not linking etc. def CompileOnly_Group : OptionGroup<"">, DocName<"Compilation flags">, DocBrief<[{ Flags controlling the behavior of Clang during compilation. These flags have no effect during actions that do not perform compilation.}]>; def Preprocessor_Group : OptionGroup<"">, Group, DocName<"Preprocessor flags">, DocBrief<[{ Flags controlling the behavior of the Clang preprocessor.}]>; def IncludePath_Group : OptionGroup<"">, Group, DocName<"Include path management">, DocBrief<[{ Flags controlling how ``#include``\s are resolved to files.}]>; def I_Group : OptionGroup<"">, Group, DocFlatten; def i_Group : OptionGroup<"">, Group, DocFlatten; def clang_i_Group : OptionGroup<"">, Group, DocFlatten; def M_Group : OptionGroup<"">, Group, DocName<"Dependency file generation">, DocBrief<[{ Flags controlling generation of a dependency file for ``make``-like build systems.}]>; def d_Group : OptionGroup<"">, Group, DocName<"Dumping preprocessor state">, DocBrief<[{ Flags allowing the state of the preprocessor to be dumped in various ways.}]>; def Diag_Group : OptionGroup<"">, Group, DocName<"Diagnostic flags">, DocBrief<[{ Flags controlling which warnings, errors, and remarks Clang will generate. See the :doc:`full list of warning and remark flags `.}]>; def R_Group : OptionGroup<"">, Group, DocFlatten; def R_value_Group : OptionGroup<"">, Group, DocFlatten; def W_Group : OptionGroup<"">, Group, DocFlatten; def W_value_Group : OptionGroup<"">, Group, DocFlatten; def f_Group : OptionGroup<"">, Group, DocName<"Target-independent compilation options">; def f_clang_Group : OptionGroup<"">, Group, DocFlatten; def pedantic_Group : OptionGroup<"">, Group, DocFlatten; def opencl_Group : OptionGroup<"">, Group, DocName<"OpenCL flags">; def sycl_Group : OptionGroup<"">, Group, DocName<"SYCL flags">; def m_Group : OptionGroup<"">, Group, DocName<"Target-dependent compilation options">; // Feature groups - these take command line options that correspond directly to // target specific features and can be translated directly from command line // options. def m_aarch64_Features_Group : OptionGroup<"">, Group, DocName<"AARCH64">; def m_amdgpu_Features_Group : OptionGroup<"">, Group, DocName<"AMDGPU">; def m_arm_Features_Group : OptionGroup<"">, Group, DocName<"ARM">; def m_hexagon_Features_Group : OptionGroup<"">, Group, DocName<"Hexagon">; // The features added by this group will not be added to target features. // These are explicitly handled. def m_hexagon_Features_HVX_Group : OptionGroup<"">, Group, DocName<"Hexagon">; def m_m68k_Features_Group: OptionGroup<"">, Group, DocName<"M68k">; def m_mips_Features_Group : OptionGroup<"">, Group, DocName<"MIPS">; def m_ppc_Features_Group : OptionGroup<"">, Group, DocName<"PowerPC">; def m_wasm_Features_Group : OptionGroup<"">, Group, DocName<"WebAssembly">; // The features added by this group will not be added to target features. // These are explicitly handled. def m_wasm_Features_Driver_Group : OptionGroup<"">, Group, DocName<"WebAssembly Driver">; def m_x86_Features_Group : OptionGroup<"">, Group, Flags<[CoreOption]>, DocName<"X86">; def m_riscv_Features_Group : OptionGroup<"">, Group, DocName<"RISCV">; def m_libc_Group : OptionGroup<"">, Group, Flags<[HelpHidden]>; def O_Group : OptionGroup<"">, Group, DocName<"Optimization level">, DocBrief<[{ Flags controlling how much optimization should be performed.}]>; def DebugInfo_Group : OptionGroup<"">, Group, DocName<"Debug information generation">, DocBrief<[{ Flags controlling how much and what kind of debug information should be generated.}]>; def g_Group : OptionGroup<"">, Group, DocName<"Kind and level of debug information">; def gN_Group : OptionGroup<"">, Group, DocName<"Debug level">; def ggdbN_Group : OptionGroup<"">, Group, DocFlatten; def gTune_Group : OptionGroup<"">, Group, DocName<"Debugger to tune debug information for">; def g_flags_Group : OptionGroup<"">, Group, DocName<"Debug information flags">; def StaticAnalyzer_Group : OptionGroup<"">, DocName<"Static analyzer flags">, DocBrief<[{ Flags controlling the behavior of the Clang Static Analyzer.}]>; // gfortran options that we recognize in the driver and pass along when // invoking GCC to compile Fortran code. def gfortran_Group : OptionGroup<"">, DocName<"Fortran compilation flags">, DocBrief<[{ Flags that will be passed onto the ``gfortran`` compiler when Clang is given a Fortran input.}]>; def Link_Group : OptionGroup<"">, DocName<"Linker flags">, DocBrief<[{Flags that are passed on to the linker}]>; def T_Group : OptionGroup<"">, Group, DocFlatten; def u_Group : OptionGroup<"">, Group, DocFlatten; def reserved_lib_Group : OptionGroup<"">, Flags<[Unsupported]>; // Temporary groups for clang options which we know we don't support, // but don't want to verbosely warn the user about. def clang_ignored_f_Group : OptionGroup<"">, Group, Flags<[Ignored]>; def clang_ignored_m_Group : OptionGroup<"">, Group, Flags<[Ignored]>; // Group for clang options in the process of deprecation. // Please include the version that deprecated the flag as comment to allow // easier garbage collection. def clang_ignored_legacy_options_Group : OptionGroup<"">, Group, Flags<[Ignored]>; // Retired with clang-5.0 def : Flag<["-"], "fslp-vectorize-aggressive">, Group; def : Flag<["-"], "fno-slp-vectorize-aggressive">, Group; // Retired with clang-10.0. Previously controlled X86 MPX ISA. def mmpx : Flag<["-"], "mmpx">, Group; def mno_mpx : Flag<["-"], "mno-mpx">, Group; // Group that ignores all gcc optimizations that won't be implemented def clang_ignored_gcc_optimization_f_Group : OptionGroup< "">, Group, Flags<[Ignored]>; class DiagnosticOpts : KeyPathAndMacro<"DiagnosticOpts->", base, "DIAG_"> {} class LangOpts : KeyPathAndMacro<"LangOpts->", base, "LANG_"> {} class TargetOpts : KeyPathAndMacro<"TargetOpts->", base, "TARGET_"> {} class FrontendOpts : KeyPathAndMacro<"FrontendOpts.", base, "FRONTEND_"> {} class PreprocessorOutputOpts : KeyPathAndMacro<"PreprocessorOutputOpts.", base, "PREPROCESSOR_OUTPUT_"> {} class DependencyOutputOpts : KeyPathAndMacro<"DependencyOutputOpts.", base, "DEPENDENCY_OUTPUT_"> {} class CodeGenOpts : KeyPathAndMacro<"CodeGenOpts.", base, "CODEGEN_"> {} class HeaderSearchOpts : KeyPathAndMacro<"HeaderSearchOpts->", base, "HEADER_SEARCH_"> {} class PreprocessorOpts : KeyPathAndMacro<"PreprocessorOpts->", base, "PREPROCESSOR_"> {} class FileSystemOpts : KeyPathAndMacro<"FileSystemOpts.", base, "FILE_SYSTEM_"> {} class AnalyzerOpts : KeyPathAndMacro<"AnalyzerOpts->", base, "ANALYZER_"> {} class MigratorOpts : KeyPathAndMacro<"MigratorOpts.", base, "MIGRATOR_"> {} // A boolean option which is opt-in in CC1. The positive option exists in CC1 and // Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled. // This is useful if the option is usually disabled. // Use this only when the option cannot be declared via BoolFOption. multiclass OptInCC1FFlag flags=[]> { def f#NAME : Flag<["-"], "f"#name>, Flags<[CC1Option] # flags>, Group, HelpText; def fno_#NAME : Flag<["-"], "fno-"#name>, Flags, Group, HelpText; } // A boolean option which is opt-out in CC1. The negative option exists in CC1 and // Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled. // Use this only when the option cannot be declared via BoolFOption. multiclass OptOutCC1FFlag flags=[]> { def f#NAME : Flag<["-"], "f"#name>, Flags, Group, HelpText; def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[CC1Option] # flags>, Group, HelpText; } // A boolean option which is opt-in in FC1. The positive option exists in FC1 and // Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled. // This is useful if the option is usually disabled. multiclass OptInFC1FFlag flags=[]> { def f#NAME : Flag<["-"], "f"#name>, Flags<[FC1Option] # flags>, Group, HelpText; def fno_#NAME : Flag<["-"], "fno-"#name>, Flags, Group, HelpText; } // A boolean option which is opt-out in FC1. The negative option exists in FC1 and // Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled. multiclass OptOutFC1FFlag flags=[]> { def f#NAME : Flag<["-"], "f"#name>, Flags, Group, HelpText; def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[FC1Option] # flags>, Group, HelpText; } // Creates a positive and negative flags where both of them are prefixed with // "m", have help text specified for positive and negative option, and a Group // optionally specified by the opt_group argument, otherwise Group. multiclass SimpleMFlag { def m#NAME : Flag<["-"], "m"#name>, Group, HelpText; def mno_#NAME : Flag<["-"], "mno-"#name>, Group, HelpText; } //===----------------------------------------------------------------------===// // BoolOption //===----------------------------------------------------------------------===// // The default value of a marshalled key path. class Default { code Value = value; } // Convenience variables for boolean defaults. def DefaultTrue : Default<"true"> {} def DefaultFalse : Default<"false"> {} // The value set to the key path when the flag is present on the command line. class Set { bit Value = value; } def SetTrue : Set {} def SetFalse : Set {} // Definition of single command line flag. This is an implementation detail, use // SetTrueBy or SetFalseBy instead. class FlagDef option_flags, string help, list implied_by_expressions = []> { // The polarity. Besides spelling, this also decides whether the TableGen // record will be prefixed with "no_". bit Polarity = polarity; // The value assigned to key path when the flag is present on command line. bit Value = value; // OptionFlags that control visibility of the flag in different tools. list OptionFlags = option_flags; // The help text associated with the flag. string Help = help; // List of expressions that, when true, imply this flag. list ImpliedBy = implied_by_expressions; } // Additional information to be appended to both positive and negative flag. class BothFlags option_flags, string help = ""> { list OptionFlags = option_flags; string Help = help; } // Functor that appends the suffix to the base flag definition. class ApplySuffix { FlagDef Result = FlagDef; } // Definition of the command line flag with positive spelling, e.g. "-ffoo". class PosFlag flags = [], string help = "", list implied_by_expressions = []> : FlagDef {} // Definition of the command line flag with negative spelling, e.g. "-fno-foo". class NegFlag flags = [], string help = "", list implied_by_expressions = []> : FlagDef {} // Expanded FlagDef that's convenient for creation of TableGen records. class FlagDefExpanded : FlagDef { // Name of the TableGen record. string RecordName = prefix # !if(flag.Polarity, "", "no_") # name; // Spelling of the flag. string Spelling = prefix # !if(flag.Polarity, "", "no-") # spelling; // Can the flag be implied by another flag? bit CanBeImplied = !not(!empty(flag.ImpliedBy)); // C++ code that will be assigned to the keypath when the flag is present. code ValueAsCode = !if(flag.Value, "true", "false"); } // TableGen record for a single marshalled flag. class MarshalledFlagRec : Flag<["-"], flag.Spelling>, Flags, HelpText, MarshallingInfoBooleanFlag, ImpliedByAnyOf {} // Generates TableGen records for two command line flags that control the same // key path via the marshalling infrastructure. // Names of the records consist of the specified prefix, "no_" for the negative // flag, and NAME. // Used for -cc1 frontend options. Driver-only options do not map to // CompilerInvocation. multiclass BoolOption> { defvar flag1 = FlagDefExpanded.Result, prefix, NAME, spelling_base>; defvar flag2 = FlagDefExpanded.Result, prefix, NAME, spelling_base>; // The flags must have different polarity, different values, and only // one can be implied. assert !xor(flag1.Polarity, flag2.Polarity), "the flags must have different polarity: flag1: " # flag1.Polarity # ", flag2: " # flag2.Polarity; assert !ne(flag1.Value, flag2.Value), "the flags must have different values: flag1: " # flag1.Value # ", flag2: " # flag2.Value; assert !not(!and(flag1.CanBeImplied, flag2.CanBeImplied)), "only one of the flags can be implied: flag1: " # flag1.CanBeImplied # ", flag2: " # flag2.CanBeImplied; defvar implied = !if(flag1.CanBeImplied, flag1, flag2); def flag1.RecordName : MarshalledFlagRec; def flag2.RecordName : MarshalledFlagRec; } /// Creates a BoolOption where both of the flags are prefixed with "f", are in /// the Group. /// Used for -cc1 frontend options. Driver-only options do not map to /// CompilerInvocation. multiclass BoolFOption> { defm NAME : BoolOption<"f", flag_base, kpm, default, flag1, flag2, both>, Group; } // Creates a BoolOption where both of the flags are prefixed with "g" and have // the Group. // Used for -cc1 frontend options. Driver-only options do not map to // CompilerInvocation. multiclass BoolGOption> { defm NAME : BoolOption<"g", flag_base, kpm, default, flag1, flag2, both>, Group; } // FIXME: Diagnose if target does not support protected visibility. class MarshallingInfoVisibility : MarshallingInfoEnum, Values<"default,hidden,internal,protected">, NormalizedValues<["DefaultVisibility", "HiddenVisibility", "HiddenVisibility", "ProtectedVisibility"]> {} // Key paths that are constant during parsing of options with the same key path prefix. defvar cplusplus = LangOpts<"CPlusPlus">; defvar cpp11 = LangOpts<"CPlusPlus11">; defvar cpp17 = LangOpts<"CPlusPlus17">; defvar cpp20 = LangOpts<"CPlusPlus20">; defvar c99 = LangOpts<"C99">; defvar c2x = LangOpts<"C2x">; defvar lang_std = LangOpts<"LangStd">; defvar open_cl = LangOpts<"OpenCL">; defvar cuda = LangOpts<"CUDA">; defvar render_script = LangOpts<"RenderScript">; defvar hip = LangOpts<"HIP">; defvar gnu_mode = LangOpts<"GNUMode">; defvar asm_preprocessor = LangOpts<"AsmPreprocessor">; defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")"); ///////// // Options // The internal option ID must be a valid C++ identifier and results in a // clang::driver::options::OPT_XX enum constant for XX. // // We want to unambiguously be able to refer to options from the driver source // code, for this reason the option name is mangled into an ID. This mangling // isn't guaranteed to have an inverse, but for practical purposes it does. // // The mangling scheme is to ignore the leading '-', and perform the following // substitutions: // _ => __ // - => _ // / => _SLASH // # => _HASH // ? => _QUESTION // , => _COMMA // = => _EQ // C++ => CXX // . => _ // Developer Driver Options def internal_Group : OptionGroup<"">, Flags<[HelpHidden]>; def internal_driver_Group : OptionGroup<"">, Group, HelpText<"DRIVER OPTIONS">; def internal_debug_Group : OptionGroup<"">, Group, HelpText<"DEBUG/DEVELOPMENT OPTIONS">; class InternalDriverOpt : Group, Flags<[NoXarchOption, HelpHidden]>; def driver_mode : Joined<["--"], "driver-mode=">, Group, Flags<[CoreOption, NoXarchOption, HelpHidden]>, HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', or 'cl'">; def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group, Flags<[CoreOption, NoXarchOption, HelpHidden]>, HelpText<"Set the rsp quoting to either 'posix', or 'windows'">; def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, InternalDriverOpt, HelpText<"Name for native GCC compiler">, MetaVarName<"">; class InternalDebugOpt : Group, Flags<[NoXarchOption, HelpHidden, CoreOption]>; def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt, HelpText<"Simulate installation in the given directory">; def ccc_print_phases : Flag<["-"], "ccc-print-phases">, InternalDebugOpt, HelpText<"Dump list of actions to perform">; def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, InternalDebugOpt, HelpText<"Show bindings of tools to actions">; def ccc_arcmt_check : Flag<["-"], "ccc-arcmt-check">, InternalDriverOpt, HelpText<"Check for ARC migration issues that need manual handling">; def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, InternalDriverOpt, HelpText<"Apply modifications to files to conform to ARC">; def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt, HelpText<"Apply modifications and produces temporary files that conform to ARC">; def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">, HelpText<"Output path for the plist report">, Flags<[CC1Option]>, MarshallingInfoString>; def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">, HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>, MarshallingInfoFlag>; def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">, Flags<[NoArgumentUnused, CoreOption]>, HelpText<"Emit reproducer on (option: off, crash (default), error, always)">; def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt, Alias, AliasArgs<["always"]>, HelpText<"Auto-generates preprocessed source files and a reproduction script">; def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt, HelpText<"Emit a compilation database fragment to the specified directory">; def round_trip_args : Flag<["-"], "round-trip-args">, Flags<[CC1Option, NoDriverOption]>, HelpText<"Enable command line arguments round-trip.">; def no_round_trip_args : Flag<["-"], "no-round-trip-args">, Flags<[CC1Option, NoDriverOption]>, HelpText<"Disable command line arguments round-trip.">; def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>, HelpText<"Run the migrator">; def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">, InternalDriverOpt, HelpText<"Apply modifications and produces temporary files to migrate to " "modern ObjC syntax">; def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC literals">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Literals">; def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC subscripting">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Subscripting">; def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC property">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Property">; def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_MigrateDecls">; def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC readonly property">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ReadonlyProperty">; def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">, Flags<[CC1Option]>, HelpText<"Enable migration to modern ObjC readwrite property">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ReadwriteProperty">; def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">, Flags<[CC1Option]>, HelpText<"Enable migration of setter/getter messages to property-dot syntax">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_PropertyDotSyntax">; def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">, Flags<[CC1Option]>, HelpText<"Enable migration to property and method annotations">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Annotation">; def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">, Flags<[CC1Option]>, HelpText<"Enable migration to infer instancetype for method result type">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_Instancetype">; def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">, Flags<[CC1Option]>, HelpText<"Enable migration to NS_ENUM/NS_OPTIONS macros">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_NsMacros">; def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">, Flags<[CC1Option]>, HelpText<"Enable migration to add protocol conformance on classes">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ProtocolConformance">; def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">, Flags<[CC1Option]>, HelpText<"Make migration to 'atomic' properties">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_AtomicProperty">; def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">, Flags<[CC1Option]>, HelpText<"Enable migration to annotate property with NS_RETURNS_INNER_POINTER">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_ReturnsInnerPointerProperty">; def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">, Flags<[CC1Option]>, HelpText<"Enable migration to use NS_NONATOMIC_IOSONLY macro for setting property's 'atomic' attribute">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty">; def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">, Flags<[CC1Option]>, HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">, MarshallingInfoBitfieldFlag, "FrontendOptions::ObjCMT_DesignatedInitializer">; def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">, Flags<[CC1Option]>, HelpText<"Only modify files with a filename contained in the provided directory path">, MarshallingInfoString>; def : Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>, HelpText<"Alias for -objcmt-allowlist-dir-path">, Alias; // The misspelt "white-list" [sic] alias is due for removal. def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>, Alias; // Make sure all other -ccc- options are rejected. def ccc_ : Joined<["-"], "ccc-">, Group, Flags<[Unsupported]>; // Standard Options def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption, CoreOption, FlangOption]>, HelpText<"Print (but do not run) the commands to run for this compilation">; def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>, Flags<[NoXarchOption, CoreOption]>; def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group; def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"">, HelpText<"Search $prefix$file for executables, libraries, and data files. " "If $prefix is a directory, search $prefix/$file">; def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>, HelpText<"Search for GCC installation in the specified directory on targets which commonly use GCC. " "The directory usually contains 'lib{,32,64}/gcc{,-cross}/$triple' and 'include'. If specified, " "sysroot is skipped for GCC detection. Note: executables (e.g. ld) used by the compiler are not " "overridden by the selected GCC installation">; def CC : Flag<["-"], "CC">, Flags<[CC1Option]>, Group, HelpText<"Include comments from within macros in preprocessed output">, MarshallingInfoFlag>; def C : Flag<["-"], "C">, Flags<[CC1Option]>, Group, HelpText<"Include comments in preprocessed output">, MarshallingInfoFlag>; def D : JoinedOrSeparate<["-"], "D">, Group, Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"=">, HelpText<"Define to (or 1 if omitted)">; def E : Flag<["-"], "E">, Flags<[NoXarchOption,CC1Option, FlangOption, FC1Option]>, Group, HelpText<"Only run the preprocessor">; def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>, HelpText<"Add directory to framework include search path">; def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption]>, Group, MetaVarName<"">, HelpText<"Put objects of at most bytes " "into small data section (MIPS / Hexagon)">; def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>, Group, Alias; def H : Flag<["-"], "H">, Flags<[CC1Option]>, Group, HelpText<"Show header includes and nesting depth">, MarshallingInfoFlag>; def fshow_skipped_includes : Flag<["-"], "fshow-skipped-includes">, Flags<[CC1Option]>, HelpText<"Show skipped includes in -H output.">, DocBrief<[{#include files may be "skipped" due to include guard optimization or #pragma once. This flag makes -H show also such includes.}]>, MarshallingInfoFlag>; def I_ : Flag<["-"], "I-">, Group, HelpText<"Restrict all prior -I flags to double-quoted inclusion and " "remove current directory from include path">; def I : JoinedOrSeparate<["-"], "I">, Group, Flags<[CC1Option,CC1AsOption,FlangOption,FC1Option]>, MetaVarName<"">, HelpText<"Add directory to the end of the list of include search paths">, DocBrief<[{Add directory to include search path. For C++ inputs, if there are multiple -I options, these directories are searched in the order they are given before the standard system directories are searched. If the same directory is in the SYSTEM include search paths, for example if also specified with -isystem, the -I option will be ignored}]>; def L : JoinedOrSeparate<["-"], "L">, Flags<[RenderJoined]>, Group, MetaVarName<"">, HelpText<"Add directory to library search path">; def MD : Flag<["-"], "MD">, Group, HelpText<"Write a depfile containing user and system headers">; def MMD : Flag<["-"], "MMD">, Group, HelpText<"Write a depfile containing user headers">; def M : Flag<["-"], "M">, Group, HelpText<"Like -MD, but also implies -E and writes to stdout by default">; def MM : Flag<["-"], "MM">, Group, HelpText<"Like -MMD, but also implies -E and writes to stdout by default">; def MF : JoinedOrSeparate<["-"], "MF">, Group, HelpText<"Write depfile output from -MMD, -MD, -MM, or -M to ">, MetaVarName<"">; def MG : Flag<["-"], "MG">, Group, Flags<[CC1Option]>, HelpText<"Add missing headers to depfile">, MarshallingInfoFlag>; def MJ : JoinedOrSeparate<["-"], "MJ">, Group, HelpText<"Write a compilation database entry per input">; def MP : Flag<["-"], "MP">, Group, Flags<[CC1Option]>, HelpText<"Create phony target for each dependency (other than main file)">, MarshallingInfoFlag>; def MQ : JoinedOrSeparate<["-"], "MQ">, Group, Flags<[CC1Option]>, HelpText<"Specify name of main file output to quote in depfile">; def MT : JoinedOrSeparate<["-"], "MT">, Group, Flags<[CC1Option]>, HelpText<"Specify name of main file output in depfile">, MarshallingInfoStringVector>; def MV : Flag<["-"], "MV">, Group, Flags<[CC1Option]>, HelpText<"Use NMake/Jom format for the depfile">, MarshallingInfoFlag, "DependencyOutputFormat::Make">, Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">; def Mach : Flag<["-"], "Mach">, Group; def O0 : Flag<["-"], "O0">, Group, Flags<[CC1Option, FC1Option, HelpHidden]>; def O4 : Flag<["-"], "O4">, Group, Flags<[CC1Option, FC1Option, HelpHidden]>; def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C++ inputs">; def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C inputs">; def O : Joined<["-"], "O">, Group, Flags<[CC1Option,FC1Option]>; def O_flag : Flag<["-"], "O">, Flags<[CC1Option,FC1Option]>, Alias, AliasArgs<["1"]>; def Ofast : Joined<["-"], "Ofast">, Group, Flags<[CC1Option]>; def P : Flag<["-"], "P">, Flags<[CC1Option,FlangOption,FC1Option]>, Group, HelpText<"Disable linemarker output in -E mode">, MarshallingInfoNegativeFlag>; 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 : Flag<["-"], "fident">, Group, Alias, Flags<[CoreOption, CC1Option]>; def : Flag<["-"], "fno-ident">, Group, Alias, Flags<[CoreOption, CC1Option]>; def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>, HelpText<"Don't emit warning for unused driver arguments">; def Q : Flag<["-"], "Q">, IgnoredGCCCompat; def Rpass_EQ : Joined<["-"], "Rpass=">, Group, Flags<[CC1Option]>, HelpText<"Report transformations performed by optimization passes whose " "name matches the given POSIX regular expression">; def Rpass_missed_EQ : Joined<["-"], "Rpass-missed=">, Group, Flags<[CC1Option]>, HelpText<"Report missed transformations by optimization passes whose " "name matches the given POSIX regular expression">; def Rpass_analysis_EQ : Joined<["-"], "Rpass-analysis=">, Group, Flags<[CC1Option]>, HelpText<"Report transformation analysis from optimization passes whose " "name matches the given POSIX regular expression">; def R_Joined : Joined<["-"], "R">, Group, Flags<[CC1Option, CoreOption]>, MetaVarName<"">, HelpText<"Enable the specified remark">; def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option,FlangOption,FC1Option]>, Group, HelpText<"Only run preprocess and compilation steps">; def Tbss : JoinedOrSeparate<["-"], "Tbss">, Group, MetaVarName<"">, HelpText<"Set starting address of BSS to ">; def Tdata : JoinedOrSeparate<["-"], "Tdata">, Group, MetaVarName<"">, HelpText<"Set starting address of DATA to ">; def Ttext : JoinedOrSeparate<["-"], "Ttext">, Group, MetaVarName<"">, HelpText<"Set starting address of TEXT to ">; def T : JoinedOrSeparate<["-"], "T">, Group, MetaVarName<"