Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -425,6 +425,18 @@ Group; } +// Creates a BoolOption where both of the flags are prefixed with "m", have +// help text specified for enabled and disabled option, and a Group optionally +// specified by the OptGroup argument, otherwise Group. +multiclass BoolMOption { + def m # NAME : Flag<["-"], "m" # flag_base >, Group, + HelpText; + def mno_ # NAME : Flag<["-"], "mno-" # flag_base>, Group, + HelpText; +} + // FIXME: Diagnose if target does not support protected visibility. class MarshallingInfoVisibility : MarshallingInfoString, @@ -3097,23 +3109,20 @@ HelpText<"Specify code object ABI version. Defaults to 3. (AMDGPU only)">, MetaVarName<"">, Values<"2,3,4">; -def mcode_object_v3_legacy : Flag<["-"], "mcode-object-v3">, Group, - HelpText<"Legacy option to specify code object ABI V2 (-mnocode-object-v3) or V3 (-mcode-object-v3) (AMDGPU only)">; -def mno_code_object_v3_legacy : Flag<["-"], "mno-code-object-v3">, Group; - -def mcumode : Flag<["-"], "mcumode">, Group, - HelpText<"Specify CU (-mcumode) or WGP (-mno-cumode) wavefront execution mode (AMDGPU only)">; -def mno_cumode : Flag<["-"], "mno-cumode">, Group; - -def mtgsplit : Flag<["-"], "mtgsplit">, Group, - HelpText<"Enable threadgroup split execution mode (AMDGPU only)">; -def mno_tgsplit : Flag<["-"], "mno-tgsplit">, Group, - HelpText<"Disable threadgroup split execution mode (AMDGPU only)">; - -def mwavefrontsize64 : Flag<["-"], "mwavefrontsize64">, Group, - HelpText<"Specify wavefront size 64 mode (AMDGPU only)">; -def mno_wavefrontsize64 : Flag<["-"], "mno-wavefrontsize64">, Group, - HelpText<"Specify wavefront size 32 mode (AMDGPU only)">; +defm code_object_v3_legacy : BoolMOption<"code-object-v3", + "Legacy option to specify code object ABI V3 (AMDGPU only)", + "Legacy option to specify code object ABI V2 (AMDGPU only)">; +defm cumode : BoolMOption<"cumode", + "Specify CU wavefront execution mode (AMDGPU only)", + "Specify WGP wavefront execution mode (AMDGPU only)", + m_amdgpu_Features_Group>; +defm tgsplit : BoolMOption<"tgsplit", + "Elable threadgroup split execution mode (AMDGPU only)", + "Disable threadgroup split execution mode (AMDGPU only)", + m_amdgpu_Features_Group>; +defm wavefrontsize64 : BoolMOption<"wavefrontsize64", + "Specify wavefront size 64 mode (AMDGPU only)", + "Specify wavefront size 32 mode (AMDGPU only)">; defm unsafe_fp_atomics : BoolOption<"m", "unsafe-fp-atomics", TargetOpts<"AllowAMDGPUUnsafeFPAtomics">, DefaultFalse,