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 @@ -1436,7 +1436,8 @@ HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">; def fprofile_list_EQ : Joined<["-"], "fprofile-list=">, Group, Flags<[CC1Option, CoreOption]>, - HelpText<"Filename defining the list of functions/files to instrument">, + HelpText<"Filename defining the list of functions/files to instrument. " + "The file uses the sanitizer special case list format.">, MarshallingInfoStringVector>; def fprofile_function_groups : Joined<["-"], "fprofile-function-groups=">, Group, Flags<[CC1Option]>, MetaVarName<"">, @@ -1492,6 +1493,13 @@ def fparse_all_comments : Flag<["-"], "fparse-all-comments">, Group, Flags<[CC1Option]>, MarshallingInfoFlag>; def frecord_command_line : Flag<["-"], "frecord-command-line">, + DocBrief<[{Generate a section named ".GCC.command.line" containing the clang +driver command-line. After linking, the section may contain multiple command +lines, which will be individually terminated by null bytes. Separate arguments +within a command line are combined with spaces; spaces and backslashes within an +argument are escaped with backslashes. This format differs from the format of +the equivalent section produced by GCC with the -frecord-gcc-switches flag. +This option is currently only supported on ELF targets.}]>, Group; def fno_record_command_line : Flag<["-"], "fno-record-command-line">, Group; @@ -1499,7 +1507,10 @@ def : Flag<["-"], "fno-record-gcc-switches">, Alias; def fcommon : Flag<["-"], "fcommon">, Group, Flags<[CoreOption, CC1Option]>, HelpText<"Place uninitialized global variables in a common block">, - MarshallingInfoNegativeFlag>; + MarshallingInfoNegativeFlag>, + DocBrief<[{Place definitions of variables with no storage class and no initializer +(tentative definitions) in a common block, instead of generating individual +zero-initialized definitions (default -fno-common).}]>; def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group; defm complete_member_pointers : BoolOption<"f", "complete-member-pointers", LangOpts<"CompleteMemberPointers">, DefaultFalse, @@ -1738,7 +1749,7 @@ defm keep_static_consts : BoolFOption<"keep-static-consts", CodeGenOpts<"KeepStaticConsts">, DefaultFalse, PosFlag, NegFlag, - BothFlags<[NoXarchOption], " static const variables if unused">>; + BothFlags<[NoXarchOption], " static const variables even if unused">>; defm fixed_point : BoolFOption<"fixed-point", LangOpts<"FixedPoint">, DefaultFalse, PosFlag, NegFlag, @@ -1869,6 +1880,17 @@ CodeGenOpts<"SanitizeAddressPoisonCustomArrayCookie">, DefaultFalse, PosFlag, NegFlag, BothFlags<[], " poisoning array cookies when using custom operator new[] in AddressSanitizer">>, + DocBrief<[{Enable "poisoning" array cookies when allocating arrays with a +custom operator new\[\] in Address Sanitizer, preventing accesses to the +cookies from user code. An array cookie is a small implementation-defined +header added to certain array allocations to record metadata such as the +length of the array. Accesses to array cookies from user code are technically +allowed by the standard but are more likely to be the result of an +out-of-bounds array access. + +An operator new\[\] is "custom" if it is not one of the allocation functions +provided by the C++ standard library. Array cookies from non-custom allocation +functions are always poisoned.}]>, Group; defm sanitize_address_globals_dead_stripping : BoolOption<"f", "sanitize-address-globals-dead-stripping", CodeGenOpts<"SanitizeAddressGlobalsDeadStripping">, DefaultFalse, @@ -1884,7 +1906,10 @@ def sanitize_address_destructor_EQ : Joined<["-"], "fsanitize-address-destructor=">, Flags<[CC1Option]>, - HelpText<"Set destructor type used in ASan instrumentation">, + HelpText<"Set the kind of module destructors emitted by " + "AddressSanitizer instrumentation. These destructors are " + "emitted to unregister instrumented global variables when " + "code is unloaded (e.g. via `dlclose()`).">, Group, Values<"none,global">, NormalizedValuesScope<"llvm::AsanDtorKind">, @@ -2020,16 +2045,24 @@ NegFlag>; defm finite_math_only : BoolFOption<"finite-math-only", LangOpts<"FiniteMathOnly">, DefaultFalse, - PosFlag, + PosFlag, NegFlag>; defm signed_zeros : BoolFOption<"signed-zeros", LangOpts<"NoSignedZero">, DefaultFalse, NegFlag, PosFlag>; -def fhonor_nans : Flag<["-"], "fhonor-nans">, Group; +def fhonor_nans : Flag<["-"], "fhonor-nans">, Group, + HelpText<"Specify that floating-point optimizations are not allowed that " + "assume arguments and results are not NANs.">; def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Group; -def fhonor_infinities : Flag<["-"], "fhonor-infinities">, Group; +def fhonor_infinities : Flag<["-"], "fhonor-infinities">, + Group, + HelpText<"Specify that floating-point optimizations are not allowed that " + "assume arguments and results are not +-inf.">; def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, Group; // This option was originally misspelt "infinites" [sic]. def : Flag<["-"], "fhonor-infinites">, Alias; @@ -2080,14 +2113,25 @@ CodeGenOpts<"NullPointerIsValid">, DefaultFalse, NegFlag, PosFlag, - BothFlags<[CoreOption]>>; + BothFlags<[CoreOption]>>, + DocBrief<[{When enabled, treat null pointer dereference, creation of a reference to null, +or passing a null pointer to a function parameter annotated with the "nonnull" +attribute as undefined behavior. (And, thus the optimizer may assume that any +pointer used in such a way must not have been null and optimize away the +branches accordingly.) On by default.}]>; defm use_line_directives : BoolFOption<"use-line-directives", PreprocessorOutputOpts<"UseLineDirectives">, DefaultFalse, PosFlag, NegFlag>; defm minimize_whitespace : BoolFOption<"minimize-whitespace", PreprocessorOutputOpts<"MinimizeWhitespace">, DefaultFalse, - PosFlag, NegFlag>; + PosFlag, NegFlag>; def ffreestanding : Flag<["-"], "ffreestanding">, Group, Flags<[CC1Option]>, HelpText<"Assert that the compilation takes place in a freestanding environment">, @@ -2135,7 +2179,7 @@ Alias; def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">, Group, Flags<[CC1Option]>, - HelpText<"Enables experimental strict floating point in LLVM.">, + HelpText<"Enables the use of non-default rounding modes and non-default exception handling on targets that are not currently ready.">, MarshallingInfoFlag>; def finput_charset_EQ : Joined<["-"], "finput-charset=">, Flags<[FlangOption, FC1Option]>, Group, HelpText<"Specify the default character set for source files">; @@ -2937,7 +2981,8 @@ defm stack_clash_protection : BoolFOption<"stack-clash-protection", CodeGenOpts<"StackClashProtector">, DefaultFalse, PosFlag, NegFlag, - BothFlags<[], " stack clash protection">>; + BothFlags<[], " stack clash protection">>, + DocBrief<"Instrument stack allocation to prevent stack clash attacks">; def fstack_protector_strong : Flag<["-"], "fstack-protector-strong">, Group, HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. " "Compared to -fstack-protector, this uses a stronger heuristic " @@ -3184,7 +3229,10 @@ defm force_emit_vtables : BoolFOption<"force-emit-vtables", CodeGenOpts<"ForceEmitVTables">, DefaultFalse, PosFlag, - NegFlag, BothFlags<[CoreOption]>>; + NegFlag, BothFlags<[CoreOption]>>, + DocBrief<[{In order to improve devirtualization, forces emitting of vtables even in +modules where it isn't necessary. It causes more inline virtual functions +to be emitted.}]>; defm virtual_function_elimination : BoolFOption<"virtual-function-elimination", CodeGenOpts<"VirtualFunctionElimination">, DefaultFalse, PosFlag, @@ -3380,7 +3428,9 @@ def : Flag<["-"], "gno-record-gcc-switches">, Alias; defm strict_dwarf : BoolOption<"g", "strict-dwarf", CodeGenOpts<"DebugStrictDwarf">, DefaultFalse, - PosFlag, NegFlag, BothFlags<[CoreOption]>>, + PosFlag, + NegFlag, BothFlags<[CoreOption]>>, Group; defm column_info : BoolOption<"g", "column-info", CodeGenOpts<"DebugColumnInfo">, DefaultTrue, @@ -3748,7 +3798,7 @@ let Flags = [TargetSpecific] in { def mno_thumb : Flag<["-"], "mno-thumb">, Group; def mrestrict_it: Flag<["-"], "mrestrict-it">, Group, - HelpText<"Disallow generation of complex IT blocks.">; + HelpText<"Disallow generation of complex IT blocks. It is off by default.">; def mno_restrict_it: Flag<["-"], "mno-restrict-it">, Group, HelpText<"Allow generation of complex IT blocks.">; def marm : Flag<["-"], "marm">, Alias; @@ -3880,7 +3930,11 @@ def mno_extended_const : Flag<["-"], "mno-extended-const">, Group; def mexec_model_EQ : Joined<["-"], "mexec-model=">, Group, Values<"command,reactor">, - HelpText<"Execution model (WebAssembly only)">; + HelpText<"Execution model (WebAssembly only)">, + DocBrief<"Select between \"command\" and \"reactor\" executable models. " + "Commands have a main-function which scopes the lifetime of the " + "program. Reactors are activated and remain active until " + "explicitly terminated.">; } // let Flags = [TargetSpecific] defm amdgpu_ieee : BoolOption<"m", "amdgpu-ieee", @@ -3910,13 +3964,17 @@ defm unsafe_fp_atomics : BoolOption<"m", "unsafe-fp-atomics", TargetOpts<"AllowAMDGPUUnsafeFPAtomics">, DefaultFalse, - PosFlag, + PosFlag, NegFlag>, Group; def faltivec : Flag<["-"], "faltivec">, Group, Flags<[NoXarchOption]>; def fno_altivec : Flag<["-"], "fno-altivec">, Group, Flags<[NoXarchOption]>; let Flags = [TargetSpecific] in { -def maltivec : Flag<["-"], "maltivec">, Group; +def maltivec : Flag<["-"], "maltivec">, Group, + HelpText<"Enable AltiVec vector initializer syntax">; def mno_altivec : Flag<["-"], "mno-altivec">, Group; def mpcrel: Flag<["-"], "mpcrel">, Group; def mno_pcrel: Flag<["-"], "mno-pcrel">, Group; @@ -3972,7 +4030,11 @@ def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Alias; def mpopcntd : Flag<["-"], "mpopcntd">, Group; def mno_popcntd : Flag<["-"], "mno-popcntd">, Group; -def mcrbits : Flag<["-"], "mcrbits">, Group; +def mcrbits : Flag<["-"], "mcrbits">, Group, + HelpText<"Control the CR-bit tracking feature on PowerPC. ``-mcrbits`` " + "(the enablement of CR-bit tracking support) is the default for " + "POWER8 and above, as well as for all other CPUs when " + "optimization is applied (-O2 and above).">; def mno_crbits : Flag<["-"], "mno-crbits">, Group; def minvariant_function_descriptors : Flag<["-"], "minvariant-function-descriptors">, Group; @@ -3996,10 +4058,15 @@ } // let Flags = [TargetSpecific] def maix_struct_return : Flag<["-"], "maix-struct-return">, Group, Flags<[CC1Option]>, - HelpText<"Return all structs in memory (PPC32 only)">; + HelpText<"Return all structs in memory (PPC32 only)">, + DocBrief<"Override the default ABI for 32-bit targets to return all " + "structs in memory, as in the Power 32-bit ABI for Linux (2011), " + "and on AIX and Darwin.">; def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">, Group, Flags<[CC1Option]>, - HelpText<"Return small structs in registers (PPC32 only)">; + HelpText<"Return small structs in registers (PPC32 only)">, + DocBrief<"Override the default ABI for 32-bit targets to return small " + "structs in registers, as in the System V ABI (1995).">; def mxcoff_roptr : Flag<["-"], "mxcoff-roptr">, Group, Flags<[CC1Option,TargetSpecific]>, HelpText<"Place constant objects with relocatable address values in the RO data section and add -bforceimprw to the linker flags (AIX only)">; def mno_xcoff_roptr : Flag<["-"], "mno-xcoff-roptr">, Group, TargetSpecific; @@ -5067,7 +5134,10 @@ defm ivopts : BooleanFFlag<"ivopts">, Group; defm semantic_interposition : BoolFOption<"semantic-interposition", LangOpts<"SemanticInterposition">, DefaultFalse, - PosFlag, NegFlag>; + PosFlag, NegFlag>, + DocBrief<[{Enable semantic interposition. Semantic interposition allows for the +interposition of a symbol by another at runtime, thus preventing a range of +inter-procedural optimisation.}]>; defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">, Group; defm peel_loops : BooleanFFlag<"peel-loops">, Group; defm permissive : BooleanFFlag<"permissive">, Group;