]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/clang/include/clang/Driver/Options.td
Merge llvm-project release/17.x llvmorg-17.0.6-0-g6009708b4367
[FreeBSD/FreeBSD.git] / contrib / llvm-project / clang / include / clang / Driver / Options.td
1 //===--- Options.td - Options for clang -----------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //  This file defines the options accepted by clang.
10 //
11 //===----------------------------------------------------------------------===//
12
13 // Include the common option parsing interfaces.
14 include "llvm/Option/OptParser.td"
15
16 /////////
17 // Flags
18
19 // The option is a "driver"-only option, and should not be forwarded to other
20 // tools via `-Xarch` options.
21 def NoXarchOption : OptionFlag;
22
23 // LinkerInput - The option is a linker input.
24 def LinkerInput : OptionFlag;
25
26 // NoArgumentUnused - Don't report argument unused warnings for this option; this
27 // is useful for options like -static or -dynamic which a user may always end up
28 // passing, even if the platform defaults to (or only supports) that option.
29 def NoArgumentUnused : OptionFlag;
30
31 // Unsupported - The option is unsupported, and the driver will reject command
32 // lines that use it.
33 def Unsupported : OptionFlag;
34
35 // Ignored - The option is unsupported, and the driver will silently ignore it.
36 def Ignored : OptionFlag;
37
38 // CoreOption - This is considered a "core" Clang option, available in both
39 // clang and clang-cl modes.
40 def CoreOption : OptionFlag;
41
42 // CLOption - This is a cl.exe compatibility option. Options with this flag
43 // are made available when the driver is running in CL compatibility mode.
44 def CLOption : OptionFlag;
45
46 // CC1Option - This option should be accepted by clang -cc1.
47 def CC1Option : OptionFlag;
48
49 // CC1AsOption - This option should be accepted by clang -cc1as.
50 def CC1AsOption : OptionFlag;
51
52 // DXCOption - This is a dxc.exe compatibility option. Options with this flag
53 // are made available when the driver is running in DXC compatibility mode.
54 def DXCOption : OptionFlag;
55
56 // CLDXCOption - This is a cl.exe/dxc.exe compatibility option. Options with this flag
57 // are made available when the driver is running in CL/DXC compatibility mode.
58 def CLDXCOption : OptionFlag;
59
60 // NoDriverOption - This option should not be accepted by the driver.
61 def NoDriverOption : OptionFlag;
62
63 // If an option affects linking, but has a primary group (so Link_Group cannot
64 // be used), add this flag.
65 def LinkOption : OptionFlag;
66
67 // FlangOption - This is considered a "core" Flang option, available in
68 // flang mode.
69 def FlangOption : OptionFlag;
70
71 // FlangOnlyOption - This option should only be used by Flang (i.e. it is not
72 // available for Clang)
73 def FlangOnlyOption : OptionFlag;
74
75 // FC1Option - This option should be accepted by flang -fc1.
76 def FC1Option : OptionFlag;
77
78 // This is a target-specific option for compilation. Using it on an unsupported
79 // target will lead to an err_drv_unsupported_opt_for_target error.
80 def TargetSpecific : OptionFlag;
81
82 // A short name to show in documentation. The name will be interpreted as rST.
83 class DocName<string name> { string DocName = name; }
84
85 // A brief description to show in documentation, interpreted as rST.
86 class DocBrief<code descr> { code DocBrief = descr; }
87
88 // Indicates that this group should be flattened into its parent when generating
89 // documentation.
90 class DocFlatten { bit DocFlatten = 1; }
91
92 // Indicates that this warning is ignored, but accepted with a warning for
93 // GCC compatibility.
94 class IgnoredGCCCompat : Flags<[HelpHidden]> {}
95
96 class TargetSpecific : Flags<[TargetSpecific]> {}
97
98 /////////
99 // Groups
100
101 def Action_Group : OptionGroup<"<action group>">, DocName<"Actions">,
102                    DocBrief<[{The action to perform on the input.}]>;
103
104 // Meta-group for options which are only used for compilation,
105 // and not linking etc.
106 def CompileOnly_Group : OptionGroup<"<CompileOnly group>">,
107                         DocName<"Compilation flags">, DocBrief<[{
108 Flags controlling the behavior of Clang during compilation. These flags have
109 no effect during actions that do not perform compilation.}]>;
110
111 def Preprocessor_Group : OptionGroup<"<Preprocessor group>">,
112                          Group<CompileOnly_Group>,
113                          DocName<"Preprocessor flags">, DocBrief<[{
114 Flags controlling the behavior of the Clang preprocessor.}]>;
115
116 def IncludePath_Group : OptionGroup<"<I/i group>">, Group<Preprocessor_Group>,
117                         DocName<"Include path management">,
118                         DocBrief<[{
119 Flags controlling how ``#include``\s are resolved to files.}]>;
120
121 def I_Group : OptionGroup<"<I group>">, Group<IncludePath_Group>, DocFlatten;
122 def i_Group : OptionGroup<"<i group>">, Group<IncludePath_Group>, DocFlatten;
123 def clang_i_Group : OptionGroup<"<clang i group>">, Group<i_Group>, DocFlatten;
124
125 def M_Group : OptionGroup<"<M group>">, Group<Preprocessor_Group>,
126               DocName<"Dependency file generation">, DocBrief<[{
127 Flags controlling generation of a dependency file for ``make``-like build
128 systems.}]>;
129
130 def d_Group : OptionGroup<"<d group>">, Group<Preprocessor_Group>,
131               DocName<"Dumping preprocessor state">, DocBrief<[{
132 Flags allowing the state of the preprocessor to be dumped in various ways.}]>;
133
134 def Diag_Group : OptionGroup<"<W/R group>">, Group<CompileOnly_Group>,
135                  DocName<"Diagnostic flags">, DocBrief<[{
136 Flags controlling which warnings, errors, and remarks Clang will generate.
137 See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.}]>;
138
139 def R_Group : OptionGroup<"<R group>">, Group<Diag_Group>, DocFlatten;
140 def R_value_Group : OptionGroup<"<R (with value) group>">, Group<R_Group>,
141                     DocFlatten;
142 def W_Group : OptionGroup<"<W group>">, Group<Diag_Group>, DocFlatten;
143 def W_value_Group : OptionGroup<"<W (with value) group>">, Group<W_Group>,
144                     DocFlatten;
145
146 def f_Group : OptionGroup<"<f group>">, Group<CompileOnly_Group>,
147               DocName<"Target-independent compilation options">;
148
149 def f_clang_Group : OptionGroup<"<f (clang-only) group>">,
150                     Group<CompileOnly_Group>, DocFlatten;
151 def pedantic_Group : OptionGroup<"<pedantic group>">, Group<f_Group>,
152                      DocFlatten;
153 def opencl_Group : OptionGroup<"<opencl group>">, Group<f_Group>,
154                    DocName<"OpenCL flags">;
155
156 def sycl_Group : OptionGroup<"<SYCL group>">, Group<f_Group>,
157                  DocName<"SYCL flags">;
158
159 def m_Group : OptionGroup<"<m group>">, Group<CompileOnly_Group>,
160               DocName<"Target-dependent compilation options">;
161
162 // Feature groups - these take command line options that correspond directly to
163 // target specific features and can be translated directly from command line
164 // options.
165 def m_aarch64_Features_Group : OptionGroup<"<aarch64 features group>">,
166                                Group<m_Group>, DocName<"AARCH64">;
167 def m_amdgpu_Features_Group : OptionGroup<"<amdgpu features group>">,
168                               Group<m_Group>, DocName<"AMDGPU">;
169 def m_arm_Features_Group : OptionGroup<"<arm features group>">,
170                            Group<m_Group>, DocName<"ARM">;
171 def m_hexagon_Features_Group : OptionGroup<"<hexagon features group>">,
172                                Group<m_Group>, DocName<"Hexagon">;
173 def m_sparc_Features_Group : OptionGroup<"<sparc features group>">,
174                                Group<m_Group>, DocName<"SPARC">;
175 // The features added by this group will not be added to target features.
176 // These are explicitly handled.
177 def m_hexagon_Features_HVX_Group : OptionGroup<"<hexagon features group>">,
178                                    Group<m_Group>, DocName<"Hexagon">;
179 def m_m68k_Features_Group: OptionGroup<"<m68k features group>">,
180                            Group<m_Group>, DocName<"M68k">;
181 def m_mips_Features_Group : OptionGroup<"<mips features group>">,
182                             Group<m_Group>, DocName<"MIPS">;
183 def m_ppc_Features_Group : OptionGroup<"<ppc features group>">,
184                            Group<m_Group>, DocName<"PowerPC">;
185 def m_wasm_Features_Group : OptionGroup<"<wasm features group>">,
186                             Group<m_Group>, DocName<"WebAssembly">;
187 // The features added by this group will not be added to target features.
188 // These are explicitly handled.
189 def m_wasm_Features_Driver_Group : OptionGroup<"<wasm driver features group>">,
190                                    Group<m_Group>, DocName<"WebAssembly Driver">;
191 def m_x86_Features_Group : OptionGroup<"<x86 features group>">,
192                            Group<m_Group>, Flags<[CoreOption]>, DocName<"X86">;
193 def m_riscv_Features_Group : OptionGroup<"<riscv features group>">,
194                              Group<m_Group>, DocName<"RISC-V">;
195
196 def m_libc_Group : OptionGroup<"<m libc group>">, Group<m_mips_Features_Group>,
197                    Flags<[HelpHidden]>;
198
199 def O_Group : OptionGroup<"<O group>">, Group<CompileOnly_Group>,
200               DocName<"Optimization level">, DocBrief<[{
201 Flags controlling how much optimization should be performed.}]>;
202
203 def DebugInfo_Group : OptionGroup<"<g group>">, Group<CompileOnly_Group>,
204                       DocName<"Debug information generation">, DocBrief<[{
205 Flags controlling how much and what kind of debug information should be
206 generated.}]>;
207
208 def g_Group : OptionGroup<"<g group>">, Group<DebugInfo_Group>,
209               DocName<"Kind and level of debug information">;
210 def gN_Group : OptionGroup<"<gN group>">, Group<g_Group>,
211                DocName<"Debug level">;
212 def ggdbN_Group : OptionGroup<"<ggdbN group>">, Group<gN_Group>, DocFlatten;
213 def gTune_Group : OptionGroup<"<gTune group>">, Group<g_Group>,
214                   DocName<"Debugger to tune debug information for">;
215 def g_flags_Group : OptionGroup<"<g flags group>">, Group<DebugInfo_Group>,
216                     DocName<"Debug information flags">;
217
218 def StaticAnalyzer_Group : OptionGroup<"<Static analyzer group>">,
219                            DocName<"Static analyzer flags">, DocBrief<[{
220 Flags controlling the behavior of the Clang Static Analyzer.}]>;
221
222 // gfortran options that we recognize in the driver and pass along when
223 // invoking GCC to compile Fortran code.
224 def gfortran_Group : OptionGroup<"<gfortran group>">,
225                      DocName<"Fortran compilation flags">, DocBrief<[{
226 Flags that will be passed onto the ``gfortran`` compiler when Clang is given
227 a Fortran input.}]>;
228
229 def Link_Group : OptionGroup<"<T/e/s/t/u group>">, DocName<"Linker flags">,
230                  DocBrief<[{Flags that are passed on to the linker}]>;
231 def T_Group : OptionGroup<"<T group>">, Group<Link_Group>, DocFlatten;
232 def u_Group : OptionGroup<"<u group>">, Group<Link_Group>, DocFlatten;
233
234 def reserved_lib_Group : OptionGroup<"<reserved libs group>">,
235                          Flags<[Unsupported]>;
236
237 // Temporary groups for clang options which we know we don't support,
238 // but don't want to verbosely warn the user about.
239 def clang_ignored_f_Group : OptionGroup<"<clang ignored f group>">,
240   Group<f_Group>, Flags<[Ignored]>;
241 def clang_ignored_m_Group : OptionGroup<"<clang ignored m group>">,
242   Group<m_Group>, Flags<[Ignored]>;
243
244 // Unsupported flang groups
245 def flang_ignored_w_Group : OptionGroup<"<flang ignored W group>">,
246   Group<W_Group>, Flags<[FlangOnlyOption, Ignored]>;
247
248 // Group for clang options in the process of deprecation.
249 // Please include the version that deprecated the flag as comment to allow
250 // easier garbage collection.
251 def clang_ignored_legacy_options_Group : OptionGroup<"<clang legacy flags>">,
252   Group<f_Group>, Flags<[Ignored]>;
253
254 def LongDouble_Group : OptionGroup<"<LongDouble group>">, Group<m_Group>,
255   DocName<"Long double flags">,
256   DocBrief<[{Selects the long double implementation}]>;
257
258 // Retired with clang-5.0
259 def : Flag<["-"], "fslp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;
260 def : Flag<["-"], "fno-slp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;
261
262 // Retired with clang-10.0. Previously controlled X86 MPX ISA.
263 def mmpx : Flag<["-"], "mmpx">, Group<clang_ignored_legacy_options_Group>;
264 def mno_mpx : Flag<["-"], "mno-mpx">, Group<clang_ignored_legacy_options_Group>;
265
266 // Retired with clang-16.0, to provide a deprecation period; it should
267 // be removed in Clang 18 or later.
268 def enable_trivial_var_init_zero : Flag<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
269   Flags<[CC1Option, CoreOption, NoArgumentUnused]>,
270   Group<clang_ignored_legacy_options_Group>;
271
272 // Group that ignores all gcc optimizations that won't be implemented
273 def clang_ignored_gcc_optimization_f_Group : OptionGroup<
274   "<clang_ignored_gcc_optimization_f_Group>">, Group<f_Group>, Flags<[Ignored]>;
275
276 class DiagnosticOpts<string base>
277   : KeyPathAndMacro<"DiagnosticOpts->", base, "DIAG_"> {}
278 class LangOpts<string base>
279   : KeyPathAndMacro<"LangOpts->", base, "LANG_"> {}
280 class TargetOpts<string base>
281   : KeyPathAndMacro<"TargetOpts->", base, "TARGET_"> {}
282 class FrontendOpts<string base>
283   : KeyPathAndMacro<"FrontendOpts.", base, "FRONTEND_"> {}
284 class PreprocessorOutputOpts<string base>
285   : KeyPathAndMacro<"PreprocessorOutputOpts.", base, "PREPROCESSOR_OUTPUT_"> {}
286 class DependencyOutputOpts<string base>
287   : KeyPathAndMacro<"DependencyOutputOpts.", base, "DEPENDENCY_OUTPUT_"> {}
288 class CodeGenOpts<string base>
289   : KeyPathAndMacro<"CodeGenOpts.", base, "CODEGEN_"> {}
290 class HeaderSearchOpts<string base>
291   : KeyPathAndMacro<"HeaderSearchOpts->", base, "HEADER_SEARCH_"> {}
292 class PreprocessorOpts<string base>
293   : KeyPathAndMacro<"PreprocessorOpts->", base, "PREPROCESSOR_"> {}
294 class FileSystemOpts<string base>
295   : KeyPathAndMacro<"FileSystemOpts.", base, "FILE_SYSTEM_"> {}
296 class AnalyzerOpts<string base>
297   : KeyPathAndMacro<"AnalyzerOpts->", base, "ANALYZER_"> {}
298 class MigratorOpts<string base>
299   : KeyPathAndMacro<"MigratorOpts.", base, "MIGRATOR_"> {}
300
301 // A boolean option which is opt-in in CC1. The positive option exists in CC1 and
302 // Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
303 // This is useful if the option is usually disabled.
304 // Use this only when the option cannot be declared via BoolFOption.
305 multiclass OptInCC1FFlag<string name, string pos_prefix, string neg_prefix="",
306                       string help="", list<OptionFlag> flags=[]> {
307   def f#NAME : Flag<["-"], "f"#name>, Flags<[CC1Option] # flags>,
308                Group<f_Group>, HelpText<pos_prefix # help>;
309   def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<flags>,
310                   Group<f_Group>, HelpText<neg_prefix # help>;
311 }
312
313 // A boolean option which is opt-out in CC1. The negative option exists in CC1 and
314 // Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
315 // Use this only when the option cannot be declared via BoolFOption.
316 multiclass OptOutCC1FFlag<string name, string pos_prefix, string neg_prefix,
317                        string help="", list<OptionFlag> flags=[]> {
318   def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
319                Group<f_Group>, HelpText<pos_prefix # help>;
320   def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[CC1Option] # flags>,
321                   Group<f_Group>, HelpText<neg_prefix # help>;
322 }
323
324 // A boolean option which is opt-in in FC1. The positive option exists in FC1 and
325 // Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
326 // This is useful if the option is usually disabled.
327 multiclass OptInFC1FFlag<string name, string pos_prefix, string neg_prefix="",
328                       string help="", list<OptionFlag> flags=[]> {
329   def f#NAME : Flag<["-"], "f"#name>, Flags<[FC1Option] # flags>,
330                Group<f_Group>, HelpText<pos_prefix # help>;
331   def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<flags>,
332                   Group<f_Group>, HelpText<neg_prefix # help>;
333 }
334
335 // A boolean option which is opt-out in FC1. The negative option exists in FC1 and
336 // Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
337 multiclass OptOutFC1FFlag<string name, string pos_prefix, string neg_prefix,
338                        string help="", list<OptionFlag> flags=[]> {
339   def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
340                Group<f_Group>, HelpText<pos_prefix # help>;
341   def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[FC1Option] # flags>,
342                   Group<f_Group>, HelpText<neg_prefix # help>;
343 }
344
345 // Creates a positive and negative flags where both of them are prefixed with
346 // "m", have help text specified for positive and negative option, and a Group
347 // optionally specified by the opt_group argument, otherwise Group<m_Group>.
348 multiclass SimpleMFlag<string name, string pos_prefix, string neg_prefix,
349                        string help, OptionGroup opt_group = m_Group> {
350   def m#NAME : Flag<["-"], "m"#name>, Group<opt_group>,
351     HelpText<pos_prefix # help>;
352   def mno_#NAME : Flag<["-"], "mno-"#name>, Group<opt_group>,
353     HelpText<neg_prefix # help>;
354 }
355
356 //===----------------------------------------------------------------------===//
357 // BoolOption
358 //===----------------------------------------------------------------------===//
359
360 // The default value of a marshalled key path.
361 class Default<code value> { code Value = value; }
362
363 // Convenience variables for boolean defaults.
364 def DefaultTrue : Default<"true"> {}
365 def DefaultFalse : Default<"false"> {}
366
367 // The value set to the key path when the flag is present on the command line.
368 class Set<bit value> { bit Value = value; }
369 def SetTrue : Set<true> {}
370 def SetFalse : Set<false> {}
371
372 // Definition of single command line flag. This is an implementation detail, use
373 // SetTrueBy or SetFalseBy instead.
374 class FlagDef<bit polarity, bit value, list<OptionFlag> option_flags,
375               string help, list<code> implied_by_expressions = []> {
376   // The polarity. Besides spelling, this also decides whether the TableGen
377   // record will be prefixed with "no_".
378   bit Polarity = polarity;
379
380   // The value assigned to key path when the flag is present on command line.
381   bit Value = value;
382
383   // OptionFlags that control visibility of the flag in different tools.
384   list<OptionFlag> OptionFlags = option_flags;
385
386   // The help text associated with the flag.
387   string Help = help;
388
389   // List of expressions that, when true, imply this flag.
390   list<code> ImpliedBy = implied_by_expressions;
391 }
392
393 // Additional information to be appended to both positive and negative flag.
394 class BothFlags<list<OptionFlag> option_flags, string help = ""> {
395   list<OptionFlag> OptionFlags = option_flags;
396   string Help = help;
397 }
398
399 // Functor that appends the suffix to the base flag definition.
400 class ApplySuffix<FlagDef flag, BothFlags suffix> {
401   FlagDef Result
402     = FlagDef<flag.Polarity, flag.Value,
403               flag.OptionFlags # suffix.OptionFlags,
404               flag.Help # suffix.Help, flag.ImpliedBy>;
405 }
406
407 // Definition of the command line flag with positive spelling, e.g. "-ffoo".
408 class PosFlag<Set value, list<OptionFlag> flags = [], string help = "",
409               list<code> implied_by_expressions = []>
410   : FlagDef<true, value.Value, flags, help, implied_by_expressions> {}
411
412 // Definition of the command line flag with negative spelling, e.g. "-fno-foo".
413 class NegFlag<Set value, list<OptionFlag> flags = [], string help = "",
414               list<code> implied_by_expressions = []>
415   : FlagDef<false, value.Value, flags, help, implied_by_expressions> {}
416
417 // Expanded FlagDef that's convenient for creation of TableGen records.
418 class FlagDefExpanded<FlagDef flag, string prefix, string name, string spelling>
419   : FlagDef<flag.Polarity, flag.Value, flag.OptionFlags, flag.Help,
420             flag.ImpliedBy> {
421   // Name of the TableGen record.
422   string RecordName = prefix # !if(flag.Polarity, "", "no_") # name;
423
424   // Spelling of the flag.
425   string Spelling = prefix # !if(flag.Polarity, "", "no-") # spelling;
426
427   // Can the flag be implied by another flag?
428   bit CanBeImplied = !not(!empty(flag.ImpliedBy));
429
430   // C++ code that will be assigned to the keypath when the flag is present.
431   code ValueAsCode = !if(flag.Value, "true", "false");
432 }
433
434 // TableGen record for a single marshalled flag.
435 class MarshalledFlagRec<FlagDefExpanded flag, FlagDefExpanded other,
436                         FlagDefExpanded implied, KeyPathAndMacro kpm,
437                         Default default>
438   : Flag<["-"], flag.Spelling>, Flags<flag.OptionFlags>, HelpText<flag.Help>,
439     MarshallingInfoBooleanFlag<kpm, default.Value, flag.ValueAsCode,
440                                other.ValueAsCode, other.RecordName>,
441     ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode> {}
442
443 // Generates TableGen records for two command line flags that control the same
444 // key path via the marshalling infrastructure.
445 // Names of the records consist of the specified prefix, "no_" for the negative
446 // flag, and NAME.
447 // Used for -cc1 frontend options. Driver-only options do not map to
448 // CompilerInvocation.
449 multiclass BoolOption<string prefix = "", string spelling_base,
450                       KeyPathAndMacro kpm, Default default,
451                       FlagDef flag1_base, FlagDef flag2_base,
452                       BothFlags suffix = BothFlags<[], "">> {
453   defvar flag1 = FlagDefExpanded<ApplySuffix<flag1_base, suffix>.Result, prefix,
454                                  NAME, spelling_base>;
455
456   defvar flag2 = FlagDefExpanded<ApplySuffix<flag2_base, suffix>.Result, prefix,
457                                  NAME, spelling_base>;
458
459   // The flags must have different polarity, different values, and only
460   // one can be implied.
461   assert !xor(flag1.Polarity, flag2.Polarity),
462          "the flags must have different polarity: flag1: " #
463              flag1.Polarity # ", flag2: " # flag2.Polarity;
464   assert !ne(flag1.Value, flag2.Value),
465          "the flags must have different values: flag1: " #
466              flag1.Value # ", flag2: " # flag2.Value;
467   assert !not(!and(flag1.CanBeImplied, flag2.CanBeImplied)),
468          "only one of the flags can be implied: flag1: " #
469              flag1.CanBeImplied # ", flag2: " # flag2.CanBeImplied;
470
471   defvar implied = !if(flag1.CanBeImplied, flag1, flag2);
472
473   def flag1.RecordName : MarshalledFlagRec<flag1, flag2, implied, kpm, default>;
474   def flag2.RecordName : MarshalledFlagRec<flag2, flag1, implied, kpm, default>;
475 }
476
477 /// Creates a BoolOption where both of the flags are prefixed with "f", are in
478 /// the Group<f_Group>.
479 /// Used for -cc1 frontend options. Driver-only options do not map to
480 /// CompilerInvocation.
481 multiclass BoolFOption<string flag_base, KeyPathAndMacro kpm,
482                        Default default, FlagDef flag1, FlagDef flag2,
483                        BothFlags both = BothFlags<[], "">> {
484   defm NAME : BoolOption<"f", flag_base, kpm, default, flag1, flag2, both>,
485               Group<f_Group>;
486 }
487
488 // Creates a BoolOption where both of the flags are prefixed with "g" and have
489 // the Group<g_Group>.
490 // Used for -cc1 frontend options. Driver-only options do not map to
491 // CompilerInvocation.
492 multiclass BoolGOption<string flag_base, KeyPathAndMacro kpm,
493                        Default default, FlagDef flag1, FlagDef flag2,
494                        BothFlags both = BothFlags<[], "">> {
495   defm NAME : BoolOption<"g", flag_base, kpm, default, flag1, flag2, both>,
496               Group<g_Group>;
497 }
498
499 // Works like BoolOption except without marshalling
500 multiclass BoolOptionWithoutMarshalling<string prefix = "", string spelling_base,
501                                         FlagDef flag1_base, FlagDef flag2_base,
502                                         BothFlags suffix = BothFlags<[], "">> {
503   defvar flag1 = FlagDefExpanded<ApplySuffix<flag1_base, suffix>.Result, prefix,
504                                  NAME, spelling_base>;
505
506   defvar flag2 = FlagDefExpanded<ApplySuffix<flag2_base, suffix>.Result, prefix,
507                                  NAME, spelling_base>;
508
509   // The flags must have different polarity, different values, and only
510   // one can be implied.
511   assert !xor(flag1.Polarity, flag2.Polarity),
512          "the flags must have different polarity: flag1: " #
513              flag1.Polarity # ", flag2: " # flag2.Polarity;
514   assert !ne(flag1.Value, flag2.Value),
515          "the flags must have different values: flag1: " #
516              flag1.Value # ", flag2: " # flag2.Value;
517   assert !not(!and(flag1.CanBeImplied, flag2.CanBeImplied)),
518          "only one of the flags can be implied: flag1: " #
519              flag1.CanBeImplied # ", flag2: " # flag2.CanBeImplied;
520
521   defvar implied = !if(flag1.CanBeImplied, flag1, flag2);
522
523   def flag1.RecordName : Flag<["-"], flag1.Spelling>, Flags<flag1.OptionFlags>,
524                          HelpText<flag1.Help>,
525                          ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode>
526                          {}
527   def flag2.RecordName : Flag<["-"], flag2.Spelling>, Flags<flag2.OptionFlags>,
528                          HelpText<flag2.Help>,
529                          ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode>
530                          {}
531 }
532
533 // FIXME: Diagnose if target does not support protected visibility.
534 class MarshallingInfoVisibility<KeyPathAndMacro kpm, code default>
535   : MarshallingInfoEnum<kpm, default>,
536     Values<"default,hidden,internal,protected">,
537     NormalizedValues<["DefaultVisibility", "HiddenVisibility",
538                       "HiddenVisibility", "ProtectedVisibility"]> {}
539
540 // Key paths that are constant during parsing of options with the same key path prefix.
541 defvar cplusplus = LangOpts<"CPlusPlus">;
542 defvar cpp11 = LangOpts<"CPlusPlus11">;
543 defvar cpp17 = LangOpts<"CPlusPlus17">;
544 defvar cpp20 = LangOpts<"CPlusPlus20">;
545 defvar c99 = LangOpts<"C99">;
546 defvar c2x = LangOpts<"C2x">;
547 defvar lang_std = LangOpts<"LangStd">;
548 defvar open_cl = LangOpts<"OpenCL">;
549 defvar cuda = LangOpts<"CUDA">;
550 defvar render_script = LangOpts<"RenderScript">;
551 defvar hip = LangOpts<"HIP">;
552 defvar gnu_mode = LangOpts<"GNUMode">;
553 defvar asm_preprocessor = LangOpts<"AsmPreprocessor">;
554 defvar hlsl = LangOpts<"HLSL">;
555
556 defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")");
557
558 /////////
559 // Options
560
561 // The internal option ID must be a valid C++ identifier and results in a
562 // clang::driver::options::OPT_XX enum constant for XX.
563 //
564 // We want to unambiguously be able to refer to options from the driver source
565 // code, for this reason the option name is mangled into an ID. This mangling
566 // isn't guaranteed to have an inverse, but for practical purposes it does.
567 //
568 // The mangling scheme is to ignore the leading '-', and perform the following
569 // substitutions:
570 //   _ => __
571 //   - => _
572 //   / => _SLASH
573 //   # => _HASH
574 //   ? => _QUESTION
575 //   , => _COMMA
576 //   = => _EQ
577 //   C++ => CXX
578 //   . => _
579
580 // Developer Driver Options
581
582 def internal_Group : OptionGroup<"<clang internal options>">, Flags<[HelpHidden]>;
583 def internal_driver_Group : OptionGroup<"<clang driver internal options>">,
584   Group<internal_Group>, HelpText<"DRIVER OPTIONS">;
585 def internal_debug_Group :
586   OptionGroup<"<clang debug/development internal options>">,
587   Group<internal_Group>, HelpText<"DEBUG/DEVELOPMENT OPTIONS">;
588
589 class InternalDriverOpt : Group<internal_driver_Group>,
590   Flags<[NoXarchOption, HelpHidden]>;
591 def driver_mode : Joined<["--"], "driver-mode=">, Group<internal_driver_Group>,
592   Flags<[CoreOption, NoXarchOption, HelpHidden]>,
593   HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', or 'cl'">;
594 def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group<internal_driver_Group>,
595   Flags<[CoreOption, NoXarchOption, HelpHidden]>,
596   HelpText<"Set the rsp quoting to either 'posix', or 'windows'">;
597 def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, InternalDriverOpt,
598   HelpText<"Name for native GCC compiler">,
599   MetaVarName<"<gcc-path>">;
600
601 class InternalDebugOpt : Group<internal_debug_Group>,
602   Flags<[NoXarchOption, HelpHidden, CoreOption]>;
603 def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt,
604   HelpText<"Simulate installation in the given directory">;
605 def ccc_print_phases : Flag<["-"], "ccc-print-phases">, InternalDebugOpt,
606   HelpText<"Dump list of actions to perform">;
607 def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, InternalDebugOpt,
608   HelpText<"Show bindings of tools to actions">;
609
610 def ccc_arcmt_check : Flag<["-"], "ccc-arcmt-check">, InternalDriverOpt,
611   HelpText<"Check for ARC migration issues that need manual handling">;
612 def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, InternalDriverOpt,
613   HelpText<"Apply modifications to files to conform to ARC">;
614 def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt,
615   HelpText<"Apply modifications and produces temporary files that conform to ARC">;
616 def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">,
617   HelpText<"Output path for the plist report">,  Flags<[CC1Option]>,
618   MarshallingInfoString<FrontendOpts<"ARCMTMigrateReportOut">>;
619 def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">,
620   HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>,
621   MarshallingInfoFlag<FrontendOpts<"ARCMTMigrateEmitARCErrors">>;
622 def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">, Flags<[NoArgumentUnused, CoreOption]>,
623   HelpText<"Emit reproducer on (option: off, crash (default), error, always)">;
624 def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt,
625   Alias<gen_reproducer_eq>, AliasArgs<["always"]>,
626   HelpText<"Auto-generates preprocessed source files and a reproduction script">;
627 def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt,
628   HelpText<"Emit a compilation database fragment to the specified directory">;
629
630 def round_trip_args : Flag<["-"], "round-trip-args">, Flags<[CC1Option, NoDriverOption]>,
631   HelpText<"Enable command line arguments round-trip.">;
632 def no_round_trip_args : Flag<["-"], "no-round-trip-args">, Flags<[CC1Option, NoDriverOption]>,
633   HelpText<"Disable command line arguments round-trip.">;
634
635 def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>,
636   HelpText<"Run the migrator">;
637 def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">,
638   InternalDriverOpt,
639   HelpText<"Apply modifications and produces temporary files to migrate to "
640    "modern ObjC syntax">;
641
642 def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">, Flags<[CC1Option]>,
643   HelpText<"Enable migration to modern ObjC literals">,
644   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Literals">;
645 def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">, Flags<[CC1Option]>,
646   HelpText<"Enable migration to modern ObjC subscripting">,
647   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Subscripting">;
648 def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">, Flags<[CC1Option]>,
649   HelpText<"Enable migration to modern ObjC property">,
650   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Property">;
651 def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">, Flags<[CC1Option]>,
652   HelpText<"Enable migration to modern ObjC">,
653   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_MigrateDecls">;
654 def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">, Flags<[CC1Option]>,
655   HelpText<"Enable migration to modern ObjC readonly property">,
656   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadonlyProperty">;
657 def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">, Flags<[CC1Option]>,
658   HelpText<"Enable migration to modern ObjC readwrite property">,
659   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadwriteProperty">;
660 def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">, Flags<[CC1Option]>,
661   HelpText<"Enable migration of setter/getter messages to property-dot syntax">,
662   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_PropertyDotSyntax">;
663 def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">, Flags<[CC1Option]>,
664   HelpText<"Enable migration to property and method annotations">,
665   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Annotation">;
666 def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">, Flags<[CC1Option]>,
667   HelpText<"Enable migration to infer instancetype for method result type">,
668   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Instancetype">;
669 def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">, Flags<[CC1Option]>,
670   HelpText<"Enable migration to NS_ENUM/NS_OPTIONS macros">,
671   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsMacros">;
672 def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">, Flags<[CC1Option]>,
673   HelpText<"Enable migration to add protocol conformance on classes">,
674   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ProtocolConformance">;
675 def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">, Flags<[CC1Option]>,
676   HelpText<"Make migration to 'atomic' properties">,
677   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_AtomicProperty">;
678 def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">, Flags<[CC1Option]>,
679   HelpText<"Enable migration to annotate property with NS_RETURNS_INNER_POINTER">,
680   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReturnsInnerPointerProperty">;
681 def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">, Flags<[CC1Option]>,
682   HelpText<"Enable migration to use NS_NONATOMIC_IOSONLY macro for setting property's 'atomic' attribute">,
683   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty">;
684 def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">, Flags<[CC1Option]>,
685   HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">,
686   MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_DesignatedInitializer">;
687
688 def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">, Flags<[CC1Option]>,
689   HelpText<"Only modify files with a filename contained in the provided directory path">,
690   MarshallingInfoString<FrontendOpts<"ObjCMTAllowListPath">>;
691 def : Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>,
692   HelpText<"Alias for -objcmt-allowlist-dir-path">,
693   Alias<objcmt_allowlist_dir_path>;
694 // The misspelt "white-list" [sic] alias is due for removal.
695 def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>,
696   Alias<objcmt_allowlist_dir_path>;
697
698 // Make sure all other -ccc- options are rejected.
699 def ccc_ : Joined<["-"], "ccc-">, Group<internal_Group>, Flags<[Unsupported]>;
700
701 // Standard Options
702
703 def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption, CoreOption, FlangOption]>,
704     HelpText<"Print (but do not run) the commands to run for this compilation">;
705 def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>,
706     Flags<[NoXarchOption, CoreOption]>;
707 def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group<gfortran_Group>;
708 def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"<prefix>">,
709     HelpText<"Search $prefix$file for executables, libraries, and data files. "
710     "If $prefix is a directory, search $prefix/$file">;
711 def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">,
712   HelpText<"Use GCC installation in the specified directory. The directory ends with path components like 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
713   "Note: executables (e.g. ld) used by the compiler are not overridden by the selected GCC installation">;
714 def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>,
715   HelpText<"Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
716   "Clang will use the GCC installation with the largest version">;
717 def CC : Flag<["-"], "CC">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
718     HelpText<"Include comments from within macros in preprocessed output">,
719     MarshallingInfoFlag<PreprocessorOutputOpts<"ShowMacroComments">>;
720 def C : Flag<["-"], "C">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
721     HelpText<"Include comments in preprocessed output">,
722     MarshallingInfoFlag<PreprocessorOutputOpts<"ShowComments">>;
723 def D : JoinedOrSeparate<["-"], "D">, Group<Preprocessor_Group>,
724     Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"<macro>=<value>">,
725     HelpText<"Define <macro> to <value> (or 1 if <value> omitted)">;
726 def E : Flag<["-"], "E">, Flags<[NoXarchOption,CC1Option, FlangOption, FC1Option]>, Group<Action_Group>,
727     HelpText<"Only run the preprocessor">;
728 def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>,
729     HelpText<"Add directory to framework include search path">;
730 def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption,TargetSpecific]>, Group<m_Group>,
731     MetaVarName<"<size>">, HelpText<"Put objects of at most <size> bytes "
732     "into small data section (MIPS / Hexagon)">;
733 def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>, Group<m_Group>, Alias<G>;
734 def H : Flag<["-"], "H">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
735     HelpText<"Show header includes and nesting depth">,
736     MarshallingInfoFlag<DependencyOutputOpts<"ShowHeaderIncludes">>;
737 def fshow_skipped_includes : Flag<["-"], "fshow-skipped-includes">,
738   Flags<[CC1Option]>, HelpText<"Show skipped includes in -H output.">,
739   DocBrief<[{#include files may be "skipped" due to include guard optimization
740              or #pragma once. This flag makes -H show also such includes.}]>,
741   MarshallingInfoFlag<DependencyOutputOpts<"ShowSkippedHeaderIncludes">>;
742
743 def I_ : Flag<["-"], "I-">, Group<I_Group>,
744     HelpText<"Restrict all prior -I flags to double-quoted inclusion and "
745              "remove current directory from include path">;
746 def I : JoinedOrSeparate<["-"], "I">, Group<I_Group>,
747     Flags<[CC1Option,CC1AsOption,FlangOption,FC1Option]>, MetaVarName<"<dir>">,
748     HelpText<"Add directory to the end of the list of include search paths">,
749     DocBrief<[{Add directory to include search path. For C++ inputs, if
750 there are multiple -I options, these directories are searched
751 in the order they are given before the standard system directories
752 are searched. If the same directory is in the SYSTEM include search
753 paths, for example if also specified with -isystem, the -I option
754 will be ignored}]>;
755 def L : JoinedOrSeparate<["-"], "L">, Flags<[RenderJoined]>, Group<Link_Group>,
756     MetaVarName<"<dir>">, HelpText<"Add directory to library search path">;
757 def MD : Flag<["-"], "MD">, Group<M_Group>,
758     HelpText<"Write a depfile containing user and system headers">;
759 def MMD : Flag<["-"], "MMD">, Group<M_Group>,
760     HelpText<"Write a depfile containing user headers">;
761 def M : Flag<["-"], "M">, Group<M_Group>,
762     HelpText<"Like -MD, but also implies -E and writes to stdout by default">;
763 def MM : Flag<["-"], "MM">, Group<M_Group>,
764     HelpText<"Like -MMD, but also implies -E and writes to stdout by default">;
765 def MF : JoinedOrSeparate<["-"], "MF">, Group<M_Group>,
766     HelpText<"Write depfile output from -MMD, -MD, -MM, or -M to <file>">,
767     MetaVarName<"<file>">;
768 def MG : Flag<["-"], "MG">, Group<M_Group>, Flags<[CC1Option]>,
769     HelpText<"Add missing headers to depfile">,
770     MarshallingInfoFlag<DependencyOutputOpts<"AddMissingHeaderDeps">>;
771 def MJ : JoinedOrSeparate<["-"], "MJ">, Group<M_Group>,
772     HelpText<"Write a compilation database entry per input">;
773 def MP : Flag<["-"], "MP">, Group<M_Group>, Flags<[CC1Option]>,
774     HelpText<"Create phony target for each dependency (other than main file)">,
775     MarshallingInfoFlag<DependencyOutputOpts<"UsePhonyTargets">>;
776 def MQ : JoinedOrSeparate<["-"], "MQ">, Group<M_Group>, Flags<[CC1Option]>,
777     HelpText<"Specify name of main file output to quote in depfile">;
778 def MT : JoinedOrSeparate<["-"], "MT">, Group<M_Group>, Flags<[CC1Option]>,
779     HelpText<"Specify name of main file output in depfile">,
780     MarshallingInfoStringVector<DependencyOutputOpts<"Targets">>;
781 def MV : Flag<["-"], "MV">, Group<M_Group>, Flags<[CC1Option]>,
782     HelpText<"Use NMake/Jom format for the depfile">,
783     MarshallingInfoFlag<DependencyOutputOpts<"OutputFormat">, "DependencyOutputFormat::Make">,
784     Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">;
785 def Mach : Flag<["-"], "Mach">, Group<Link_Group>;
786 def O0 : Flag<["-"], "O0">, Group<O_Group>, Flags<[CC1Option, FC1Option, HelpHidden]>;
787 def O4 : Flag<["-"], "O4">, Group<O_Group>, Flags<[CC1Option, FC1Option, HelpHidden]>;
788 def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>,
789   HelpText<"Treat source input files as Objective-C++ inputs">;
790 def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>,
791   HelpText<"Treat source input files as Objective-C inputs">;
792 def O : Joined<["-"], "O">, Group<O_Group>, Flags<[CC1Option,FC1Option]>;
793 def O_flag : Flag<["-"], "O">, Flags<[CC1Option,FC1Option]>, Alias<O>, AliasArgs<["1"]>;
794 def Ofast : Joined<["-"], "Ofast">, Group<O_Group>, Flags<[CC1Option, FlangOption]>;
795 def P : Flag<["-"], "P">, Flags<[CC1Option,FlangOption,FC1Option]>, Group<Preprocessor_Group>,
796   HelpText<"Disable linemarker output in -E mode">,
797   MarshallingInfoNegativeFlag<PreprocessorOutputOpts<"ShowLineMarkers">>;
798 def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>,
799   HelpText<"Emit metadata containing compiler name and version">;
800 def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>,
801   HelpText<"Do not emit metadata containing compiler name and version">;
802 def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>,
803   Flags<[CoreOption, CC1Option]>;
804 def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>,
805   Flags<[CoreOption, CC1Option]>;
806 def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>,
807   HelpText<"Don't emit warning for unused driver arguments">;
808 def Q : Flag<["-"], "Q">, IgnoredGCCCompat;
809 def Rpass_EQ : Joined<["-"], "Rpass=">, Group<R_value_Group>, Flags<[CC1Option]>,
810   HelpText<"Report transformations performed by optimization passes whose "
811            "name matches the given POSIX regular expression">;
812 def Rpass_missed_EQ : Joined<["-"], "Rpass-missed=">, Group<R_value_Group>,
813   Flags<[CC1Option]>,
814   HelpText<"Report missed transformations by optimization passes whose "
815            "name matches the given POSIX regular expression">;
816 def Rpass_analysis_EQ : Joined<["-"], "Rpass-analysis=">, Group<R_value_Group>,
817   Flags<[CC1Option]>,
818   HelpText<"Report transformation analysis from optimization passes whose "
819            "name matches the given POSIX regular expression">;
820 def R_Joined : Joined<["-"], "R">, Group<R_Group>, Flags<[CC1Option, CoreOption]>,
821   MetaVarName<"<remark>">, HelpText<"Enable the specified remark">;
822 def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option,FlangOption,FC1Option]>, Group<Action_Group>,
823   HelpText<"Only run preprocess and compilation steps">;
824 def T : JoinedOrSeparate<["-"], "T">, Group<T_Group>,
825   MetaVarName<"<script>">, HelpText<"Specify <script> as linker script">;
826 def U : JoinedOrSeparate<["-"], "U">, Group<Preprocessor_Group>,
827   Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"<macro>">, HelpText<"Undefine macro <macro>">;
828 def V : JoinedOrSeparate<["-"], "V">, Flags<[NoXarchOption, Unsupported]>;
829 def Wa_COMMA : CommaJoined<["-"], "Wa,">,
830   HelpText<"Pass the comma separated arguments in <arg> to the assembler">,
831   MetaVarName<"<arg>">;
832 def Wall : Flag<["-"], "Wall">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
833 def WCL4 : Flag<["-"], "WCL4">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
834 def Wsystem_headers : Flag<["-"], "Wsystem-headers">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
835 def Wno_system_headers : Flag<["-"], "Wno-system-headers">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
836 def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<W_Group>, Flags<[CC1Option]>,
837   HelpText<"Enable warnings for deprecated constructs and define __DEPRECATED">;
838 def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>, Flags<[CC1Option]>;
839 def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>,
840   HelpText<"Pass the comma separated arguments in <arg> to the linker">,
841   MetaVarName<"<arg>">, Group<Link_Group>;
842 // FIXME: This is broken; these should not be Joined arguments.
843 def Wno_nonportable_cfstrings : Joined<["-"], "Wno-nonportable-cfstrings">, Group<W_Group>,
844   Flags<[CC1Option]>;
845 def Wnonportable_cfstrings : Joined<["-"], "Wnonportable-cfstrings">, Group<W_Group>,
846   Flags<[CC1Option]>;
847 def Wp_COMMA : CommaJoined<["-"], "Wp,">,
848   HelpText<"Pass the comma separated arguments in <arg> to the preprocessor">,
849   MetaVarName<"<arg>">, Group<Preprocessor_Group>;
850 def Wundef_prefix_EQ : CommaJoined<["-"], "Wundef-prefix=">, Group<W_value_Group>,
851   Flags<[CC1Option, CoreOption, HelpHidden]>, MetaVarName<"<arg>">,
852   HelpText<"Enable warnings for undefined macros with a prefix in the comma separated list <arg>">,
853   MarshallingInfoStringVector<DiagnosticOpts<"UndefPrefixes">>;
854 def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
855 def Wno_write_strings : Flag<["-"], "Wno-write-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
856 def W_Joined : Joined<["-"], "W">, Group<W_Group>, Flags<[CC1Option, CoreOption, FC1Option, FlangOption]>,
857   MetaVarName<"<warning>">, HelpText<"Enable the specified warning">;
858 def Xanalyzer : Separate<["-"], "Xanalyzer">,
859   HelpText<"Pass <arg> to the static analyzer">, MetaVarName<"<arg>">,
860   Group<StaticAnalyzer_Group>;
861 def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[NoXarchOption]>;
862 def Xarch_host : Separate<["-"], "Xarch_host">, Flags<[NoXarchOption]>,
863   HelpText<"Pass <arg> to the CUDA/HIP host compilation">, MetaVarName<"<arg>">;
864 def Xarch_device : Separate<["-"], "Xarch_device">, Flags<[NoXarchOption]>,
865   HelpText<"Pass <arg> to the CUDA/HIP device compilation">, MetaVarName<"<arg>">;
866 def Xassembler : Separate<["-"], "Xassembler">,
867   HelpText<"Pass <arg> to the assembler">, MetaVarName<"<arg>">,
868   Group<CompileOnly_Group>;
869 def Xclang : Separate<["-"], "Xclang">,
870   HelpText<"Pass <arg> to clang -cc1">, MetaVarName<"<arg>">,
871   Flags<[NoXarchOption, CoreOption]>, Group<CompileOnly_Group>;
872 def : Joined<["-"], "Xclang=">, Group<CompileOnly_Group>, Flags<[NoXarchOption, CoreOption]>, Alias<Xclang>,
873   HelpText<"Alias for -Xclang">, MetaVarName<"<arg>">;
874 def Xcuda_fatbinary : Separate<["-"], "Xcuda-fatbinary">,
875   HelpText<"Pass <arg> to fatbinary invocation">, MetaVarName<"<arg>">;
876 def Xcuda_ptxas : Separate<["-"], "Xcuda-ptxas">,
877   HelpText<"Pass <arg> to the ptxas assembler">, MetaVarName<"<arg>">;
878 def Xopenmp_target : Separate<["-"], "Xopenmp-target">, Group<CompileOnly_Group>,
879   HelpText<"Pass <arg> to the target offloading toolchain.">, MetaVarName<"<arg>">;
880 def Xopenmp_target_EQ : JoinedAndSeparate<["-"], "Xopenmp-target=">, Group<CompileOnly_Group>,
881   HelpText<"Pass <arg> to the target offloading toolchain identified by <triple>.">,
882   MetaVarName<"<triple> <arg>">;
883 def z : Separate<["-"], "z">, Flags<[LinkerInput]>,
884   HelpText<"Pass -z <arg> to the linker">, MetaVarName<"<arg>">,
885   Group<Link_Group>;
886 def offload_link : Flag<["--"], "offload-link">, Group<Link_Group>,
887   HelpText<"Use the new offloading linker to perform the link job.">;
888 def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>,
889   HelpText<"Pass <arg> to the linker">, MetaVarName<"<arg>">,
890   Group<Link_Group>;
891 def Xoffload_linker : JoinedAndSeparate<["-"], "Xoffload-linker">,
892   HelpText<"Pass <arg> to the offload linkers or the ones idenfied by -<triple>">,
893   MetaVarName<"<triple> <arg>">, Group<Link_Group>;
894 def Xpreprocessor : Separate<["-"], "Xpreprocessor">, Group<Preprocessor_Group>,
895   HelpText<"Pass <arg> to the preprocessor">, MetaVarName<"<arg>">;
896 def X_Flag : Flag<["-"], "X">, Group<Link_Group>;
897 // Used by some macOS projects. IgnoredGCCCompat is a misnomer since GCC doesn't allow it.
898 def : Flag<["-"], "Xparser">, IgnoredGCCCompat;
899 // FIXME -Xcompiler is misused by some ChromeOS packages. Remove it after a while.
900 def : Flag<["-"], "Xcompiler">, IgnoredGCCCompat;
901 def Z_Flag : Flag<["-"], "Z">, Group<Link_Group>;
902 def all__load : Flag<["-"], "all_load">;
903 def allowable__client : Separate<["-"], "allowable_client">;
904 def ansi : Flag<["-", "--"], "ansi">, Group<CompileOnly_Group>;
905 def arch__errors__fatal : Flag<["-"], "arch_errors_fatal">;
906 def arch : Separate<["-"], "arch">, Flags<[NoXarchOption]>;
907 def arch__only : Separate<["-"], "arch_only">;
908 def autocomplete : Joined<["--"], "autocomplete=">;
909 def bind__at__load : Flag<["-"], "bind_at_load">;
910 def bundle__loader : Separate<["-"], "bundle_loader">;
911 def bundle : Flag<["-"], "bundle">;
912 def b : JoinedOrSeparate<["-"], "b">, Flags<[LinkerInput]>,
913   HelpText<"Pass -b <arg> to the linker on AIX">, MetaVarName<"<arg>">,
914   Group<Link_Group>;
915 // OpenCL-only Options
916 def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group<opencl_Group>, Flags<[CC1Option]>,
917   HelpText<"OpenCL only. This option disables all optimizations. By default optimizations are enabled.">;
918 def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group<opencl_Group>, Flags<[CC1Option]>,
919   HelpText<"OpenCL only. This option is added for compatibility with OpenCL 1.0.">;
920 def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">, Group<opencl_Group>, Flags<[CC1Option]>,
921   HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">,
922   MarshallingInfoFlag<LangOpts<"SinglePrecisionConstants">>;
923 def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">, Group<opencl_Group>, Flags<[CC1Option]>,
924   HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">,
925   MarshallingInfoFlag<LangOpts<"CLFiniteMathOnly">>;
926 def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">, Group<opencl_Group>, Flags<[CC1Option]>,
927   HelpText<"OpenCL only. Generate kernel argument metadata.">,
928   MarshallingInfoFlag<CodeGenOpts<"EmitOpenCLArgMetadata">>;
929 def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">, Group<opencl_Group>, Flags<[CC1Option]>,
930   HelpText<"OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable.">,
931   MarshallingInfoFlag<LangOpts<"CLUnsafeMath">>;
932 def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">, Group<opencl_Group>, Flags<[CC1Option]>,
933   HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__.">,
934   MarshallingInfoFlag<LangOpts<"FastRelaxedMath">>;
935 def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>, Flags<[CC1Option]>,
936   HelpText<"OpenCL only. Allow use of less precise MAD computations in the generated binary.">,
937   MarshallingInfoFlag<CodeGenOpts<"LessPreciseFPMAD">>,
938   ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, cl_fast_relaxed_math.KeyPath]>;
939 def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>, Flags<[CC1Option]>,
940   HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">,
941   MarshallingInfoFlag<LangOpts<"CLNoSignedZero">>;
942 def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>, Flags<[CC1Option]>,
943   HelpText<"OpenCL language standard to compile for.">,
944   Values<"cl,CL,cl1.0,CL1.0,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,cl3.0,CL3.0,clc++,CLC++,clc++1.0,CLC++1.0,clc++2021,CLC++2021">;
945 def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>,
946   HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
947 def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>, Flags<[CC1Option]>,
948   HelpText<"OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.">,
949   MarshallingInfoFlag<CodeGenOpts<"OpenCLCorrectlyRoundedDivSqrt">>;
950 def cl_uniform_work_group_size : Flag<["-"], "cl-uniform-work-group-size">, Group<opencl_Group>, Flags<[CC1Option]>,
951   HelpText<"OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel">,
952   MarshallingInfoFlag<CodeGenOpts<"UniformWGSize">>;
953 def cl_no_stdinc : Flag<["-"], "cl-no-stdinc">, Group<opencl_Group>,
954   HelpText<"OpenCL only. Disables all standard includes containing non-native compiler types and functions.">;
955 def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">, Group<opencl_Group>, Flags<[CC1Option]>,
956   HelpText<"OpenCL only. Enable or disable OpenCL extensions/optional features. The argument is a comma-separated "
957            "sequence of one or more extension names, each prefixed by '+' or '-'.">,
958   MarshallingInfoStringVector<TargetOpts<"OpenCLExtensionsAsWritten">>;
959
960 def client__name : JoinedOrSeparate<["-"], "client_name">;
961 def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>;
962 def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">;
963 def config : Joined<["--"], "config=">, Flags<[NoXarchOption, CoreOption]>, MetaVarName<"<file>">,
964   HelpText<"Specify configuration file">;
965 def : Separate<["--"], "config">, Alias<config>;
966 def no_default_config : Flag<["--"], "no-default-config">, Flags<[NoXarchOption, CoreOption]>,
967   HelpText<"Disable loading default configuration files">;
968 def config_system_dir_EQ : Joined<["--"], "config-system-dir=">, Flags<[NoXarchOption, CoreOption, HelpHidden]>,
969   HelpText<"System directory for configuration files">;
970 def config_user_dir_EQ : Joined<["--"], "config-user-dir=">, Flags<[NoXarchOption, CoreOption, HelpHidden]>,
971   HelpText<"User directory for configuration files">;
972 def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>, Flags<[CoreOption]>;
973 def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
974 def current__version : JoinedOrSeparate<["-"], "current_version">;
975 def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
976   HelpText<"Add directory to the C++ SYSTEM include search path">, Flags<[CC1Option]>,
977   MetaVarName<"<directory>">;
978 def c : Flag<["-"], "c">, Flags<[NoXarchOption, FlangOption]>, Group<Action_Group>,
979   HelpText<"Only run preprocess, compile, and assemble steps">;
980 defm convergent_functions : BoolFOption<"convergent-functions",
981   LangOpts<"ConvergentFunctions">, DefaultFalse,
982   NegFlag<SetFalse, [], "Assume all functions may be convergent.">,
983   PosFlag<SetTrue, [CC1Option]>>;
984
985 def gpu_use_aux_triple_only : Flag<["--"], "gpu-use-aux-triple-only">,
986   InternalDriverOpt, HelpText<"Prepare '-aux-triple' only without populating "
987                               "'-aux-target-cpu' and '-aux-target-feature'.">;
988 def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">, Flags<[NoXarchOption]>,
989   HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
990 def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXarchOption]>,
991   HelpText<"Do not include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
992 def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
993   HelpText<"Specify an offloading device architecture for CUDA, HIP, or OpenMP. (e.g. sm_35). "
994            "If 'native' is used the compiler will detect locally installed architectures. "
995            "For HIP offloading, the device architecture can be followed by target ID features "
996            "delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once.">;
997 def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">, Flags<[NoXarchOption]>,
998   Alias<offload_arch_EQ>;
999 def cuda_feature_EQ : Joined<["--"], "cuda-feature=">, HelpText<"Manually specify the CUDA feature to use">;
1000 def hip_link : Flag<["--"], "hip-link">,
1001   HelpText<"Link clang-offload-bundler bundles for HIP">;
1002 def no_hip_rt: Flag<["-"], "no-hip-rt">,
1003   HelpText<"Do not link against HIP runtime libraries">;
1004 def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">, Flags<[NoXarchOption]>,
1005   HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. "
1006            "'all' resets the list to its default value.">;
1007 def emit_static_lib : Flag<["--"], "emit-static-lib">,
1008   HelpText<"Enable linker job to emit a static library.">;
1009 def no_cuda_gpu_arch_EQ : Joined<["--"], "no-cuda-gpu-arch=">, Flags<[NoXarchOption]>,
1010   Alias<no_offload_arch_EQ>;
1011 def cuda_noopt_device_debug : Flag<["--"], "cuda-noopt-device-debug">,
1012   HelpText<"Enable device-side debug info generation. Disables ptxas optimizations.">;
1013 def no_cuda_version_check : Flag<["--"], "no-cuda-version-check">,
1014   HelpText<"Don't error out if the detected version of the CUDA install is "
1015            "too low for the requested CUDA gpu architecture.">;
1016 def no_cuda_noopt_device_debug : Flag<["--"], "no-cuda-noopt-device-debug">;
1017 def cuda_path_EQ : Joined<["--"], "cuda-path=">, Group<i_Group>,
1018   HelpText<"CUDA installation path">;
1019 def cuda_path_ignore_env : Flag<["--"], "cuda-path-ignore-env">, Group<i_Group>,
1020   HelpText<"Ignore environment variables to detect CUDA installation">;
1021 def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Group<i_Group>,
1022   HelpText<"Path to ptxas (used for compiling CUDA code)">;
1023 def fgpu_flush_denormals_to_zero : Flag<["-"], "fgpu-flush-denormals-to-zero">,
1024   HelpText<"Flush denormal floating point values to zero in CUDA/HIP device mode.">;
1025 def fno_gpu_flush_denormals_to_zero : Flag<["-"], "fno-gpu-flush-denormals-to-zero">;
1026 def fcuda_flush_denormals_to_zero : Flag<["-"], "fcuda-flush-denormals-to-zero">,
1027   Alias<fgpu_flush_denormals_to_zero>;
1028 def fno_cuda_flush_denormals_to_zero : Flag<["-"], "fno-cuda-flush-denormals-to-zero">,
1029   Alias<fno_gpu_flush_denormals_to_zero>;
1030 defm gpu_rdc : BoolFOption<"gpu-rdc",
1031   LangOpts<"GPURelocatableDeviceCode">, DefaultFalse,
1032   PosFlag<SetTrue, [CC1Option], "Generate relocatable device code, also known as separate compilation mode">,
1033   NegFlag<SetFalse>>;
1034 def : Flag<["-"], "fcuda-rdc">, Alias<fgpu_rdc>;
1035 def : Flag<["-"], "fno-cuda-rdc">, Alias<fno_gpu_rdc>;
1036 defm cuda_short_ptr : BoolFOption<"cuda-short-ptr",
1037   TargetOpts<"NVPTXUseShortPointers">, DefaultFalse,
1038   PosFlag<SetTrue, [CC1Option], "Use 32-bit pointers for accessing const/local/shared address spaces">,
1039   NegFlag<SetFalse>>;
1040 def mprintf_kind_EQ : Joined<["-"], "mprintf-kind=">, Group<m_Group>,
1041   HelpText<"Specify the printf lowering scheme (AMDGPU only), allowed values are "
1042   "\"hostcall\"(printing happens during kernel execution, this scheme "
1043   "relies on hostcalls which require system to support pcie atomics) "
1044   "and \"buffered\"(printing happens after all kernel threads exit, "
1045   "this uses a printf buffer and does not rely on pcie atomic support)">,
1046   Flags<[CC1Option]>,
1047   Values<"hostcall,buffered">,
1048   NormalizedValuesScope<"TargetOptions::AMDGPUPrintfKind">,
1049   NormalizedValues<["Hostcall", "Buffered"]>,
1050   MarshallingInfoEnum<TargetOpts<"AMDGPUPrintfKindVal">, "Hostcall">;
1051 def fgpu_default_stream_EQ : Joined<["-"], "fgpu-default-stream=">,
1052   HelpText<"Specify default stream. The default value is 'legacy'. (HIP only)">,
1053   Flags<[CC1Option]>,
1054   Values<"legacy,per-thread">,
1055   NormalizedValuesScope<"LangOptions::GPUDefaultStreamKind">,
1056   NormalizedValues<["Legacy", "PerThread"]>,
1057   MarshallingInfoEnum<LangOpts<"GPUDefaultStream">, "Legacy">;
1058 def rocm_path_EQ : Joined<["--"], "rocm-path=">, Group<i_Group>,
1059   HelpText<"ROCm installation path, used for finding and automatically linking required bitcode libraries.">;
1060 def hip_path_EQ : Joined<["--"], "hip-path=">, Group<i_Group>,
1061   HelpText<"HIP runtime installation path, used for finding HIP version and adding HIP include path.">;
1062 def amdgpu_arch_tool_EQ : Joined<["--"], "amdgpu-arch-tool=">, Group<i_Group>,
1063   HelpText<"Tool used for detecting AMD GPU arch in the system.">;
1064 def nvptx_arch_tool_EQ : Joined<["--"], "nvptx-arch-tool=">, Group<i_Group>,
1065   HelpText<"Tool used for detecting NVIDIA GPU arch in the system.">;
1066 def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Group<Link_Group>,
1067   HelpText<"ROCm device library path. Alternative to rocm-path.">;
1068 def : Joined<["--"], "hip-device-lib-path=">, Alias<rocm_device_lib_path_EQ>;
1069 def hip_device_lib_EQ : Joined<["--"], "hip-device-lib=">, Group<Link_Group>,
1070   HelpText<"HIP device library">;
1071 def hip_version_EQ : Joined<["--"], "hip-version=">,
1072   HelpText<"HIP version in the format of major.minor.patch">;
1073 def fhip_dump_offload_linker_script : Flag<["-"], "fhip-dump-offload-linker-script">,
1074   Group<f_Group>, Flags<[NoArgumentUnused, HelpHidden]>;
1075 defm hip_new_launch_api : BoolFOption<"hip-new-launch-api",
1076   LangOpts<"HIPUseNewLaunchAPI">, DefaultFalse,
1077   PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
1078   BothFlags<[], " new kernel launching API for HIP">>;
1079 defm hip_fp32_correctly_rounded_divide_sqrt : BoolFOption<"hip-fp32-correctly-rounded-divide-sqrt",
1080   CodeGenOpts<"HIPCorrectlyRoundedDivSqrt">, DefaultTrue,
1081   PosFlag<SetTrue, [], "Specify">,
1082   NegFlag<SetFalse, [CC1Option], "Don't specify">,
1083   BothFlags<[], " that single precision floating-point divide and sqrt used in "
1084   "the program source are correctly rounded (HIP device compilation only)">>,
1085   ShouldParseIf<hip.KeyPath>;
1086 defm hip_kernel_arg_name : BoolFOption<"hip-kernel-arg-name",
1087   CodeGenOpts<"HIPSaveKernelArgName">, DefaultFalse,
1088   PosFlag<SetTrue, [CC1Option], "Specify">,
1089   NegFlag<SetFalse, [], "Don't specify">,
1090   BothFlags<[], " that kernel argument names are preserved (HIP only)">>,
1091   ShouldParseIf<hip.KeyPath>;
1092 def hipspv_pass_plugin_EQ : Joined<["--"], "hipspv-pass-plugin=">,
1093   Group<Link_Group>, MetaVarName<"<dsopath>">,
1094   HelpText<"path to a pass plugin for HIP to SPIR-V passes.">;
1095 defm gpu_allow_device_init : BoolFOption<"gpu-allow-device-init",
1096   LangOpts<"GPUAllowDeviceInit">, DefaultFalse,
1097   PosFlag<SetTrue, [CC1Option], "Allow">, NegFlag<SetFalse, [], "Don't allow">,
1098   BothFlags<[], " device side init function in HIP (experimental)">>,
1099   ShouldParseIf<hip.KeyPath>;
1100 defm gpu_defer_diag : BoolFOption<"gpu-defer-diag",
1101   LangOpts<"GPUDeferDiag">, DefaultFalse,
1102   PosFlag<SetTrue, [CC1Option], "Defer">, NegFlag<SetFalse, [], "Don't defer">,
1103   BothFlags<[], " host/device related diagnostic messages for CUDA/HIP">>;
1104 defm gpu_exclude_wrong_side_overloads : BoolFOption<"gpu-exclude-wrong-side-overloads",
1105   LangOpts<"GPUExcludeWrongSideOverloads">, DefaultFalse,
1106   PosFlag<SetTrue, [CC1Option], "Always exclude wrong side overloads">,
1107   NegFlag<SetFalse, [], "Exclude wrong side overloads only if there are same side overloads">,
1108   BothFlags<[HelpHidden], " in overloading resolution for CUDA/HIP">>;
1109 def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">,
1110   Flags<[CC1Option]>,
1111   HelpText<"Default max threads per block for kernel launch bounds for HIP">,
1112   MarshallingInfoInt<LangOpts<"GPUMaxThreadsPerBlock">, "1024">,
1113   ShouldParseIf<hip.KeyPath>;
1114 def fgpu_inline_threshold_EQ : Joined<["-"], "fgpu-inline-threshold=">,
1115   Flags<[HelpHidden]>,
1116   HelpText<"Inline threshold for device compilation for CUDA/HIP">;
1117 def gpu_instrument_lib_EQ : Joined<["--"], "gpu-instrument-lib=">,
1118   HelpText<"Instrument device library for HIP, which is a LLVM bitcode containing "
1119   "__cyg_profile_func_enter and __cyg_profile_func_exit">;
1120 def fgpu_sanitize : Flag<["-"], "fgpu-sanitize">, Group<f_Group>,
1121   HelpText<"Enable sanitizer for AMDGPU target">;
1122 def fno_gpu_sanitize : Flag<["-"], "fno-gpu-sanitize">, Group<f_Group>;
1123 def gpu_bundle_output : Flag<["--"], "gpu-bundle-output">,
1124   Group<f_Group>, HelpText<"Bundle output files of HIP device compilation">;
1125 def no_gpu_bundle_output : Flag<["--"], "no-gpu-bundle-output">,
1126   Group<f_Group>, HelpText<"Do not bundle output files of HIP device compilation">;
1127 def fhip_emit_relocatable : Flag<["-"], "fhip-emit-relocatable">, Group<f_Group>,
1128   HelpText<"Compile HIP source to relocatable">;
1129 def fno_hip_emit_relocatable : Flag<["-"], "fno-hip-emit-relocatable">, Group<f_Group>,
1130   HelpText<"Do not override toolchain to compile HIP source to relocatable">;
1131 def cuid_EQ : Joined<["-"], "cuid=">, Flags<[CC1Option]>,
1132   HelpText<"An ID for compilation unit, which should be the same for the same "
1133            "compilation unit but different for different compilation units. "
1134            "It is used to externalize device-side static variables for single "
1135            "source offloading languages CUDA and HIP so that they can be "
1136            "accessed by the host code of the same compilation unit.">,
1137   MarshallingInfoString<LangOpts<"CUID">>;
1138 def fuse_cuid_EQ : Joined<["-"], "fuse-cuid=">,
1139   HelpText<"Method to generate ID's for compilation units for single source "
1140            "offloading languages CUDA and HIP: 'hash' (ID's generated by hashing "
1141            "file path and command line options) | 'random' (ID's generated as "
1142            "random numbers) | 'none' (disabled). Default is 'hash'. This option "
1143            "will be overridden by option '-cuid=[ID]' if it is specified." >;
1144 def libomptarget_amdgpu_bc_path_EQ : Joined<["--"], "libomptarget-amdgpu-bc-path=">, Group<i_Group>,
1145   HelpText<"Path to libomptarget-amdgcn bitcode library">;
1146 def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path=">, Group<i_Group>,
1147   HelpText<"Path to libomptarget-amdgcn bitcode library">, Alias<libomptarget_amdgpu_bc_path_EQ>;
1148 def libomptarget_nvptx_bc_path_EQ : Joined<["--"], "libomptarget-nvptx-bc-path=">, Group<i_Group>,
1149   HelpText<"Path to libomptarget-nvptx bitcode library">;
1150 def dD : Flag<["-"], "dD">, Group<d_Group>, Flags<[CC1Option]>,
1151   HelpText<"Print macro definitions in -E mode in addition to normal output">;
1152 def dI : Flag<["-"], "dI">, Group<d_Group>, Flags<[CC1Option]>,
1153   HelpText<"Print include directives in -E mode in addition to normal output">,
1154   MarshallingInfoFlag<PreprocessorOutputOpts<"ShowIncludeDirectives">>;
1155 def dM : Flag<["-"], "dM">, Group<d_Group>, Flags<[CC1Option]>,
1156   HelpText<"Print macro definitions in -E mode instead of normal output">;
1157 def dead__strip : Flag<["-"], "dead_strip">;
1158 def dependency_file : Separate<["-"], "dependency-file">, Flags<[CC1Option]>,
1159   HelpText<"Filename (or -) to write dependency output to">,
1160   MarshallingInfoString<DependencyOutputOpts<"OutputFile">>;
1161 def dependency_dot : Separate<["-"], "dependency-dot">, Flags<[CC1Option]>,
1162   HelpText<"Filename to write DOT-formatted header dependencies to">,
1163   MarshallingInfoString<DependencyOutputOpts<"DOTOutputFile">>;
1164 def module_dependency_dir : Separate<["-"], "module-dependency-dir">,
1165   Flags<[CC1Option]>, HelpText<"Directory to dump module dependencies to">,
1166   MarshallingInfoString<DependencyOutputOpts<"ModuleDependencyOutputDir">>;
1167 def dsym_dir : JoinedOrSeparate<["-"], "dsym-dir">,
1168   Flags<[NoXarchOption, RenderAsInput]>,
1169   HelpText<"Directory to output dSYM's (if any) to">, MetaVarName<"<dir>">;
1170 // GCC style -dumpdir. We intentionally don't implement the less useful -dumpbase{,-ext}.
1171 def dumpdir : Separate<["-"], "dumpdir">, Flags<[CC1Option]>,
1172   MetaVarName<"<dumppfx>">,
1173   HelpText<"Use <dumpfpx> as a prefix to form auxiliary and dump file names">;
1174 def dumpmachine : Flag<["-"], "dumpmachine">;
1175 def dumpspecs : Flag<["-"], "dumpspecs">, Flags<[Unsupported]>;
1176 def dumpversion : Flag<["-"], "dumpversion">;
1177 def dylib__file : Separate<["-"], "dylib_file">;
1178 def dylinker__install__name : JoinedOrSeparate<["-"], "dylinker_install_name">;
1179 def dylinker : Flag<["-"], "dylinker">;
1180 def dynamiclib : Flag<["-"], "dynamiclib">;
1181 def dynamic : Flag<["-"], "dynamic">, Flags<[NoArgumentUnused]>;
1182 def d_Flag : Flag<["-"], "d">, Group<d_Group>;
1183 def d_Joined : Joined<["-"], "d">, Group<d_Group>;
1184 def emit_ast : Flag<["-"], "emit-ast">, Flags<[CoreOption]>,
1185   HelpText<"Emit Clang AST files for source inputs">;
1186 def emit_llvm : Flag<["-"], "emit-llvm">, Flags<[CC1Option, FC1Option, FlangOption]>, Group<Action_Group>,
1187   HelpText<"Use the LLVM representation for assembler and object files">;
1188 def emit_interface_stubs : Flag<["-"], "emit-interface-stubs">, Flags<[CC1Option]>, Group<Action_Group>,
1189   HelpText<"Generate Interface Stub Files.">;
1190 def emit_merged_ifs : Flag<["-"], "emit-merged-ifs">,
1191   Flags<[CC1Option]>, Group<Action_Group>,
1192   HelpText<"Generate Interface Stub Files, emit merged text not binary.">;
1193 def end_no_unused_arguments : Flag<["--"], "end-no-unused-arguments">, Flags<[CoreOption]>,
1194   HelpText<"Start emitting warnings for unused driver arguments">;
1195 def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version=">, Flags<[CC1Option]>;
1196 def exported__symbols__list : Separate<["-"], "exported_symbols_list">;
1197 def extract_api : Flag<["-"], "extract-api">, Flags<[CC1Option]>, Group<Action_Group>,
1198   HelpText<"Extract API information">;
1199 def product_name_EQ: Joined<["--"], "product-name=">, Flags<[CC1Option]>,
1200   MarshallingInfoString<FrontendOpts<"ProductName">>;
1201 def emit_symbol_graph_EQ: JoinedOrSeparate<["--"], "emit-symbol-graph=">, Flags<[CC1Option]>,
1202     HelpText<"Generate Extract API information as a side effect of compilation.">,
1203     MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1204 def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">, Flags<[CC1Option]>,
1205     HelpText<"Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.">,
1206     MarshallingInfoStringVector<FrontendOpts<"ExtractAPIIgnoresFileList">>;
1207 def e : JoinedOrSeparate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
1208 def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>, Flags<[CC1Option]>,
1209   HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
1210   MarshallingInfoInt<LangOpts<"MaxTokens">>;
1211 def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
1212 def fno_PIC : Flag<["-"], "fno-PIC">, Group<f_Group>;
1213 def fPIE : Flag<["-"], "fPIE">, Group<f_Group>;
1214 def fno_PIE : Flag<["-"], "fno-PIE">, Group<f_Group>;
1215 defm access_control : BoolFOption<"access-control",
1216   LangOpts<"AccessControl">, DefaultTrue,
1217   NegFlag<SetFalse, [CC1Option], "Disable C++ access control">,
1218   PosFlag<SetTrue>>;
1219 def falign_functions : Flag<["-"], "falign-functions">, Group<f_Group>;
1220 def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group<f_Group>;
1221 def falign_loops_EQ : Joined<["-"], "falign-loops=">, Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<N>">,
1222   HelpText<"N must be a power of two. Align loops to the boundary">,
1223   MarshallingInfoInt<CodeGenOpts<"LoopAlignment">>;
1224 def fno_align_functions: Flag<["-"], "fno-align-functions">, Group<f_Group>;
1225 defm allow_editor_placeholders : BoolFOption<"allow-editor-placeholders",
1226   LangOpts<"AllowEditorPlaceholders">, DefaultFalse,
1227   PosFlag<SetTrue, [CC1Option], "Treat editor placeholders as valid source code">,
1228   NegFlag<SetFalse>>;
1229 def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group<f_Group>;
1230 def fapple_kext : Flag<["-"], "fapple-kext">, Group<f_Group>, Flags<[CC1Option]>,
1231   HelpText<"Use Apple's kernel extensions ABI">,
1232   MarshallingInfoFlag<LangOpts<"AppleKext">>;
1233 def fstrict_flex_arrays_EQ : Joined<["-"], "fstrict-flex-arrays=">, Group<f_Group>,
1234   MetaVarName<"<n>">, Values<"0,1,2,3">,
1235   LangOpts<"StrictFlexArraysLevel">,
1236   Flags<[CC1Option]>,
1237   NormalizedValuesScope<"LangOptions::StrictFlexArraysLevelKind">,
1238   NormalizedValues<["Default", "OneZeroOrIncomplete", "ZeroOrIncomplete", "IncompleteOnly"]>,
1239   HelpText<"Enable optimizations based on the strict definition of flexible arrays">,
1240   MarshallingInfoEnum<LangOpts<"StrictFlexArraysLevel">, "Default">;
1241 defm apple_pragma_pack : BoolFOption<"apple-pragma-pack",
1242   LangOpts<"ApplePragmaPack">, DefaultFalse,
1243   PosFlag<SetTrue, [CC1Option], "Enable Apple gcc-compatible #pragma pack handling">,
1244   NegFlag<SetFalse>>;
1245 defm xl_pragma_pack : BoolFOption<"xl-pragma-pack",
1246   LangOpts<"XLPragmaPack">, DefaultFalse,
1247   PosFlag<SetTrue, [CC1Option], "Enable IBM XL #pragma pack handling">,
1248   NegFlag<SetFalse>>;
1249 def shared_libsan : Flag<["-"], "shared-libsan">,
1250   HelpText<"Dynamically link the sanitizer runtime">;
1251 def static_libsan : Flag<["-"], "static-libsan">,
1252   HelpText<"Statically link the sanitizer runtime (Not supported for ASan, TSan or UBSan on darwin)">;
1253 def : Flag<["-"], "shared-libasan">, Alias<shared_libsan>;
1254 def fasm : Flag<["-"], "fasm">, Group<f_Group>;
1255
1256 defm assume_unique_vtables : BoolFOption<"assume-unique-vtables",
1257   CodeGenOpts<"AssumeUniqueVTables">, DefaultTrue,
1258   PosFlag<SetTrue>,
1259   NegFlag<SetFalse, [CC1Option],
1260           "Disable optimizations based on vtable pointer identity">,
1261   BothFlags<[CoreOption]>>;
1262
1263 def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group<f_Group>;
1264 def fastcp : Flag<["-"], "fastcp">, Group<f_Group>;
1265 def fastf : Flag<["-"], "fastf">, Group<f_Group>;
1266 def fast : Flag<["-"], "fast">, Group<f_Group>;
1267 def fasynchronous_unwind_tables : Flag<["-"], "fasynchronous-unwind-tables">, Group<f_Group>;
1268
1269 defm double_square_bracket_attributes : BoolFOption<"double-square-bracket-attributes",
1270   LangOpts<"DoubleSquareBracketAttributes">, DefaultTrue, PosFlag<SetTrue>, NegFlag<SetFalse>>;
1271
1272 defm autolink : BoolFOption<"autolink",
1273   CodeGenOpts<"Autolink">, DefaultTrue,
1274   NegFlag<SetFalse, [CC1Option], "Disable generation of linker directives for automatic library linking">,
1275   PosFlag<SetTrue>>;
1276
1277 // In the future this option will be supported by other offloading
1278 // languages and accept other values such as CPU/GPU architectures,
1279 // offload kinds and target aliases.
1280 def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>,
1281   HelpText<"Specify comma-separated list of offloading target triples (CUDA and HIP only)">;
1282
1283 // C++ Coroutines
1284 defm coroutines : BoolFOption<"coroutines",
1285   LangOpts<"Coroutines">, Default<cpp20.KeyPath>,
1286   PosFlag<SetTrue, [CC1Option], "Enable support for the C++ Coroutines">,
1287   NegFlag<SetFalse>>;
1288
1289 defm coro_aligned_allocation : BoolFOption<"coro-aligned-allocation",
1290   LangOpts<"CoroAlignedAllocation">, DefaultFalse,
1291   PosFlag<SetTrue, [CC1Option], "Prefer aligned allocation for C++ Coroutines">,
1292   NegFlag<SetFalse>>;
1293
1294 defm experimental_library : BoolFOption<"experimental-library",
1295   LangOpts<"ExperimentalLibrary">, DefaultFalse,
1296   PosFlag<SetTrue, [CC1Option, CoreOption], "Control whether unstable and experimental library features are enabled. "
1297           "This option enables various library features that are either experimental (also known as TSes), or have been "
1298           "but are not stable yet in the selected Standard Library implementation. It is not recommended to use this option "
1299           "in production code, since neither ABI nor API stability are guaranteed. This is intended to provide a preview "
1300           "of features that will ship in the future for experimentation purposes">,
1301   NegFlag<SetFalse>>;
1302
1303 def fembed_offload_object_EQ : Joined<["-"], "fembed-offload-object=">,
1304   Group<f_Group>, Flags<[NoXarchOption, CC1Option, FC1Option]>,
1305   HelpText<"Embed Offloading device-side binary into host object file as a section.">,
1306   MarshallingInfoStringVector<CodeGenOpts<"OffloadObjects">>;
1307 def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">,
1308     Group<f_Group>, Flags<[NoXarchOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
1309     HelpText<"Embed LLVM bitcode">,
1310     Values<"off,all,bitcode,marker">, NormalizedValuesScope<"CodeGenOptions">,
1311     NormalizedValues<["Embed_Off", "Embed_All", "Embed_Bitcode", "Embed_Marker"]>,
1312     MarshallingInfoEnum<CodeGenOpts<"EmbedBitcode">, "Embed_Off">;
1313 def fembed_bitcode : Flag<["-"], "fembed-bitcode">, Group<f_Group>,
1314   Alias<fembed_bitcode_EQ>, AliasArgs<["all"]>,
1315   HelpText<"Embed LLVM IR bitcode as data">;
1316 def fembed_bitcode_marker : Flag<["-"], "fembed-bitcode-marker">,
1317   Alias<fembed_bitcode_EQ>, AliasArgs<["marker"]>,
1318   HelpText<"Embed placeholder LLVM IR data as a marker">;
1319 defm gnu_inline_asm : BoolFOption<"gnu-inline-asm",
1320   LangOpts<"GNUAsm">, DefaultTrue,
1321   NegFlag<SetFalse, [CC1Option], "Disable GNU style inline asm">, PosFlag<SetTrue>>;
1322
1323 def fprofile_sample_use : Flag<["-"], "fprofile-sample-use">, Group<f_Group>,
1324     Flags<[CoreOption]>;
1325 def fno_profile_sample_use : Flag<["-"], "fno-profile-sample-use">, Group<f_Group>,
1326     Flags<[CoreOption]>;
1327 def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
1328     Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
1329     HelpText<"Enable sample-based profile guided optimizations">,
1330     MarshallingInfoString<CodeGenOpts<"SampleProfileFile">>;
1331 def fprofile_sample_accurate : Flag<["-"], "fprofile-sample-accurate">,
1332     Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
1333     HelpText<"Specifies that the sample profile is accurate">,
1334     DocBrief<[{Specifies that the sample profile is accurate. If the sample
1335                profile is accurate, callsites without profile samples are marked
1336                as cold. Otherwise, treat callsites without profile samples as if
1337                we have no profile}]>,
1338    MarshallingInfoFlag<CodeGenOpts<"ProfileSampleAccurate">>;
1339 def fsample_profile_use_profi : Flag<["-"], "fsample-profile-use-profi">,
1340     Flags<[NoXarchOption, CC1Option]>, Group<f_Group>,
1341     HelpText<"Use profi to infer block and edge counts">,
1342     DocBrief<[{Infer block and edge counts. If the profiles have errors or missing
1343                blocks caused by sampling, profile inference (profi) can convert
1344                basic block counts to branch probabilites to fix them by extended
1345                and re-engineered classic MCMF (min-cost max-flow) approach.}]>;
1346 def fno_profile_sample_accurate : Flag<["-"], "fno-profile-sample-accurate">,
1347   Group<f_Group>, Flags<[NoXarchOption]>;
1348 def fauto_profile : Flag<["-"], "fauto-profile">, Group<f_Group>,
1349     Alias<fprofile_sample_use>;
1350 def fno_auto_profile : Flag<["-"], "fno-auto-profile">, Group<f_Group>,
1351     Alias<fno_profile_sample_use>;
1352 def fauto_profile_EQ : Joined<["-"], "fauto-profile=">,
1353     Alias<fprofile_sample_use_EQ>;
1354 def fauto_profile_accurate : Flag<["-"], "fauto-profile-accurate">,
1355     Group<f_Group>, Alias<fprofile_sample_accurate>;
1356 def fno_auto_profile_accurate : Flag<["-"], "fno-auto-profile-accurate">,
1357     Group<f_Group>, Alias<fno_profile_sample_accurate>;
1358 def fdebug_compilation_dir_EQ : Joined<["-"], "fdebug-compilation-dir=">,
1359     Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
1360     HelpText<"The compilation directory to embed in the debug info">,
1361     MarshallingInfoString<CodeGenOpts<"DebugCompilationDir">>;
1362 def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
1363     Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
1364     Alias<fdebug_compilation_dir_EQ>;
1365 def fcoverage_compilation_dir_EQ : Joined<["-"], "fcoverage-compilation-dir=">,
1366     Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
1367     HelpText<"The compilation directory to embed in the coverage mapping.">,
1368     MarshallingInfoString<CodeGenOpts<"CoverageCompilationDir">>;
1369 def ffile_compilation_dir_EQ : Joined<["-"], "ffile-compilation-dir=">, Group<f_Group>,
1370     Flags<[CoreOption]>,
1371     HelpText<"The compilation directory to embed in the debug info and coverage mapping.">;
1372 defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling",
1373   CodeGenOpts<"DebugInfoForProfiling">, DefaultFalse,
1374   PosFlag<SetTrue, [CC1Option], "Emit extra debug info to make sample profile more accurate">,
1375   NegFlag<SetFalse>>;
1376 def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">,
1377     Group<f_Group>, Flags<[CoreOption]>,
1378     HelpText<"Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1379 def fprofile_instr_generate_EQ : Joined<["-"], "fprofile-instr-generate=">,
1380     Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<file>">,
1381     HelpText<"Generate instrumented code to collect execution counts into <file> (overridden by LLVM_PROFILE_FILE env var)">;
1382 def fprofile_instr_use : Flag<["-"], "fprofile-instr-use">, Group<f_Group>,
1383     Flags<[CoreOption]>;
1384 def fprofile_instr_use_EQ : Joined<["-"], "fprofile-instr-use=">,
1385     Group<f_Group>, Flags<[CoreOption]>,
1386     HelpText<"Use instrumentation data for profile-guided optimization">;
1387 def fprofile_remapping_file_EQ : Joined<["-"], "fprofile-remapping-file=">,
1388     Group<f_Group>, Flags<[CC1Option, CoreOption]>, MetaVarName<"<file>">,
1389     HelpText<"Use the remappings described in <file> to match the profile data against names in the program">,
1390     MarshallingInfoString<CodeGenOpts<"ProfileRemappingFile">>;
1391 defm coverage_mapping : BoolFOption<"coverage-mapping",
1392   CodeGenOpts<"CoverageMapping">, DefaultFalse,
1393   PosFlag<SetTrue, [CC1Option], "Generate coverage mapping to enable code coverage analysis">,
1394   NegFlag<SetFalse, [], "Disable code coverage analysis">, BothFlags<[CoreOption]>>;
1395 def fprofile_generate : Flag<["-"], "fprofile-generate">,
1396     Group<f_Group>, Flags<[CoreOption]>,
1397     HelpText<"Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1398 def fprofile_generate_EQ : Joined<["-"], "fprofile-generate=">,
1399     Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<directory>">,
1400     HelpText<"Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1401 def fcs_profile_generate : Flag<["-"], "fcs-profile-generate">,
1402     Group<f_Group>, Flags<[CoreOption]>,
1403     HelpText<"Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1404 def fcs_profile_generate_EQ : Joined<["-"], "fcs-profile-generate=">,
1405     Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<directory>">,
1406     HelpText<"Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1407 def fprofile_use : Flag<["-"], "fprofile-use">, Group<f_Group>,
1408     Flags<[CoreOption]>, Alias<fprofile_instr_use>;
1409 def fprofile_use_EQ : Joined<["-"], "fprofile-use=">,
1410     Group<f_Group>, Flags<[NoXarchOption, CoreOption]>,
1411     MetaVarName<"<pathname>">,
1412     HelpText<"Use instrumentation data for profile-guided optimization. If pathname is a directory, it reads from <pathname>/default.profdata. Otherwise, it reads from file <pathname>.">;
1413 def fno_profile_instr_generate : Flag<["-"], "fno-profile-instr-generate">,
1414     Group<f_Group>, Flags<[CoreOption]>,
1415     HelpText<"Disable generation of profile instrumentation.">;
1416 def fno_profile_generate : Flag<["-"], "fno-profile-generate">,
1417     Group<f_Group>, Flags<[CoreOption]>,
1418     HelpText<"Disable generation of profile instrumentation.">;
1419 def fno_profile_instr_use : Flag<["-"], "fno-profile-instr-use">,
1420     Group<f_Group>, Flags<[CoreOption]>,
1421     HelpText<"Disable using instrumentation data for profile-guided optimization">;
1422 def fno_profile_use : Flag<["-"], "fno-profile-use">,
1423     Alias<fno_profile_instr_use>;
1424 def ftest_coverage : Flag<["-"], "ftest-coverage">, Group<f_Group>,
1425     HelpText<"Produce gcov notes files (*.gcno)">;
1426 def fno_test_coverage : Flag<["-"], "fno-test-coverage">, Group<f_Group>;
1427 def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group<f_Group>,
1428     HelpText<"Instrument code to produce gcov data files (*.gcda)">;
1429 def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group<f_Group>;
1430 def fprofile_filter_files_EQ : Joined<["-"], "fprofile-filter-files=">,
1431     Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1432     HelpText<"Instrument only functions from files where names match any regex separated by a semi-colon">,
1433     MarshallingInfoString<CodeGenOpts<"ProfileFilterFiles">>;
1434 def fprofile_exclude_files_EQ : Joined<["-"], "fprofile-exclude-files=">,
1435     Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1436     HelpText<"Instrument only functions from files where names don't match all the regexes separated by a semi-colon">,
1437     MarshallingInfoString<CodeGenOpts<"ProfileExcludeFiles">>;
1438 def fprofile_update_EQ : Joined<["-"], "fprofile-update=">,
1439     Group<f_Group>, Flags<[CC1Option, CoreOption]>, Values<"atomic,prefer-atomic,single">,
1440     MetaVarName<"<method>">, HelpText<"Set update method of profile counters">,
1441     MarshallingInfoFlag<CodeGenOpts<"AtomicProfileUpdate">>;
1442 defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
1443   CodeGenOpts<"PseudoProbeForProfiling">, DefaultFalse,
1444   PosFlag<SetTrue, [], "Emit">, NegFlag<SetFalse, [], "Do not emit">,
1445   BothFlags<[NoXarchOption, CC1Option], " pseudo probes for sample profiling">>;
1446 def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
1447     Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1448     HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1449 def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
1450     Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1451     HelpText<"Filename defining the list of functions/files to instrument. "
1452              "The file uses the sanitizer special case list format.">,
1453     MarshallingInfoStringVector<LangOpts<"ProfileListFiles">>;
1454 def fprofile_function_groups : Joined<["-"], "fprofile-function-groups=">,
1455   Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<N>">,
1456   HelpText<"Partition functions into N groups and select only functions in group i to be instrumented using -fprofile-selected-function-group">,
1457   MarshallingInfoInt<CodeGenOpts<"ProfileTotalFunctionGroups">, "1">;
1458 def fprofile_selected_function_group :
1459   Joined<["-"], "fprofile-selected-function-group=">, Group<f_Group>,
1460   Flags<[CC1Option]>, MetaVarName<"<i>">,
1461   HelpText<"Partition functions into N groups using -fprofile-function-groups and select only functions in group i to be instrumented. The valid range is 0 to N-1 inclusive">,
1462   MarshallingInfoInt<CodeGenOpts<"ProfileSelectedFunctionGroup">>;
1463 def fswift_async_fp_EQ : Joined<["-"], "fswift-async-fp=">,
1464     Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>, MetaVarName<"<option>">,
1465     HelpText<"Control emission of Swift async extended frame info">,
1466     Values<"auto,always,never">,
1467     NormalizedValuesScope<"CodeGenOptions::SwiftAsyncFramePointerKind">,
1468     NormalizedValues<["Auto", "Always", "Never"]>,
1469     MarshallingInfoEnum<CodeGenOpts<"SwiftAsyncFramePointer">, "Always">;
1470
1471 defm addrsig : BoolFOption<"addrsig",
1472   CodeGenOpts<"Addrsig">, DefaultFalse,
1473   PosFlag<SetTrue, [CC1Option], "Emit">, NegFlag<SetFalse, [], "Don't emit">,
1474   BothFlags<[CoreOption], " an address-significance table">>;
1475 defm blocks : OptInCC1FFlag<"blocks", "Enable the 'blocks' language feature", "", "", [CoreOption]>;
1476 def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group<f_Group>;
1477 defm borland_extensions : BoolFOption<"borland-extensions",
1478   LangOpts<"Borland">, DefaultFalse,
1479   PosFlag<SetTrue, [CC1Option], "Accept non-standard constructs supported by the Borland compiler">,
1480   NegFlag<SetFalse>>;
1481 def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>, Flags<[CoreOption]>;
1482 def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group<f_Group>,
1483   Flags<[NoXarchOption]>, HelpText<"Load the clang builtins module map file.">;
1484 defm caret_diagnostics : BoolFOption<"caret-diagnostics",
1485   DiagnosticOpts<"ShowCarets">, DefaultTrue,
1486   NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>>;
1487 def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group<f_clang_Group>,
1488   Flags<[CC1Option]>, MetaVarName<"<version>">, Values<"<major>.<minor>,latest">,
1489   HelpText<"Attempt to match the ABI of Clang <version>">;
1490 def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>;
1491 def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group<f_Group>,
1492   Flags<[CoreOption, CC1Option, FlangOption, FC1Option]>,
1493   HelpText<"Enable colors in diagnostics">;
1494 def fno_color_diagnostics : Flag<["-"], "fno-color-diagnostics">, Group<f_Group>,
1495   Flags<[CoreOption, FlangOption]>, HelpText<"Disable colors in diagnostics">;
1496 def : Flag<["-"], "fdiagnostics-color">, Group<f_Group>, Flags<[CoreOption]>, Alias<fcolor_diagnostics>;
1497 def : Flag<["-"], "fno-diagnostics-color">, Group<f_Group>, Flags<[CoreOption]>, Alias<fno_color_diagnostics>;
1498 def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group<f_Group>;
1499 def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group<f_Group>,
1500   Flags<[CoreOption, CC1Option]>, HelpText<"Use ANSI escape codes for diagnostics">,
1501   MarshallingInfoFlag<DiagnosticOpts<"UseANSIEscapeCodes">>;
1502 def fcomment_block_commands : CommaJoined<["-"], "fcomment-block-commands=">, Group<f_clang_Group>, Flags<[CC1Option]>,
1503   HelpText<"Treat each comma separated argument in <arg> as a documentation comment block command">,
1504   MetaVarName<"<arg>">, MarshallingInfoStringVector<LangOpts<"CommentOpts.BlockCommandNames">>;
1505 def fparse_all_comments : Flag<["-"], "fparse-all-comments">, Group<f_clang_Group>, Flags<[CC1Option]>,
1506   MarshallingInfoFlag<LangOpts<"CommentOpts.ParseAllComments">>;
1507 def frecord_command_line : Flag<["-"], "frecord-command-line">,
1508   DocBrief<[{Generate a section named ".GCC.command.line" containing the clang
1509 driver command-line. After linking, the section may contain multiple command
1510 lines, which will be individually terminated by null bytes. Separate arguments
1511 within a command line are combined with spaces; spaces and backslashes within an
1512 argument are escaped with backslashes. This format differs from the format of
1513 the equivalent section produced by GCC with the -frecord-gcc-switches flag.
1514 This option is currently only supported on ELF targets.}]>,
1515   Group<f_clang_Group>;
1516 def fno_record_command_line : Flag<["-"], "fno-record-command-line">,
1517   Group<f_clang_Group>;
1518 def : Flag<["-"], "frecord-gcc-switches">, Alias<frecord_command_line>;
1519 def : Flag<["-"], "fno-record-gcc-switches">, Alias<fno_record_command_line>;
1520 def fcommon : Flag<["-"], "fcommon">, Group<f_Group>,
1521   Flags<[CoreOption, CC1Option]>, HelpText<"Place uninitialized global variables in a common block">,
1522   MarshallingInfoNegativeFlag<CodeGenOpts<"NoCommon">>,
1523   DocBrief<[{Place definitions of variables with no storage class and no initializer
1524 (tentative definitions) in a common block, instead of generating individual
1525 zero-initialized definitions (default -fno-common).}]>;
1526 def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group<f_Group>;
1527 defm complete_member_pointers : BoolOption<"f", "complete-member-pointers",
1528   LangOpts<"CompleteMemberPointers">, DefaultFalse,
1529   PosFlag<SetTrue, [CC1Option], "Require">, NegFlag<SetFalse, [], "Do not require">,
1530   BothFlags<[CoreOption], " member pointer base types to be complete if they"
1531             " would be significant under the Microsoft ABI">>,
1532   Group<f_clang_Group>;
1533 def fcf_runtime_abi_EQ : Joined<["-"], "fcf-runtime-abi=">, Group<f_Group>,
1534     Flags<[CC1Option]>, Values<"unspecified,standalone,objc,swift,swift-5.0,swift-4.2,swift-4.1">,
1535     NormalizedValuesScope<"LangOptions::CoreFoundationABI">,
1536     NormalizedValues<["ObjectiveC", "ObjectiveC", "ObjectiveC", "Swift5_0", "Swift5_0", "Swift4_2", "Swift4_1"]>,
1537     MarshallingInfoEnum<LangOpts<"CFRuntime">, "ObjectiveC">;
1538 defm constant_cfstrings : BoolFOption<"constant-cfstrings",
1539   LangOpts<"NoConstantCFStrings">, DefaultFalse,
1540   NegFlag<SetTrue, [CC1Option], "Disable creation of CodeFoundation-type constant strings">,
1541   PosFlag<SetFalse>>;
1542 def fconstant_string_class_EQ : Joined<["-"], "fconstant-string-class=">, Group<f_Group>;
1543 def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group<f_Group>, Flags<[CC1Option]>,
1544   HelpText<"Set the maximum depth of recursive constexpr function calls">,
1545   MarshallingInfoInt<LangOpts<"ConstexprCallDepth">, "512">;
1546 def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group<f_Group>, Flags<[CC1Option]>,
1547   HelpText<"Set the maximum number of steps in constexpr function evaluation">,
1548   MarshallingInfoInt<LangOpts<"ConstexprStepLimit">, "1048576">;
1549 def fexperimental_new_constant_interpreter : Flag<["-"], "fexperimental-new-constant-interpreter">, Group<f_Group>,
1550   HelpText<"Enable the experimental new constant interpreter">, Flags<[CC1Option]>,
1551   MarshallingInfoFlag<LangOpts<"EnableNewConstInterp">>;
1552 def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">, Group<f_Group>, Flags<[CC1Option]>,
1553   HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit)">,
1554   MarshallingInfoInt<DiagnosticOpts<"ConstexprBacktraceLimit">, "DiagnosticOptions::DefaultConstexprBacktraceLimit">;
1555 def fcrash_diagnostics_EQ : Joined<["-"], "fcrash-diagnostics=">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
1556   HelpText<"Set level of crash diagnostic reporting, (option: off, compiler, all)">;
1557 def fcrash_diagnostics : Flag<["-"], "fcrash-diagnostics">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
1558   HelpText<"Enable crash diagnostic reporting (default)">, Alias<fcrash_diagnostics_EQ>, AliasArgs<["compiler"]>;
1559 def fno_crash_diagnostics : Flag<["-"], "fno-crash-diagnostics">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
1560   Alias<gen_reproducer_eq>, AliasArgs<["off"]>,
1561   HelpText<"Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash">;
1562 def fcrash_diagnostics_dir : Joined<["-"], "fcrash-diagnostics-dir=">,
1563   Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
1564   HelpText<"Put crash-report files in <dir>">, MetaVarName<"<dir>">;
1565 def fcreate_profile : Flag<["-"], "fcreate-profile">, Group<f_Group>;
1566 defm cxx_exceptions: BoolFOption<"cxx-exceptions",
1567   LangOpts<"CXXExceptions">, DefaultFalse,
1568   PosFlag<SetTrue, [CC1Option], "Enable C++ exceptions">, NegFlag<SetFalse>>;
1569 defm async_exceptions: BoolFOption<"async-exceptions",
1570   LangOpts<"EHAsynch">, DefaultFalse,
1571   PosFlag<SetTrue, [CC1Option], "Enable EH Asynchronous exceptions">, NegFlag<SetFalse>>;
1572 defm cxx_modules : BoolFOption<"cxx-modules",
1573   LangOpts<"CPlusPlusModules">, Default<cpp20.KeyPath>,
1574   NegFlag<SetFalse, [CC1Option], "Disable">, PosFlag<SetTrue, [], "Enable">,
1575   BothFlags<[NoXarchOption], " modules for C++">>,
1576   ShouldParseIf<cplusplus.KeyPath>;
1577 def fdebug_pass_arguments : Flag<["-"], "fdebug-pass-arguments">, Group<f_Group>;
1578 def fdebug_pass_structure : Flag<["-"], "fdebug-pass-structure">, Group<f_Group>;
1579 def fdepfile_entry : Joined<["-"], "fdepfile-entry=">,
1580     Group<f_clang_Group>, Flags<[CC1Option]>;
1581 def fdiagnostics_fixit_info : Flag<["-"], "fdiagnostics-fixit-info">, Group<f_clang_Group>;
1582 def fno_diagnostics_fixit_info : Flag<["-"], "fno-diagnostics-fixit-info">, Group<f_Group>,
1583   Flags<[CC1Option]>, HelpText<"Do not include fixit information in diagnostics">,
1584   MarshallingInfoNegativeFlag<DiagnosticOpts<"ShowFixits">>;
1585 def fdiagnostics_parseable_fixits : Flag<["-"], "fdiagnostics-parseable-fixits">, Group<f_clang_Group>,
1586     Flags<[CoreOption, CC1Option]>, HelpText<"Print fix-its in machine parseable form">,
1587     MarshallingInfoFlag<DiagnosticOpts<"ShowParseableFixits">>;
1588 def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">,
1589     Group<f_clang_Group>,  Flags<[CC1Option]>,
1590     HelpText<"Print source range spans in numeric form">,
1591     MarshallingInfoFlag<DiagnosticOpts<"ShowSourceRanges">>;
1592 defm diagnostics_show_hotness : BoolFOption<"diagnostics-show-hotness",
1593   CodeGenOpts<"DiagnosticsWithHotness">, DefaultFalse,
1594   PosFlag<SetTrue, [CC1Option], "Enable profile hotness information in diagnostic line">,
1595   NegFlag<SetFalse>>;
1596 def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">,
1597     Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<value>">,
1598     HelpText<"Prevent optimization remarks from being output if they do not have at least this profile count. "
1599     "Use 'auto' to apply the threshold from profile summary">;
1600 def fdiagnostics_misexpect_tolerance_EQ : Joined<["-"], "fdiagnostics-misexpect-tolerance=">,
1601     Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<value>">,
1602     HelpText<"Prevent misexpect diagnostics from being output if the profile counts are within N% of the expected. ">;
1603 defm diagnostics_show_option : BoolFOption<"diagnostics-show-option",
1604     DiagnosticOpts<"ShowOptionNames">, DefaultTrue,
1605     NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue, [], "Print option name with mappable diagnostics">>;
1606 defm diagnostics_show_note_include_stack : BoolFOption<"diagnostics-show-note-include-stack",
1607     DiagnosticOpts<"ShowNoteIncludeStack">, DefaultFalse,
1608     PosFlag<SetTrue, [], "Display include stacks for diagnostic notes">,
1609     NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
1610 def fdiagnostics_format_EQ : Joined<["-"], "fdiagnostics-format=">, Group<f_clang_Group>;
1611 def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">, Group<f_clang_Group>;
1612 def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">,
1613     Group<f_Group>, Flags<[CC1Option]>,
1614     HelpText<"Print a template comparison tree for differing templates">,
1615     MarshallingInfoFlag<DiagnosticOpts<"ShowTemplateTree">>;
1616 defm safe_buffer_usage_suggestions : BoolFOption<"safe-buffer-usage-suggestions",
1617   DiagnosticOpts<"ShowSafeBufferUsageSuggestions">, DefaultFalse,
1618   PosFlag<SetTrue, [CC1Option],
1619           "Display suggestions to update code associated with -Wunsafe-buffer-usage warnings">,
1620   NegFlag<SetFalse>>;
1621 def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">, Group<f_clang_Group>,
1622   HelpText<"Discard value names in LLVM IR">, Flags<[NoXarchOption]>;
1623 def fno_discard_value_names : Flag<["-"], "fno-discard-value-names">, Group<f_clang_Group>,
1624   HelpText<"Do not discard value names in LLVM IR">, Flags<[NoXarchOption]>;
1625 defm dollars_in_identifiers : BoolFOption<"dollars-in-identifiers",
1626   LangOpts<"DollarIdents">, Default<!strconcat("!", asm_preprocessor.KeyPath)>,
1627   PosFlag<SetTrue, [], "Allow">, NegFlag<SetFalse, [], "Disallow">,
1628   BothFlags<[CC1Option], " '$' in identifiers">>;
1629 def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
1630 def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
1631 defm dwarf_directory_asm : BoolFOption<"dwarf-directory-asm",
1632   CodeGenOpts<"NoDwarfDirectoryAsm">, DefaultFalse,
1633   NegFlag<SetTrue, [CC1Option]>, PosFlag<SetFalse>>;
1634 defm elide_constructors : BoolFOption<"elide-constructors",
1635   LangOpts<"ElideConstructors">, DefaultTrue,
1636   NegFlag<SetFalse, [CC1Option], "Disable C++ copy constructor elision">,
1637   PosFlag<SetTrue>>;
1638 def fno_elide_type : Flag<["-"], "fno-elide-type">, Group<f_Group>,
1639     Flags<[CC1Option]>,
1640     HelpText<"Do not elide types when printing diagnostics">,
1641     MarshallingInfoNegativeFlag<DiagnosticOpts<"ElideType">>;
1642 def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group<f_Group>;
1643 defm eliminate_unused_debug_types : OptOutCC1FFlag<"eliminate-unused-debug-types",
1644   "Do not emit ", "Emit ", " debug info for defined but unused types">;
1645 def femit_all_decls : Flag<["-"], "femit-all-decls">, Group<f_Group>, Flags<[CC1Option]>,
1646   HelpText<"Emit all declarations, even if unused">,
1647   MarshallingInfoFlag<LangOpts<"EmitAllDecls">>;
1648 defm emulated_tls : BoolFOption<"emulated-tls",
1649   CodeGenOpts<"EmulatedTLS">, DefaultFalse,
1650   PosFlag<SetTrue, [CC1Option], "Use emutls functions to access thread_local variables">,
1651   NegFlag<SetFalse>>;
1652 def fencoding_EQ : Joined<["-"], "fencoding=">, Group<f_Group>;
1653 def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<f_Group>, Flags<[CoreOption]>;
1654 defm exceptions : BoolFOption<"exceptions",
1655   LangOpts<"Exceptions">, DefaultFalse,
1656   PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1657   BothFlags<[], " support for exception handling">>;
1658 def fdwarf_exceptions : Flag<["-"], "fdwarf-exceptions">, Group<f_Group>,
1659   HelpText<"Use DWARF style exceptions">;
1660 def fsjlj_exceptions : Flag<["-"], "fsjlj-exceptions">, Group<f_Group>,
1661   HelpText<"Use SjLj style exceptions">;
1662 def fseh_exceptions : Flag<["-"], "fseh-exceptions">, Group<f_Group>,
1663   HelpText<"Use SEH style exceptions">;
1664 def fwasm_exceptions : Flag<["-"], "fwasm-exceptions">, Group<f_Group>,
1665   HelpText<"Use WebAssembly style exceptions">;
1666 def exception_model : Separate<["-"], "exception-model">,
1667   Flags<[CC1Option, NoDriverOption]>, HelpText<"The exception model">,
1668   Values<"dwarf,sjlj,seh,wasm">,
1669   NormalizedValuesScope<"LangOptions::ExceptionHandlingKind">,
1670   NormalizedValues<["DwarfCFI", "SjLj", "WinEH", "Wasm"]>,
1671   MarshallingInfoEnum<LangOpts<"ExceptionHandling">, "None">;
1672 def exception_model_EQ : Joined<["-"], "exception-model=">,
1673   Flags<[CC1Option, NoDriverOption]>, Alias<exception_model>;
1674 def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group<f_Group>, Flags<[CC1Option]>,
1675   HelpText<"Enable support for ignoring exception handling constructs">,
1676   MarshallingInfoFlag<LangOpts<"IgnoreExceptions">>;
1677 def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
1678   Flags<[CoreOption]>,
1679   HelpText<"Allows control over excess precision on targets where native "
1680   "support for the precision types is not available. By default, excess "
1681   "precision is used to calculate intermediate results following the "
1682   "rules specified in ISO C99.">,
1683   Values<"standard,fast,none">, NormalizedValuesScope<"LangOptions">,
1684   NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>;
1685 def ffloat16_excess_precision_EQ : Joined<["-"], "ffloat16-excess-precision=">,
1686   Group<f_Group>, Flags<[CC1Option, NoDriverOption]>,
1687   HelpText<"Allows control over excess precision on targets where native "
1688   "support for Float16 precision types is not available. By default, excess "
1689   "precision is used to calculate intermediate results following the "
1690   "rules specified in ISO C99.">,
1691   Values<"standard,fast,none">, NormalizedValuesScope<"LangOptions">,
1692   NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>,
1693   MarshallingInfoEnum<LangOpts<"Float16ExcessPrecision">, "FPP_Standard">;
1694 def fbfloat16_excess_precision_EQ : Joined<["-"], "fbfloat16-excess-precision=">,
1695   Group<f_Group>, Flags<[CC1Option, NoDriverOption]>,
1696   HelpText<"Allows control over excess precision on targets where native "
1697   "support for BFloat16 precision types is not available. By default, excess "
1698   "precision is used to calculate intermediate results following the "
1699   "rules specified in ISO C99.">,
1700   Values<"standard,fast,none">, NormalizedValuesScope<"LangOptions">,
1701   NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>,
1702   MarshallingInfoEnum<LangOpts<"BFloat16ExcessPrecision">, "FPP_Standard">;
1703 def : Flag<["-"], "fexpensive-optimizations">, Group<clang_ignored_gcc_optimization_f_Group>;
1704 def : Flag<["-"], "fno-expensive-optimizations">, Group<clang_ignored_gcc_optimization_f_Group>;
1705 def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group<f_Group>;
1706 def : Flag<["-"], "fdefer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
1707 def : Flag<["-"], "fno-defer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
1708 def : Flag<["-"], "fextended-identifiers">, Group<clang_ignored_f_Group>;
1709 def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>, Flags<[Unsupported]>;
1710 def fhosted : Flag<["-"], "fhosted">, Group<f_Group>;
1711 def fdenormal_fp_math_EQ : Joined<["-"], "fdenormal-fp-math=">, Group<f_Group>, Flags<[CC1Option]>;
1712 def ffile_reproducible : Flag<["-"], "ffile-reproducible">, Group<f_Group>,
1713   Flags<[CoreOption, CC1Option]>,
1714   HelpText<"Use the target's platform-specific path separator character when "
1715            "expanding the __FILE__ macro">;
1716 def fno_file_reproducible : Flag<["-"], "fno-file-reproducible">,
1717   Group<f_Group>, Flags<[CoreOption, CC1Option]>,
1718   HelpText<"Use the host's platform-specific path separator character when "
1719            "expanding the __FILE__ macro">;
1720 def ffp_eval_method_EQ : Joined<["-"], "ffp-eval-method=">, Group<f_Group>, Flags<[CC1Option]>,
1721   HelpText<"Specifies the evaluation method to use for floating-point arithmetic.">,
1722   Values<"source,double,extended">, NormalizedValuesScope<"LangOptions">,
1723   NormalizedValues<["FEM_Source", "FEM_Double", "FEM_Extended"]>,
1724   MarshallingInfoEnum<LangOpts<"FPEvalMethod">, "FEM_UnsetOnCommandLine">;
1725 def ffp_model_EQ : Joined<["-"], "ffp-model=">, Group<f_Group>, Flags<[NoXarchOption]>,
1726   HelpText<"Controls the semantics of floating-point calculations.">;
1727 def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<f_Group>, Flags<[CC1Option]>,
1728   HelpText<"Specifies the exception behavior of floating-point operations.">,
1729   Values<"ignore,maytrap,strict">, NormalizedValuesScope<"LangOptions">,
1730   NormalizedValues<["FPE_Ignore", "FPE_MayTrap", "FPE_Strict"]>,
1731   MarshallingInfoEnum<LangOpts<"FPExceptionMode">, "FPE_Default">;
1732 defm fast_math : BoolFOption<"fast-math",
1733   LangOpts<"FastMath">, DefaultFalse,
1734   PosFlag<SetTrue, [CC1Option, FC1Option, FlangOption], "Allow aggressive, lossy floating-point optimizations",
1735           [cl_fast_relaxed_math.KeyPath]>,
1736   NegFlag<SetFalse>>;
1737 defm math_errno : BoolFOption<"math-errno",
1738   LangOpts<"MathErrno">, DefaultFalse,
1739   PosFlag<SetTrue, [CC1Option], "Require math functions to indicate errors by setting errno">,
1740   NegFlag<SetFalse>>,
1741   ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
1742 def fextend_args_EQ : Joined<["-"], "fextend-arguments=">, Group<f_Group>,
1743   Flags<[CC1Option, NoArgumentUnused]>,
1744   HelpText<"Controls how scalar integer arguments are extended in calls "
1745            "to unprototyped and varargs functions">,
1746   Values<"32,64">,
1747   NormalizedValues<["ExtendTo32", "ExtendTo64"]>,
1748   NormalizedValuesScope<"LangOptions::ExtendArgsKind">,
1749   MarshallingInfoEnum<LangOpts<"ExtendIntArgs">,"ExtendTo32">;
1750 def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group<f_Group>, Flags<[CoreOption]>;
1751 def fsignaling_math : Flag<["-"], "fsignaling-math">, Group<f_Group>;
1752 def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group<f_Group>;
1753 defm jump_tables : BoolFOption<"jump-tables",
1754   CodeGenOpts<"NoUseJumpTables">, DefaultFalse,
1755   NegFlag<SetTrue, [CC1Option], "Do not use">, PosFlag<SetFalse, [], "Use">,
1756   BothFlags<[], " jump tables for lowering switches">>;
1757 defm force_enable_int128 : BoolFOption<"force-enable-int128",
1758   TargetOpts<"ForceEnableInt128">, DefaultFalse,
1759   PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1760   BothFlags<[], " support for int128_t type">>;
1761 defm keep_static_consts : BoolFOption<"keep-static-consts",
1762   CodeGenOpts<"KeepStaticConsts">, DefaultFalse,
1763   PosFlag<SetTrue, [CC1Option], "Keep">, NegFlag<SetFalse, [], "Don't keep">,
1764   BothFlags<[NoXarchOption], " static const variables even if unused">>;
1765 defm keep_persistent_storage_variables : BoolFOption<"keep-persistent-storage-variables",
1766   CodeGenOpts<"KeepPersistentStorageVariables">, DefaultFalse,
1767   PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1768   BothFlags<[NoXarchOption], " keeping all variables that have a persistent storage duration, including global, static and thread-local variables, to guarantee that they can be directly addressed">>;
1769 defm fixed_point : BoolFOption<"fixed-point",
1770   LangOpts<"FixedPoint">, DefaultFalse,
1771   PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1772   BothFlags<[], " fixed point types">>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
1773 defm cxx_static_destructors : BoolFOption<"c++-static-destructors",
1774   LangOpts<"RegisterStaticDestructors">, DefaultTrue,
1775   NegFlag<SetFalse, [CC1Option], "Disable C++ static destructor registration">,
1776   PosFlag<SetTrue>>;
1777 def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group<f_Group>,
1778   Flags<[CC1Option]>, MarshallingInfoString<CodeGenOpts<"SymbolPartition">>;
1779
1780 defm memory_profile : OptInCC1FFlag<"memory-profile", "Enable", "Disable", " heap memory profiling">;
1781 def fmemory_profile_EQ : Joined<["-"], "fmemory-profile=">,
1782     Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<directory>">,
1783     HelpText<"Enable heap memory profiling and dump results into <directory>">;
1784 def fmemory_profile_use_EQ : Joined<["-"], "fmemory-profile-use=">,
1785     Group<f_Group>, Flags<[CC1Option, CoreOption]>, MetaVarName<"<pathname>">,
1786     HelpText<"Use memory profile for profile-guided memory optimization">,
1787     MarshallingInfoString<CodeGenOpts<"MemoryProfileUsePath">>;
1788
1789 // Begin sanitizer flags. These should all be core options exposed in all driver
1790 // modes.
1791 let Flags = [CC1Option, CoreOption] in {
1792
1793 def fsanitize_EQ : CommaJoined<["-"], "fsanitize=">, Group<f_clang_Group>,
1794                    MetaVarName<"<check>">,
1795                    HelpText<"Turn on runtime checks for various forms of undefined "
1796                             "or suspicious behavior. See user manual for available checks">;
1797 def fno_sanitize_EQ : CommaJoined<["-"], "fno-sanitize=">, Group<f_clang_Group>,
1798                       Flags<[CoreOption, NoXarchOption]>;
1799
1800 def fsanitize_ignorelist_EQ : Joined<["-"], "fsanitize-ignorelist=">,
1801   Group<f_clang_Group>, HelpText<"Path to ignorelist file for sanitizers">;
1802 def : Joined<["-"], "fsanitize-blacklist=">,
1803   Group<f_clang_Group>, Flags<[HelpHidden]>, Alias<fsanitize_ignorelist_EQ>,
1804   HelpText<"Alias for -fsanitize-ignorelist=">;
1805
1806 def fsanitize_system_ignorelist_EQ : Joined<["-"], "fsanitize-system-ignorelist=">,
1807   HelpText<"Path to system ignorelist file for sanitizers">, Flags<[CC1Option]>;
1808
1809 def fno_sanitize_ignorelist : Flag<["-"], "fno-sanitize-ignorelist">,
1810   Group<f_clang_Group>, HelpText<"Don't use ignorelist file for sanitizers">;
1811 def : Flag<["-"], "fno-sanitize-blacklist">,
1812   Group<f_clang_Group>, Flags<[HelpHidden]>, Alias<fno_sanitize_ignorelist>;
1813
1814 def fsanitize_coverage : CommaJoined<["-"], "fsanitize-coverage=">,
1815   Group<f_clang_Group>,
1816   HelpText<"Specify the type of coverage instrumentation for Sanitizers">;
1817 def fno_sanitize_coverage : CommaJoined<["-"], "fno-sanitize-coverage=">,
1818   Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1819   HelpText<"Disable features of coverage instrumentation for Sanitizers">,
1820   Values<"func,bb,edge,indirect-calls,trace-bb,trace-cmp,trace-div,trace-gep,"
1821          "8bit-counters,trace-pc,trace-pc-guard,no-prune,inline-8bit-counters,"
1822          "inline-bool-flag">;
1823 def fsanitize_coverage_allowlist : Joined<["-"], "fsanitize-coverage-allowlist=">,
1824     Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1825     HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
1826     MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageAllowlistFiles">>;
1827 def fsanitize_coverage_ignorelist : Joined<["-"], "fsanitize-coverage-ignorelist=">,
1828     Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1829     HelpText<"Disable sanitizer coverage instrumentation for modules and functions "
1830              "that match the provided special case list, even the allowed ones">,
1831     MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageIgnorelistFiles">>;
1832 def fexperimental_sanitize_metadata_EQ : CommaJoined<["-"], "fexperimental-sanitize-metadata=">,
1833   Group<f_Group>,
1834   HelpText<"Specify the type of metadata to emit for binary analysis sanitizers">;
1835 def fno_experimental_sanitize_metadata_EQ : CommaJoined<["-"], "fno-experimental-sanitize-metadata=">,
1836   Group<f_Group>, Flags<[CoreOption]>,
1837   HelpText<"Disable emitting metadata for binary analysis sanitizers">;
1838 def fexperimental_sanitize_metadata_ignorelist_EQ : Joined<["-"], "fexperimental-sanitize-metadata-ignorelist=">,
1839     Group<f_Group>, Flags<[CoreOption]>,
1840     HelpText<"Disable sanitizer metadata for modules and functions that match the provided special case list">,
1841     MarshallingInfoStringVector<CodeGenOpts<"SanitizeMetadataIgnorelistFiles">>;
1842 def fsanitize_memory_track_origins_EQ : Joined<["-"], "fsanitize-memory-track-origins=">,
1843                                         Group<f_clang_Group>,
1844                                         HelpText<"Enable origins tracking in MemorySanitizer">,
1845                                         MarshallingInfoInt<CodeGenOpts<"SanitizeMemoryTrackOrigins">>;
1846 def fsanitize_memory_track_origins : Flag<["-"], "fsanitize-memory-track-origins">,
1847                                      Group<f_clang_Group>,
1848                                      Alias<fsanitize_memory_track_origins_EQ>, AliasArgs<["2"]>,
1849                                      HelpText<"Enable origins tracking in MemorySanitizer">;
1850 def fno_sanitize_memory_track_origins : Flag<["-"], "fno-sanitize-memory-track-origins">,
1851                                         Group<f_clang_Group>,
1852                                         Flags<[CoreOption, NoXarchOption]>,
1853                                         HelpText<"Disable origins tracking in MemorySanitizer">;
1854 def fsanitize_address_outline_instrumentation : Flag<["-"], "fsanitize-address-outline-instrumentation">,
1855                                                 Group<f_clang_Group>,
1856                                                 HelpText<"Always generate function calls for address sanitizer instrumentation">;
1857 def fno_sanitize_address_outline_instrumentation : Flag<["-"], "fno-sanitize-address-outline-instrumentation">,
1858                                                    Group<f_clang_Group>,
1859                                                    HelpText<"Use default code inlining logic for the address sanitizer">;
1860 defm sanitize_stable_abi
1861   : OptInCC1FFlag<"sanitize-stable-abi", "Stable  ", "Conventional ",
1862     "ABI instrumentation for sanitizer runtime. Default: Conventional">;
1863
1864 def fsanitize_memtag_mode_EQ : Joined<["-"], "fsanitize-memtag-mode=">,
1865                                         Group<f_clang_Group>,
1866                                         HelpText<"Set default MTE mode to 'sync' (default) or 'async'">;
1867 def fsanitize_hwaddress_experimental_aliasing
1868   : Flag<["-"], "fsanitize-hwaddress-experimental-aliasing">,
1869     Group<f_clang_Group>,
1870     HelpText<"Enable aliasing mode in HWAddressSanitizer">;
1871 def fno_sanitize_hwaddress_experimental_aliasing
1872   : Flag<["-"], "fno-sanitize-hwaddress-experimental-aliasing">,
1873     Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1874     HelpText<"Disable aliasing mode in HWAddressSanitizer">;
1875 defm sanitize_memory_use_after_dtor : BoolOption<"f", "sanitize-memory-use-after-dtor",
1876   CodeGenOpts<"SanitizeMemoryUseAfterDtor">, DefaultFalse,
1877   PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1878   BothFlags<[], " use-after-destroy detection in MemorySanitizer">>,
1879   Group<f_clang_Group>;
1880 def fsanitize_address_field_padding : Joined<["-"], "fsanitize-address-field-padding=">,
1881                                         Group<f_clang_Group>,
1882                                         HelpText<"Level of field padding for AddressSanitizer">,
1883                                         MarshallingInfoInt<LangOpts<"SanitizeAddressFieldPadding">>;
1884 defm sanitize_address_use_after_scope : BoolOption<"f", "sanitize-address-use-after-scope",
1885   CodeGenOpts<"SanitizeAddressUseAfterScope">, DefaultFalse,
1886   PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Disable">,
1887   BothFlags<[], " use-after-scope detection in AddressSanitizer">>,
1888   Group<f_clang_Group>;
1889 def sanitize_address_use_after_return_EQ
1890   : Joined<["-"], "fsanitize-address-use-after-return=">,
1891     MetaVarName<"<mode>">,
1892     Flags<[CC1Option]>,
1893     HelpText<"Select the mode of detecting stack use-after-return in AddressSanitizer">,
1894     Group<f_clang_Group>,
1895     Values<"never,runtime,always">,
1896     NormalizedValuesScope<"llvm::AsanDetectStackUseAfterReturnMode">,
1897     NormalizedValues<["Never", "Runtime", "Always"]>,
1898     MarshallingInfoEnum<CodeGenOpts<"SanitizeAddressUseAfterReturn">, "Runtime">;
1899 defm sanitize_address_poison_custom_array_cookie : BoolOption<"f", "sanitize-address-poison-custom-array-cookie",
1900   CodeGenOpts<"SanitizeAddressPoisonCustomArrayCookie">, DefaultFalse,
1901   PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
1902   BothFlags<[], " poisoning array cookies when using custom operator new[] in AddressSanitizer">>,
1903   DocBrief<[{Enable "poisoning" array cookies when allocating arrays with a
1904 custom operator new\[\] in Address Sanitizer, preventing accesses to the
1905 cookies from user code. An array cookie is a small implementation-defined
1906 header added to certain array allocations to record metadata such as the
1907 length of the array. Accesses to array cookies from user code are technically
1908 allowed by the standard but are more likely to be the result of an
1909 out-of-bounds array access.
1910
1911 An operator new\[\] is "custom" if it is not one of the allocation functions
1912 provided by the C++ standard library. Array cookies from non-custom allocation
1913 functions are always poisoned.}]>,
1914   Group<f_clang_Group>;
1915 defm sanitize_address_globals_dead_stripping : BoolOption<"f", "sanitize-address-globals-dead-stripping",
1916   CodeGenOpts<"SanitizeAddressGlobalsDeadStripping">, DefaultFalse,
1917   PosFlag<SetTrue, [], "Enable linker dead stripping of globals in AddressSanitizer">,
1918   NegFlag<SetFalse, [], "Disable linker dead stripping of globals in AddressSanitizer">>,
1919   Group<f_clang_Group>;
1920 defm sanitize_address_use_odr_indicator : BoolOption<"f", "sanitize-address-use-odr-indicator",
1921   CodeGenOpts<"SanitizeAddressUseOdrIndicator">, DefaultTrue,
1922   PosFlag<SetTrue, [], "Enable ODR indicator globals to avoid false ODR violation"
1923             " reports in partially sanitized programs at the cost of an increase in binary size">,
1924   NegFlag<SetFalse, [], "Disable ODR indicator globals">>,
1925   Group<f_clang_Group>;
1926 def sanitize_address_destructor_EQ
1927     : Joined<["-"], "fsanitize-address-destructor=">,
1928       Flags<[CC1Option]>,
1929       HelpText<"Set the kind of module destructors emitted by "
1930                "AddressSanitizer instrumentation. These destructors are "
1931                "emitted to unregister instrumented global variables when "
1932                "code is unloaded (e.g. via `dlclose()`).">,
1933       Group<f_clang_Group>,
1934       Values<"none,global">,
1935       NormalizedValuesScope<"llvm::AsanDtorKind">,
1936       NormalizedValues<["None", "Global"]>,
1937       MarshallingInfoEnum<CodeGenOpts<"SanitizeAddressDtor">, "Global">;
1938 defm sanitize_memory_param_retval
1939     : BoolFOption<"sanitize-memory-param-retval",
1940         CodeGenOpts<"SanitizeMemoryParamRetval">,
1941         DefaultTrue,
1942         PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1943         BothFlags<[], " detection of uninitialized parameters and return values">>;
1944 //// Note: This flag was introduced when it was necessary to distinguish between
1945 //       ABI for correct codegen.  This is no longer needed, but the flag is
1946 //       not removed since targeting either ABI will behave the same.
1947 //       This way we cause no disturbance to existing scripts & code, and if we
1948 //       want to use this flag in the future we will cause no disturbance then
1949 //       either.
1950 def fsanitize_hwaddress_abi_EQ
1951     : Joined<["-"], "fsanitize-hwaddress-abi=">,
1952       Group<f_clang_Group>,
1953       HelpText<"Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused.">;
1954 def fsanitize_recover_EQ : CommaJoined<["-"], "fsanitize-recover=">,
1955                            Group<f_clang_Group>,
1956                            HelpText<"Enable recovery for specified sanitizers">;
1957 def fno_sanitize_recover_EQ : CommaJoined<["-"], "fno-sanitize-recover=">,
1958                               Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1959                               HelpText<"Disable recovery for specified sanitizers">;
1960 def fsanitize_recover : Flag<["-"], "fsanitize-recover">, Group<f_clang_Group>,
1961                         Alias<fsanitize_recover_EQ>, AliasArgs<["all"]>;
1962 def fno_sanitize_recover : Flag<["-"], "fno-sanitize-recover">,
1963                            Flags<[CoreOption, NoXarchOption]>, Group<f_clang_Group>,
1964                            Alias<fno_sanitize_recover_EQ>, AliasArgs<["all"]>;
1965 def fsanitize_trap_EQ : CommaJoined<["-"], "fsanitize-trap=">, Group<f_clang_Group>,
1966                         HelpText<"Enable trapping for specified sanitizers">;
1967 def fno_sanitize_trap_EQ : CommaJoined<["-"], "fno-sanitize-trap=">, Group<f_clang_Group>,
1968                            Flags<[CoreOption, NoXarchOption]>,
1969                            HelpText<"Disable trapping for specified sanitizers">;
1970 def fsanitize_trap : Flag<["-"], "fsanitize-trap">, Group<f_clang_Group>,
1971                      Alias<fsanitize_trap_EQ>, AliasArgs<["all"]>,
1972                      HelpText<"Enable trapping for all sanitizers">;
1973 def fno_sanitize_trap : Flag<["-"], "fno-sanitize-trap">, Group<f_clang_Group>,
1974                         Alias<fno_sanitize_trap_EQ>, AliasArgs<["all"]>,
1975                         Flags<[CoreOption, NoXarchOption]>,
1976                         HelpText<"Disable trapping for all sanitizers">;
1977 def fsanitize_undefined_trap_on_error
1978     : Flag<["-"], "fsanitize-undefined-trap-on-error">, Group<f_clang_Group>,
1979       Alias<fsanitize_trap_EQ>, AliasArgs<["undefined"]>;
1980 def fno_sanitize_undefined_trap_on_error
1981     : Flag<["-"], "fno-sanitize-undefined-trap-on-error">, Group<f_clang_Group>,
1982       Alias<fno_sanitize_trap_EQ>, AliasArgs<["undefined"]>;
1983 defm sanitize_minimal_runtime : BoolOption<"f", "sanitize-minimal-runtime",
1984   CodeGenOpts<"SanitizeMinimalRuntime">, DefaultFalse,
1985   PosFlag<SetTrue>, NegFlag<SetFalse>>,
1986   Group<f_clang_Group>;
1987 def fsanitize_link_runtime : Flag<["-"], "fsanitize-link-runtime">,
1988                            Group<f_clang_Group>;
1989 def fno_sanitize_link_runtime : Flag<["-"], "fno-sanitize-link-runtime">,
1990                               Group<f_clang_Group>;
1991 def fsanitize_link_cxx_runtime : Flag<["-"], "fsanitize-link-c++-runtime">,
1992                                  Group<f_clang_Group>;
1993 def fno_sanitize_link_cxx_runtime : Flag<["-"], "fno-sanitize-link-c++-runtime">,
1994                                     Group<f_clang_Group>;
1995 defm sanitize_cfi_cross_dso : BoolOption<"f", "sanitize-cfi-cross-dso",
1996   CodeGenOpts<"SanitizeCfiCrossDso">, DefaultFalse,
1997   PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Disable">,
1998   BothFlags<[], " control flow integrity (CFI) checks for cross-DSO calls.">>,
1999   Group<f_clang_Group>;
2000 def fsanitize_cfi_icall_generalize_pointers : Flag<["-"], "fsanitize-cfi-icall-generalize-pointers">,
2001                                               Group<f_clang_Group>,
2002                                               HelpText<"Generalize pointers in CFI indirect call type signature checks">,
2003                                               MarshallingInfoFlag<CodeGenOpts<"SanitizeCfiICallGeneralizePointers">>;
2004 def fsanitize_cfi_icall_normalize_integers : Flag<["-"], "fsanitize-cfi-icall-experimental-normalize-integers">,
2005                                              Group<f_clang_Group>,
2006                                              HelpText<"Normalize integers in CFI indirect call type signature checks">,
2007                                              MarshallingInfoFlag<CodeGenOpts<"SanitizeCfiICallNormalizeIntegers">>;
2008 defm sanitize_cfi_canonical_jump_tables : BoolOption<"f", "sanitize-cfi-canonical-jump-tables",
2009   CodeGenOpts<"SanitizeCfiCanonicalJumpTables">, DefaultFalse,
2010   PosFlag<SetTrue, [], "Make">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Do not make">,
2011   BothFlags<[], " the jump table addresses canonical in the symbol table">>,
2012   Group<f_clang_Group>;
2013 defm sanitize_stats : BoolOption<"f", "sanitize-stats",
2014   CodeGenOpts<"SanitizeStats">, DefaultFalse,
2015   PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Disable">,
2016   BothFlags<[], " sanitizer statistics gathering.">>,
2017   Group<f_clang_Group>;
2018 def fsanitize_thread_memory_access : Flag<["-"], "fsanitize-thread-memory-access">,
2019                                      Group<f_clang_Group>,
2020                                      HelpText<"Enable memory access instrumentation in ThreadSanitizer (default)">;
2021 def fno_sanitize_thread_memory_access : Flag<["-"], "fno-sanitize-thread-memory-access">,
2022                                         Group<f_clang_Group>,
2023                                         Flags<[CoreOption, NoXarchOption]>,
2024                                         HelpText<"Disable memory access instrumentation in ThreadSanitizer">;
2025 def fsanitize_thread_func_entry_exit : Flag<["-"], "fsanitize-thread-func-entry-exit">,
2026                                        Group<f_clang_Group>,
2027                                        HelpText<"Enable function entry/exit instrumentation in ThreadSanitizer (default)">;
2028 def fno_sanitize_thread_func_entry_exit : Flag<["-"], "fno-sanitize-thread-func-entry-exit">,
2029                                           Group<f_clang_Group>,
2030                                           Flags<[CoreOption, NoXarchOption]>,
2031                                           HelpText<"Disable function entry/exit instrumentation in ThreadSanitizer">;
2032 def fsanitize_thread_atomics : Flag<["-"], "fsanitize-thread-atomics">,
2033                                Group<f_clang_Group>,
2034                                HelpText<"Enable atomic operations instrumentation in ThreadSanitizer (default)">;
2035 def fno_sanitize_thread_atomics : Flag<["-"], "fno-sanitize-thread-atomics">,
2036                                   Group<f_clang_Group>,
2037                                   Flags<[CoreOption, NoXarchOption]>,
2038                                   HelpText<"Disable atomic operations instrumentation in ThreadSanitizer">;
2039 def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-undefined-strip-path-components=">,
2040   Group<f_clang_Group>, MetaVarName<"<number>">,
2041   HelpText<"Strip (or keep only, if negative) a given number of path components "
2042            "when emitting check metadata.">,
2043   MarshallingInfoInt<CodeGenOpts<"EmitCheckPathComponentsToStrip">, "0", "int">;
2044
2045 } // end -f[no-]sanitize* flags
2046
2047 def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">,
2048   Group<f_Group>, Flags<[CC1Option]>,
2049   HelpText<"Allow unsafe floating-point math optimizations which may decrease precision">,
2050   MarshallingInfoFlag<LangOpts<"UnsafeFPMath">>,
2051   ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, ffast_math.KeyPath]>;
2052 def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">,
2053   Group<f_Group>;
2054 def fassociative_math : Flag<["-"], "fassociative-math">, Group<f_Group>;
2055 def fno_associative_math : Flag<["-"], "fno-associative-math">, Group<f_Group>;
2056 defm reciprocal_math : BoolFOption<"reciprocal-math",
2057   LangOpts<"AllowRecip">, DefaultFalse,
2058   PosFlag<SetTrue, [CC1Option, FC1Option, FlangOption], "Allow division operations to be reassociated",
2059           [funsafe_math_optimizations.KeyPath]>,
2060   NegFlag<SetFalse>>;
2061 defm approx_func : BoolFOption<"approx-func", LangOpts<"ApproxFunc">, DefaultFalse,
2062    PosFlag<SetTrue, [CC1Option, FC1Option, FlangOption], "Allow certain math function calls to be replaced "
2063            "with an approximately equivalent calculation",
2064            [funsafe_math_optimizations.KeyPath]>,
2065    NegFlag<SetFalse>>;
2066 defm finite_math_only : BoolFOption<"finite-math-only",
2067   LangOpts<"FiniteMathOnly">, DefaultFalse,
2068   PosFlag<SetTrue, [CC1Option], "Allow floating-point optimizations that "
2069           "assume arguments and results are not NaNs or +-inf. This defines "
2070           "the \\_\\_FINITE\\_MATH\\_ONLY\\_\\_ preprocessor macro.",
2071           [cl_finite_math_only.KeyPath, ffast_math.KeyPath]>,
2072   NegFlag<SetFalse>>;
2073 defm signed_zeros : BoolFOption<"signed-zeros",
2074   LangOpts<"NoSignedZero">, DefaultFalse,
2075   NegFlag<SetTrue, [CC1Option, FC1Option, FlangOption], "Allow optimizations that ignore the sign of floating point zeros",
2076             [cl_no_signed_zeros.KeyPath, funsafe_math_optimizations.KeyPath]>,
2077   PosFlag<SetFalse>>;
2078 def fhonor_nans : Flag<["-"], "fhonor-nans">, Group<f_Group>,
2079   HelpText<"Specify that floating-point optimizations are not allowed that "
2080            "assume arguments and results are not NANs.">;
2081 def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Group<f_Group>;
2082 def fhonor_infinities : Flag<["-"], "fhonor-infinities">,
2083   Group<f_Group>,
2084   HelpText<"Specify that floating-point optimizations are not allowed that "
2085            "assume arguments and results are not +-inf.">;
2086 def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, Group<f_Group>;
2087 // This option was originally misspelt "infinites" [sic].
2088 def : Flag<["-"], "fhonor-infinites">, Alias<fhonor_infinities>;
2089 def : Flag<["-"], "fno-honor-infinites">, Alias<fno_honor_infinities>;
2090 def frounding_math : Flag<["-"], "frounding-math">, Group<f_Group>, Flags<[CC1Option]>,
2091   MarshallingInfoFlag<LangOpts<"RoundingMath">>,
2092   Normalizer<"makeFlagToValueNormalizer(llvm::RoundingMode::Dynamic)">;
2093 def fno_rounding_math : Flag<["-"], "fno-rounding-math">, Group<f_Group>, Flags<[CC1Option]>;
2094 def ftrapping_math : Flag<["-"], "ftrapping-math">, Group<f_Group>;
2095 def fno_trapping_math : Flag<["-"], "fno-trapping-math">, Group<f_Group>;
2096 def ffp_contract : Joined<["-"], "ffp-contract=">, Group<f_Group>,
2097   Flags<[CC1Option, FC1Option, FlangOption]>,
2098   DocBrief<"Form fused FP ops (e.g. FMAs):"
2099   " fast (fuses across statements disregarding pragmas)"
2100   " | on (only fuses in the same statement unless dictated by pragmas)"
2101   " | off (never fuses)"
2102   " | fast-honor-pragmas (fuses across statements unless dictated by pragmas)."
2103   " Default is 'fast' for CUDA, 'fast-honor-pragmas' for HIP, and 'on' otherwise.">,
2104   HelpText<"Form fused FP ops (e.g. FMAs)">,
2105   Values<"fast,on,off,fast-honor-pragmas">;
2106
2107 defm strict_float_cast_overflow : BoolFOption<"strict-float-cast-overflow",
2108   CodeGenOpts<"StrictFloatCastOverflow">, DefaultTrue,
2109   NegFlag<SetFalse, [CC1Option], "Relax language rules and try to match the behavior"
2110             " of the target's native float-to-int conversion instructions">,
2111   PosFlag<SetTrue, [], "Assume that overflowing float-to-int casts are undefined (default)">>;
2112
2113 defm protect_parens : BoolFOption<"protect-parens",
2114   LangOpts<"ProtectParens">, DefaultFalse,
2115   PosFlag<SetTrue, [CoreOption, CC1Option],
2116           "Determines whether the optimizer honors parentheses when "
2117           "floating-point expressions are evaluated">,
2118   NegFlag<SetFalse>>;
2119
2120 def ffor_scope : Flag<["-"], "ffor-scope">, Group<f_Group>;
2121 def fno_for_scope : Flag<["-"], "fno-for-scope">, Group<f_Group>;
2122
2123 defm rewrite_imports : BoolFOption<"rewrite-imports",
2124   PreprocessorOutputOpts<"RewriteImports">, DefaultFalse,
2125   PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
2126 defm rewrite_includes : BoolFOption<"rewrite-includes",
2127   PreprocessorOutputOpts<"RewriteIncludes">, DefaultFalse,
2128   PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
2129
2130 defm directives_only : OptInCC1FFlag<"directives-only", "">;
2131
2132 defm delete_null_pointer_checks : BoolFOption<"delete-null-pointer-checks",
2133   CodeGenOpts<"NullPointerIsValid">, DefaultFalse,
2134   NegFlag<SetTrue, [CC1Option], "Do not treat usage of null pointers as undefined behavior">,
2135   PosFlag<SetFalse, [], "Treat usage of null pointers as undefined behavior (default)">,
2136   BothFlags<[CoreOption]>>,
2137   DocBrief<[{When enabled, treat null pointer dereference, creation of a reference to null,
2138 or passing a null pointer to a function parameter annotated with the "nonnull"
2139 attribute as undefined behavior. (And, thus the optimizer may assume that any
2140 pointer used in such a way must not have been null and optimize away the
2141 branches accordingly.) On by default.}]>;
2142
2143 defm use_line_directives : BoolFOption<"use-line-directives",
2144   PreprocessorOutputOpts<"UseLineDirectives">, DefaultFalse,
2145   PosFlag<SetTrue, [CC1Option], "Use #line in preprocessed output">, NegFlag<SetFalse>>;
2146 defm minimize_whitespace : BoolFOption<"minimize-whitespace",
2147   PreprocessorOutputOpts<"MinimizeWhitespace">, DefaultFalse,
2148   PosFlag<SetTrue, [CC1Option], "Ignore the whitespace from the input file "
2149           "when emitting preprocessor output. It will only contain whitespace "
2150           "when necessary, e.g. to keep two minus signs from merging into to "
2151           "an increment operator. Useful with the -P option to normalize "
2152           "whitespace such that two files with only formatting changes are "
2153           "equal.\n\nOnly valid with -E on C-like inputs and incompatible "
2154           "with -traditional-cpp.">, NegFlag<SetFalse>>;
2155
2156 def ffreestanding : Flag<["-"], "ffreestanding">, Group<f_Group>, Flags<[CC1Option]>,
2157   HelpText<"Assert that the compilation takes place in a freestanding environment">,
2158   MarshallingInfoFlag<LangOpts<"Freestanding">>;
2159 def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group<f_Group>,
2160   HelpText<"Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)">,
2161   Flags<[CC1Option, CoreOption]>;
2162 // We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension
2163 // keywords. This behavior is provided by GCC's poorly named '-fasm' flag,
2164 // while a subset (the non-C++ GNU keywords) is provided by GCC's
2165 // '-fgnu-keywords'. Clang conflates the two for simplicity under the single
2166 // name, as it doesn't seem a useful distinction.
2167 defm gnu_keywords : BoolFOption<"gnu-keywords",
2168   LangOpts<"GNUKeywords">, Default<gnu_mode.KeyPath>,
2169   PosFlag<SetTrue, [], "Allow GNU-extension keywords regardless of language standard">,
2170   NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
2171 defm gnu89_inline : BoolFOption<"gnu89-inline",
2172   LangOpts<"GNUInline">, Default<!strconcat("!", c99.KeyPath, " && !", cplusplus.KeyPath)>,
2173   PosFlag<SetTrue, [CC1Option], "Use the gnu89 inline semantics">,
2174   NegFlag<SetFalse>>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
2175 def fgnu_runtime : Flag<["-"], "fgnu-runtime">, Group<f_Group>,
2176   HelpText<"Generate output compatible with the standard GNU Objective-C runtime">;
2177 def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">, Flags<[CC1Option]>,
2178   MarshallingInfoFlag<LangOpts<"HeinousExtensions">>;
2179 def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>,
2180                Group<Link_Group>;
2181 def : Flag<["-"], "findirect-virtual-calls">, Alias<fapple_kext>;
2182 def finline_functions : Flag<["-"], "finline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>,
2183   HelpText<"Inline suitable functions">;
2184 def finline_hint_functions: Flag<["-"], "finline-hint-functions">, Group<f_clang_Group>, Flags<[CC1Option]>,
2185   HelpText<"Inline functions which are (explicitly or implicitly) marked inline">;
2186 def finline : Flag<["-"], "finline">, Group<clang_ignored_f_Group>;
2187 def finline_max_stacksize_EQ
2188     : Joined<["-"], "finline-max-stacksize=">,
2189       Group<f_Group>, Flags<[CoreOption, CC1Option]>,
2190       HelpText<"Suppress inlining of functions whose stack size exceeds the given value">,
2191       MarshallingInfoInt<CodeGenOpts<"InlineMaxStackSize">, "UINT_MAX">;
2192 defm jmc : BoolFOption<"jmc",
2193   CodeGenOpts<"JMCInstrument">, DefaultFalse,
2194   PosFlag<SetTrue, [CC1Option], "Enable just-my-code debugging">,
2195   NegFlag<SetFalse>>;
2196 def fglobal_isel : Flag<["-"], "fglobal-isel">, Group<f_clang_Group>,
2197   HelpText<"Enables the global instruction selector">;
2198 def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group<f_clang_Group>,
2199   Alias<fglobal_isel>;
2200 def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">,
2201   Group<f_clang_Group>, Flags<[CC1Option]>,
2202   HelpText<"Enables the use of non-default rounding modes and non-default exception handling on targets that are not currently ready.">,
2203   MarshallingInfoFlag<LangOpts<"ExpStrictFP">>;
2204 def finput_charset_EQ : Joined<["-"], "finput-charset=">, Flags<[FlangOption, FC1Option]>, Group<f_Group>,
2205   HelpText<"Specify the default character set for source files">;
2206 def fexec_charset_EQ : Joined<["-"], "fexec-charset=">, Group<f_Group>;
2207 def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>, Flags<[CC1Option]>,
2208   HelpText<"Generate calls to instrument function entry and exit">,
2209   MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctions">>;
2210 def finstrument_functions_after_inlining : Flag<["-"], "finstrument-functions-after-inlining">, Group<f_Group>, Flags<[CC1Option]>,
2211   HelpText<"Like -finstrument-functions, but insert the calls after inlining">,
2212   MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionsAfterInlining">>;
2213 def finstrument_function_entry_bare : Flag<["-"], "finstrument-function-entry-bare">, Group<f_Group>, Flags<[CC1Option]>,
2214   HelpText<"Instrument function entry only, after inlining, without arguments to the instrumentation call">,
2215   MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionEntryBare">>;
2216 def fcf_protection_EQ : Joined<["-"], "fcf-protection=">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2217   HelpText<"Instrument control-flow architecture protection">, Values<"return,branch,full,none">;
2218 def fcf_protection : Flag<["-"], "fcf-protection">, Group<f_Group>, Flags<[CoreOption, CC1Option]>,
2219   Alias<fcf_protection_EQ>, AliasArgs<["full"]>,
2220   HelpText<"Enable cf-protection in 'full' mode">;
2221 def mfunction_return_EQ : Joined<["-"], "mfunction-return=">,
2222   Group<m_Group>, Flags<[CoreOption, CC1Option]>,
2223   HelpText<"Replace returns with jumps to ``__x86_return_thunk`` (x86 only, error otherwise)">,
2224   Values<"keep,thunk-extern">,
2225   NormalizedValues<["Keep", "Extern"]>,
2226   NormalizedValuesScope<"llvm::FunctionReturnThunksKind">,
2227   MarshallingInfoEnum<CodeGenOpts<"FunctionReturnThunks">, "Keep">;
2228 def mindirect_branch_cs_prefix : Flag<["-"], "mindirect-branch-cs-prefix">,
2229   Group<m_Group>, Flags<[CoreOption, CC1Option]>,
2230   HelpText<"Add cs prefix to call and jmp to indirect thunk">,
2231   MarshallingInfoFlag<CodeGenOpts<"IndirectBranchCSPrefix">>;
2232
2233 defm xray_instrument : BoolFOption<"xray-instrument",
2234   LangOpts<"XRayInstrument">, DefaultFalse,
2235   PosFlag<SetTrue, [CC1Option], "Generate XRay instrumentation sleds on function entry and exit">,
2236   NegFlag<SetFalse>>;
2237
2238 def fxray_instruction_threshold_EQ :
2239   Joined<["-"], "fxray-instruction-threshold=">,
2240   Group<f_Group>, Flags<[CC1Option]>,
2241   HelpText<"Sets the minimum function size to instrument with XRay">,
2242   MarshallingInfoInt<CodeGenOpts<"XRayInstructionThreshold">, "200">;
2243
2244 def fxray_always_instrument :
2245   Joined<["-"], "fxray-always-instrument=">,
2246   Group<f_Group>, Flags<[CC1Option]>,
2247   HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.">,
2248   MarshallingInfoStringVector<LangOpts<"XRayAlwaysInstrumentFiles">>;
2249 def fxray_never_instrument :
2250   Joined<["-"], "fxray-never-instrument=">,
2251   Group<f_Group>, Flags<[CC1Option]>,
2252   HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.">,
2253   MarshallingInfoStringVector<LangOpts<"XRayNeverInstrumentFiles">>;
2254 def fxray_attr_list :
2255   Joined<["-"], "fxray-attr-list=">,
2256   Group<f_Group>, Flags<[CC1Option]>,
2257   HelpText<"Filename defining the list of functions/types for imbuing XRay attributes.">,
2258   MarshallingInfoStringVector<LangOpts<"XRayAttrListFiles">>;
2259 def fxray_modes :
2260   Joined<["-"], "fxray-modes=">,
2261   Group<f_Group>, Flags<[CC1Option]>,
2262   HelpText<"List of modes to link in by default into XRay instrumented binaries.">;
2263
2264 defm xray_always_emit_customevents : BoolFOption<"xray-always-emit-customevents",
2265   LangOpts<"XRayAlwaysEmitCustomEvents">, DefaultFalse,
2266   PosFlag<SetTrue, [CC1Option], "Always emit __xray_customevent(...) calls"
2267           " even if the containing function is not always instrumented">,
2268   NegFlag<SetFalse>>;
2269
2270 defm xray_always_emit_typedevents : BoolFOption<"xray-always-emit-typedevents",
2271   LangOpts<"XRayAlwaysEmitTypedEvents">, DefaultFalse,
2272   PosFlag<SetTrue, [CC1Option], "Always emit __xray_typedevent(...) calls"
2273           " even if the containing function is not always instrumented">,
2274   NegFlag<SetFalse>>;
2275
2276 defm xray_ignore_loops : BoolFOption<"xray-ignore-loops",
2277   CodeGenOpts<"XRayIgnoreLoops">, DefaultFalse,
2278   PosFlag<SetTrue, [CC1Option], "Don't instrument functions with loops"
2279           " unless they also meet the minimum function size">,
2280   NegFlag<SetFalse>>;
2281
2282 defm xray_function_index : BoolFOption<"xray-function-index",
2283   CodeGenOpts<"XRayFunctionIndex">, DefaultTrue,
2284   PosFlag<SetTrue, []>,
2285   NegFlag<SetFalse, [CC1Option], "Omit function index section at the"
2286           " expense of single-function patching performance">>;
2287
2288 def fxray_link_deps : Flag<["-"], "fxray-link-deps">, Group<f_Group>,
2289   HelpText<"Link XRay runtime library when -fxray-instrument is specified (default)">;
2290 def fno_xray_link_deps : Flag<["-"], "fno-xray-link-deps">, Group<f_Group>;
2291
2292 def fxray_instrumentation_bundle :
2293   Joined<["-"], "fxray-instrumentation-bundle=">,
2294   Group<f_Group>, Flags<[CC1Option]>,
2295   HelpText<"Select which XRay instrumentation points to emit. Options: all, none, function-entry, function-exit, function, custom. Default is 'all'.  'function' includes both 'function-entry' and 'function-exit'.">;
2296
2297 def fxray_function_groups :
2298   Joined<["-"], "fxray-function-groups=">,
2299   Group<f_Group>, Flags<[CC1Option]>,
2300   HelpText<"Only instrument 1 of N groups">,
2301   MarshallingInfoInt<CodeGenOpts<"XRayTotalFunctionGroups">, "1">;
2302
2303 def fxray_selected_function_group :
2304   Joined<["-"], "fxray-selected-function-group=">,
2305   Group<f_Group>, Flags<[CC1Option]>,
2306   HelpText<"When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1">,
2307   MarshallingInfoInt<CodeGenOpts<"XRaySelectedFunctionGroup">, "0">;
2308
2309
2310 defm fine_grained_bitfield_accesses : BoolOption<"f", "fine-grained-bitfield-accesses",
2311   CodeGenOpts<"FineGrainedBitfieldAccesses">, DefaultFalse,
2312   PosFlag<SetTrue, [], "Use separate accesses for consecutive bitfield runs with legal widths and alignments.">,
2313   NegFlag<SetFalse, [], "Use large-integer access for consecutive bitfield runs.">,
2314   BothFlags<[CC1Option]>>,
2315   Group<f_clang_Group>;
2316
2317 def fexperimental_relative_cxx_abi_vtables :
2318   Flag<["-"], "fexperimental-relative-c++-abi-vtables">,
2319   Group<f_clang_Group>, Flags<[CC1Option]>,
2320   HelpText<"Use the experimental C++ class ABI for classes with virtual tables">;
2321 def fno_experimental_relative_cxx_abi_vtables :
2322   Flag<["-"], "fno-experimental-relative-c++-abi-vtables">,
2323   Group<f_clang_Group>, Flags<[CC1Option]>,
2324   HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">;
2325
2326 def fcxx_abi_EQ : Joined<["-"], "fc++-abi=">,
2327                   Group<f_clang_Group>, Flags<[CC1Option]>,
2328                   HelpText<"C++ ABI to use. This will override the target C++ ABI.">;
2329
2330 def flat__namespace : Flag<["-"], "flat_namespace">;
2331 def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, Group<f_Group>,
2332   HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">, Flags<[CC1Option]>,
2333   NormalizedValues<["LangOptions::LaxVectorConversionKind::None",
2334                     "LangOptions::LaxVectorConversionKind::Integer",
2335                     "LangOptions::LaxVectorConversionKind::All"]>,
2336   MarshallingInfoEnum<LangOpts<"LaxVectorConversions">,
2337                       open_cl.KeyPath #
2338                           " ? LangOptions::LaxVectorConversionKind::None" #
2339                           " : LangOptions::LaxVectorConversionKind::All">;
2340 def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Group>,
2341   Alias<flax_vector_conversions_EQ>, AliasArgs<["integer"]>;
2342 def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
2343 def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group<f_Group>,
2344   HelpText<"Force linking the clang builtins runtime library">;
2345 def flto_EQ : Joined<["-"], "flto=">, Flags<[CoreOption, CC1Option, FC1Option, FlangOption]>, Group<f_Group>,
2346   HelpText<"Set LTO mode">, Values<"thin,full">;
2347 def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Group<f_Group>,
2348   Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
2349 def flto_EQ_auto : Flag<["-"], "flto=auto">, Group<f_Group>,
2350   Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
2351 def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option, FC1Option, FlangOption]>, Group<f_Group>,
2352   Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
2353 defm unified_lto : BoolFOption<"unified-lto",
2354   CodeGenOpts<"UnifiedLTO">, DefaultFalse,
2355   PosFlag<SetTrue, [], "Use the unified LTO pipeline">,
2356   NegFlag<SetFalse, [], "Use distinct LTO pipelines">,
2357   BothFlags<[CC1Option], "">>;
2358 def fno_lto : Flag<["-"], "fno-lto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2359   HelpText<"Disable LTO mode (default)">;
2360 def foffload_lto_EQ : Joined<["-"], "foffload-lto=">, Flags<[CoreOption]>, Group<f_Group>,
2361   HelpText<"Set LTO mode for offload compilation">, Values<"thin,full">;
2362 def foffload_lto : Flag<["-"], "foffload-lto">, Flags<[CoreOption]>, Group<f_Group>,
2363   Alias<foffload_lto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode for offload compilation">;
2364 def fno_offload_lto : Flag<["-"], "fno-offload-lto">, Flags<[CoreOption]>, Group<f_Group>,
2365   HelpText<"Disable LTO mode (default) for offload compilation">;
2366 def flto_jobs_EQ : Joined<["-"], "flto-jobs=">,
2367   Flags<[CC1Option]>, Group<f_Group>,
2368   HelpText<"Controls the backend parallelism of -flto=thin (default "
2369            "of 0 means the number of threads will be derived from "
2370            "the number of CPUs detected)">;
2371 def fthinlto_index_EQ : Joined<["-"], "fthinlto-index=">,
2372   Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2373   HelpText<"Perform ThinLTO importing using provided function summary index">;
2374 def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
2375   Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2376   HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">,
2377   MarshallingInfoString<CodeGenOpts<"ThinLinkBitcodeFile">>;
2378 def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
2379   Group<f_Group>, Flags<[NoXarchOption, CC1Option, CoreOption]>,
2380   HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit)">,
2381   MarshallingInfoInt<DiagnosticOpts<"MacroBacktraceLimit">, "DiagnosticOptions::DefaultMacroBacktraceLimit">;
2382 def fcaret_diagnostics_max_lines_EQ :
2383   Joined<["-"], "fcaret-diagnostics-max-lines=">,
2384   Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2385   HelpText<"Set the maximum number of source lines to show in a caret diagnostic (0 = no limit).">,
2386   MarshallingInfoInt<DiagnosticOpts<"SnippetLineLimit">, "DiagnosticOptions::DefaultSnippetLineLimit">;
2387 defm merge_all_constants : BoolFOption<"merge-all-constants",
2388   CodeGenOpts<"MergeAllConstants">, DefaultFalse,
2389   PosFlag<SetTrue, [CC1Option, CoreOption], "Allow">, NegFlag<SetFalse, [], "Disallow">,
2390   BothFlags<[], " merging of constants">>;
2391 def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>, Flags<[CC1Option]>,
2392   HelpText<"Format message diagnostics so that they fit within N columns">,
2393   MarshallingInfoInt<DiagnosticOpts<"MessageLength">>;
2394 def frandomize_layout_seed_EQ : Joined<["-"], "frandomize-layout-seed=">,
2395   MetaVarName<"<seed>">, Group<f_clang_Group>, Flags<[CC1Option]>,
2396   HelpText<"The seed used by the randomize structure layout feature">;
2397 def frandomize_layout_seed_file_EQ : Joined<["-"], "frandomize-layout-seed-file=">,
2398   MetaVarName<"<file>">, Group<f_clang_Group>, Flags<[CC1Option]>,
2399   HelpText<"File holding the seed used by the randomize structure layout feature">;
2400 def fms_compatibility : Flag<["-"], "fms-compatibility">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2401   HelpText<"Enable full Microsoft Visual C++ compatibility">,
2402   MarshallingInfoFlag<LangOpts<"MSVCCompat">>;
2403 def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2404   HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">,
2405   MarshallingInfoFlag<LangOpts<"MicrosoftExt">>, ImpliedByAnyOf<[fms_compatibility.KeyPath]>;
2406 defm asm_blocks : BoolFOption<"asm-blocks",
2407   LangOpts<"AsmBlocks">, Default<fms_extensions.KeyPath>,
2408   PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
2409 def fms_volatile : Flag<["-"], "fms-volatile">, Group<f_Group>, Flags<[CC1Option]>,
2410   MarshallingInfoFlag<LangOpts<"MSVolatile">>;
2411 def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>, Flags<[NoXarchOption, CoreOption]>,
2412   HelpText<"Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default))">;
2413 def fms_compatibility_version
2414     : Joined<["-"], "fms-compatibility-version=">,
2415       Group<f_Group>,
2416       Flags<[ CC1Option, CoreOption ]>,
2417       HelpText<"Dot-separated value representing the Microsoft compiler "
2418                "version number to report in _MSC_VER (0 = don't define it "
2419                "(default))">;
2420 def fms_runtime_lib_EQ : Joined<["-"], "fms-runtime-lib=">, Group<f_Group>,
2421   Flags<[NoXarchOption, CoreOption]>, Values<"static,static_dbg,dll,dll_dbg">,
2422   HelpText<"Select Windows run-time library">,
2423   DocBrief<[{
2424 Specify Visual Studio C runtime library. "static" and "static_dbg" correspond
2425 to the cl flags /MT and /MTd which use the multithread, static version. "dll"
2426 and "dll_dbg" correspond to the cl flags /MD and /MDd which use the multithread,
2427 dll version.}]>;
2428 def fms_omit_default_lib : Joined<["-"], "fms-omit-default-lib">,
2429   Group<f_Group>, Flags<[NoXarchOption, CoreOption]>;
2430 defm delayed_template_parsing : BoolFOption<"delayed-template-parsing",
2431   LangOpts<"DelayedTemplateParsing">, DefaultFalse,
2432   PosFlag<SetTrue, [CC1Option], "Parse templated function definitions at the end of the translation unit">,
2433   NegFlag<SetFalse, [NoXarchOption], "Disable delayed template parsing">,
2434   BothFlags<[CoreOption]>>;
2435 def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group<f_Group>, Flags<[CC1Option]>,
2436   Values<"single,multiple,virtual">, NormalizedValuesScope<"LangOptions">,
2437   NormalizedValues<["PPTMK_FullGeneralitySingleInheritance", "PPTMK_FullGeneralityMultipleInheritance",
2438                     "PPTMK_FullGeneralityVirtualInheritance"]>,
2439   MarshallingInfoEnum<LangOpts<"MSPointerToMemberRepresentationMethod">, "PPTMK_BestCase">;
2440 def fms_kernel : Flag<["-"], "fms-kernel">, Group<f_Group>, Flags<[CC1Option, NoDriverOption]>,
2441   MarshallingInfoFlag<LangOpts<"Kernel">>;
2442 // __declspec is enabled by default for the PS4 by the driver, and also
2443 // enabled for Microsoft Extensions or Borland Extensions, here.
2444 //
2445 // FIXME: __declspec is also currently enabled for CUDA, but isn't really a
2446 // CUDA extension. However, it is required for supporting
2447 // __clang_cuda_builtin_vars.h, which uses __declspec(property). Once that has
2448 // been rewritten in terms of something more generic, remove the Opts.CUDA
2449 // term here.
2450 defm declspec : BoolOption<"f", "declspec",
2451   LangOpts<"DeclSpecKeyword">, DefaultFalse,
2452   PosFlag<SetTrue, [], "Allow", [fms_extensions.KeyPath, fborland_extensions.KeyPath, cuda.KeyPath]>,
2453   NegFlag<SetFalse, [], "Disallow">,
2454   BothFlags<[CC1Option], " __declspec as a keyword">>, Group<f_clang_Group>;
2455 def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group<i_Group>,
2456   Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
2457   HelpText<"Specify the module cache path">;
2458 def fmodules_user_build_path : Separate<["-"], "fmodules-user-build-path">, Group<i_Group>,
2459   Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
2460   HelpText<"Specify the module user build path">,
2461   MarshallingInfoString<HeaderSearchOpts<"ModuleUserBuildPath">>;
2462 def fprebuilt_module_path : Joined<["-"], "fprebuilt-module-path=">, Group<i_Group>,
2463   Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
2464   HelpText<"Specify the prebuilt module path">;
2465 defm prebuilt_implicit_modules : BoolFOption<"prebuilt-implicit-modules",
2466   HeaderSearchOpts<"EnablePrebuiltImplicitModules">, DefaultFalse,
2467   PosFlag<SetTrue, [], "Look up implicit modules in the prebuilt module path">,
2468   NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option]>>;
2469
2470 def fmodule_output_EQ : Joined<["-"], "fmodule-output=">, Flags<[NoXarchOption, CC1Option]>,
2471   HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
2472 def fmodule_output : Flag<["-"], "fmodule-output">, Flags<[NoXarchOption, CC1Option]>,
2473   HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
2474
2475 def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>,
2476   Flags<[CC1Option]>, MetaVarName<"<seconds>">,
2477   HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">,
2478   MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneInterval">, "7 * 24 * 60 * 60">;
2479 def fmodules_prune_after : Joined<["-"], "fmodules-prune-after=">, Group<i_Group>,
2480   Flags<[CC1Option]>, MetaVarName<"<seconds>">,
2481   HelpText<"Specify the interval (in seconds) after which a module file will be considered unused">,
2482   MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneAfter">, "31 * 24 * 60 * 60">;
2483 def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">,
2484   Group<i_Group>, Flags<[CC1Option]>, MetaVarName<"<time since Epoch in seconds>">,
2485   HelpText<"Time when the current build session started">,
2486   MarshallingInfoInt<HeaderSearchOpts<"BuildSessionTimestamp">, "0", "uint64_t">;
2487 def fbuild_session_file : Joined<["-"], "fbuild-session-file=">,
2488   Group<i_Group>, MetaVarName<"<file>">,
2489   HelpText<"Use the last modification time of <file> as the build session timestamp">;
2490 def fmodules_validate_once_per_build_session : Flag<["-"], "fmodules-validate-once-per-build-session">,
2491   Group<i_Group>, Flags<[CC1Option]>,
2492   HelpText<"Don't verify input files for the modules if the module has been "
2493            "successfully validated or loaded during this build session">,
2494   MarshallingInfoFlag<HeaderSearchOpts<"ModulesValidateOncePerBuildSession">>;
2495 def fmodules_disable_diagnostic_validation : Flag<["-"], "fmodules-disable-diagnostic-validation">,
2496   Group<i_Group>, Flags<[CC1Option]>,
2497   HelpText<"Disable validation of the diagnostic options when loading the module">,
2498   MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesValidateDiagnosticOptions">>;
2499 defm modules_validate_system_headers : BoolOption<"f", "modules-validate-system-headers",
2500   HeaderSearchOpts<"ModulesValidateSystemHeaders">, DefaultFalse,
2501   PosFlag<SetTrue, [CC1Option], "Validate the system headers that a module depends on when loading the module">,
2502   NegFlag<SetFalse, [NoXarchOption]>>, Group<i_Group>;
2503 def fno_modules_validate_textual_header_includes :
2504   Flag<["-"], "fno-modules-validate-textual-header-includes">,
2505   Group<f_Group>, Flags<[CC1Option, NoXarchOption]>,
2506   MarshallingInfoNegativeFlag<LangOpts<"ModulesValidateTextualHeaderIncludes">>,
2507   HelpText<"Do not enforce -fmodules-decluse and private header restrictions for textual headers. "
2508            "This flag will be removed in a future Clang release.">;
2509
2510 def fincremental_extensions :
2511   Flag<["-"], "fincremental-extensions">,
2512   Group<f_Group>, Flags<[CC1Option]>,
2513   HelpText<"Enable incremental processing extensions such as processing"
2514            "statements on the global scope.">,
2515   MarshallingInfoFlag<LangOpts<"IncrementalExtensions">>;
2516
2517 def fvalidate_ast_input_files_content:
2518   Flag <["-"], "fvalidate-ast-input-files-content">,
2519   Group<f_Group>, Flags<[CC1Option]>,
2520   HelpText<"Compute and store the hash of input files used to build an AST."
2521            " Files with mismatching mtime's are considered valid"
2522            " if both contents is identical">,
2523   MarshallingInfoFlag<HeaderSearchOpts<"ValidateASTInputFilesContent">>;
2524 def fmodules_validate_input_files_content:
2525   Flag <["-"], "fmodules-validate-input-files-content">,
2526   Group<f_Group>, Flags<[NoXarchOption]>,
2527   HelpText<"Validate PCM input files based on content if mtime differs">;
2528 def fno_modules_validate_input_files_content:
2529   Flag <["-"], "fno_modules-validate-input-files-content">,
2530   Group<f_Group>, Flags<[NoXarchOption]>;
2531 def fpch_validate_input_files_content:
2532   Flag <["-"], "fpch-validate-input-files-content">,
2533   Group<f_Group>, Flags<[NoXarchOption]>,
2534   HelpText<"Validate PCH input files based on content if mtime differs">;
2535 def fno_pch_validate_input_files_content:
2536   Flag <["-"], "fno_pch-validate-input-files-content">,
2537   Group<f_Group>, Flags<[NoXarchOption]>;
2538 defm pch_instantiate_templates : BoolFOption<"pch-instantiate-templates",
2539   LangOpts<"PCHInstantiateTemplates">, DefaultFalse,
2540   PosFlag<SetTrue, [], "Instantiate templates already while building a PCH">,
2541   NegFlag<SetFalse>, BothFlags<[CC1Option, CoreOption]>>;
2542 defm pch_codegen: OptInCC1FFlag<"pch-codegen", "Generate ", "Do not generate ",
2543   "code for uses of this PCH that assumes an explicit object file will be built for the PCH">;
2544 defm pch_debuginfo: OptInCC1FFlag<"pch-debuginfo", "Generate ", "Do not generate ",
2545   "debug info for types in an object file built from this PCH and do not generate them elsewhere">;
2546
2547 def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
2548   Flags<[NoXarchOption, CC1Option, CoreOption]>,
2549   HelpText<"Implicitly search the file system for module map files.">,
2550   MarshallingInfoFlag<HeaderSearchOpts<"ImplicitModuleMaps">>;
2551 defm modules : BoolFOption<"modules",
2552   LangOpts<"Modules">, Default<fcxx_modules.KeyPath>,
2553   PosFlag<SetTrue, [CC1Option], "Enable the 'modules' language feature">,
2554   NegFlag<SetFalse>, BothFlags<[NoXarchOption, CoreOption]>>;
2555 def fmodule_maps : Flag <["-"], "fmodule-maps">, Flags<[CoreOption]>, Alias<fimplicit_module_maps>;
2556 def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group<f_Group>,
2557   Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<name>">,
2558   HelpText<"Specify the name of the module to build">,
2559   MarshallingInfoString<LangOpts<"ModuleName">>;
2560 def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">,
2561   Flags<[CC1Option,CoreOption]>, Alias<fmodule_name_EQ>;
2562 def fsystem_module : Flag<["-"], "fsystem-module">, Flags<[CC1Option,CoreOption]>,
2563   HelpText<"Build this module as a system module. Only used with -emit-module">,
2564   MarshallingInfoFlag<FrontendOpts<"IsSystemModule">>;
2565 def fmodule_map_file : Joined<["-"], "fmodule-map-file=">,
2566   Group<f_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<file>">,
2567   HelpText<"Load this module map file">,
2568   MarshallingInfoStringVector<FrontendOpts<"ModuleMapFiles">>;
2569 def fmodule_file : Joined<["-"], "fmodule-file=">,
2570   Group<i_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"[<name>=]<file>">,
2571   HelpText<"Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.">;
2572 def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>,
2573   Flags<[CC1Option,CoreOption]>,
2574   HelpText<"Ignore the definition of the given macro when building and loading modules">;
2575 def fmodules_strict_decluse : Flag <["-"], "fmodules-strict-decluse">, Group<f_Group>,
2576   Flags<[NoXarchOption,CC1Option,CoreOption]>,
2577   HelpText<"Like -fmodules-decluse but requires all headers to be in modules">,
2578   MarshallingInfoFlag<LangOpts<"ModulesStrictDeclUse">>;
2579 defm modules_decluse : BoolFOption<"modules-decluse",
2580   LangOpts<"ModulesDeclUse">, Default<fmodules_strict_decluse.KeyPath>,
2581   PosFlag<SetTrue, [CC1Option], "Require declaration of modules used within a module">,
2582   NegFlag<SetFalse>, BothFlags<[NoXarchOption,CoreOption]>>;
2583 defm modules_search_all : BoolFOption<"modules-search-all",
2584   LangOpts<"ModulesSearchAll">, DefaultFalse,
2585   PosFlag<SetTrue, [], "Search even non-imported modules to resolve references">,
2586   NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option,CoreOption]>>,
2587   ShouldParseIf<fmodules.KeyPath>;
2588 defm implicit_modules : BoolFOption<"implicit-modules",
2589   LangOpts<"ImplicitModules">, DefaultTrue,
2590   NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>, BothFlags<[NoXarchOption,CoreOption]>>;
2591 def fno_modules_check_relocated : Joined<["-"], "fno-modules-check-relocated">,
2592   Group<f_Group>, Flags<[CC1Option]>,
2593   HelpText<"Skip checks for relocated modules when loading PCM files">,
2594   MarshallingInfoNegativeFlag<PreprocessorOpts<"ModulesCheckRelocated">>;
2595 def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group<f_Group>, Flags<[CC1Option]>,
2596   MarshallingInfoFlag<LangOpts<"RetainCommentsFromSystemHeaders">>;
2597 def fmodule_header : Flag <["-"], "fmodule-header">, Group<f_Group>,
2598   Flags<[NoXarchOption]>, HelpText<"Build a C++20 Header Unit from a header.">;
2599 def fmodule_header_EQ : Joined<["-"], "fmodule-header=">, Group<f_Group>,
2600   Flags<[NoXarchOption]>, MetaVarName<"<kind>">,
2601   HelpText<"Build a C++20 Header Unit from a header that should be found in the user (fmodule-header=user) or system (fmodule-header=system) search path.">;
2602
2603 def fno_knr_functions : Flag<["-"], "fno-knr-functions">, Group<f_Group>,
2604   MarshallingInfoFlag<LangOpts<"DisableKNRFunctions">>,
2605   HelpText<"Disable support for K&R C function declarations">,
2606   Flags<[CC1Option, CoreOption]>;
2607
2608 def fmudflapth : Flag<["-"], "fmudflapth">, Group<f_Group>;
2609 def fmudflap : Flag<["-"], "fmudflap">, Group<f_Group>;
2610 def fnested_functions : Flag<["-"], "fnested-functions">, Group<f_Group>;
2611 def fnext_runtime : Flag<["-"], "fnext-runtime">, Group<f_Group>;
2612 def fno_asm : Flag<["-"], "fno-asm">, Group<f_Group>;
2613 def fno_asynchronous_unwind_tables : Flag<["-"], "fno-asynchronous-unwind-tables">, Group<f_Group>;
2614 def fno_assume_sane_operator_new : Flag<["-"], "fno-assume-sane-operator-new">, Group<f_Group>,
2615   HelpText<"Don't assume that C++'s global operator new can't alias any pointer">,
2616   Flags<[CC1Option]>, MarshallingInfoNegativeFlag<CodeGenOpts<"AssumeSaneOperatorNew">>;
2617 def fno_builtin : Flag<["-"], "fno-builtin">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2618   HelpText<"Disable implicit builtin knowledge of functions">;
2619 def fno_builtin_ : Joined<["-"], "fno-builtin-">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2620   HelpText<"Disable implicit builtin knowledge of a specific function">;
2621 def fno_common : Flag<["-"], "fno-common">, Group<f_Group>, Flags<[CC1Option]>,
2622     HelpText<"Compile common globals like normal definitions">;
2623 defm digraphs : BoolFOption<"digraphs",
2624   LangOpts<"Digraphs">, Default<std#".hasDigraphs()">,
2625   PosFlag<SetTrue, [], "Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)">,
2626   NegFlag<SetFalse, [], "Disallow alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:'">,
2627   BothFlags<[CC1Option]>>;
2628 def fno_eliminate_unused_debug_symbols : Flag<["-"], "fno-eliminate-unused-debug-symbols">, Group<f_Group>;
2629 def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>;
2630 def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>, Flags<[CC1Option]>;
2631 def fno_global_isel : Flag<["-"], "fno-global-isel">, Group<f_clang_Group>,
2632   HelpText<"Disables the global instruction selector">;
2633 def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_Group>,
2634   Alias<fno_global_isel>;
2635 def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>, Flags<[CC1Option]>,
2636     HelpText<"Use the given vector functions library">,
2637     Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,none">,
2638     NormalizedValuesScope<"CodeGenOptions">,
2639     NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML", "SLEEF",
2640                       "Darwin_libsystem_m", "ArmPL", "NoLibrary"]>,
2641     MarshallingInfoEnum<CodeGenOpts<"VecLib">, "NoLibrary">;
2642 def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group<f_Group>,
2643   Alias<flax_vector_conversions_EQ>, AliasArgs<["none"]>;
2644 def fno_implicit_module_maps : Flag <["-"], "fno-implicit-module-maps">, Group<f_Group>,
2645   Flags<[NoXarchOption]>;
2646 def fno_module_maps : Flag <["-"], "fno-module-maps">, Alias<fno_implicit_module_maps>;
2647 def fno_modules_strict_decluse : Flag <["-"], "fno-strict-modules-decluse">, Group<f_Group>,
2648   Flags<[NoXarchOption]>;
2649 def fmodule_file_deps : Flag <["-"], "fmodule-file-deps">, Group<f_Group>,
2650   Flags<[NoXarchOption]>;
2651 def fno_module_file_deps : Flag <["-"], "fno-module-file-deps">, Group<f_Group>,
2652   Flags<[NoXarchOption]>;
2653 def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group<f_Group>,
2654   Flags<[CoreOption]>;
2655 def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group<f_Group>,
2656   Flags<[CoreOption]>;
2657 def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group<f_Group>;
2658 def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>, Flags<[CC1Option]>;
2659 def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>;
2660 defm operator_names : BoolFOption<"operator-names",
2661   LangOpts<"CXXOperatorNames">, Default<cplusplus.KeyPath>,
2662   NegFlag<SetFalse, [CC1Option], "Do not treat C++ operator name keywords as synonyms for operators">,
2663   PosFlag<SetTrue>>;
2664 def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group<f_Group>,
2665   Flags<[CC1Option, CoreOption]>, HelpText<"Print absolute paths in diagnostics">,
2666   MarshallingInfoFlag<DiagnosticOpts<"AbsolutePath">>;
2667 defm diagnostics_show_line_numbers : BoolFOption<"diagnostics-show-line-numbers",
2668   DiagnosticOpts<"ShowLineNumbers">, DefaultTrue,
2669   NegFlag<SetFalse, [CC1Option], "Show line numbers in diagnostic code snippets">,
2670   PosFlag<SetTrue>>;
2671 def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>,
2672   HelpText<"Disable the use of stack protectors">;
2673 def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>,
2674   Flags<[NoXarchOption, CoreOption]>;
2675 def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>;
2676 def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group<f_Group>;
2677 def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
2678 def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>;
2679 def fno_temp_file : Flag<["-"], "fno-temp-file">, Group<f_Group>,
2680   Flags<[CC1Option, CoreOption]>, HelpText<
2681   "Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes">,
2682   MarshallingInfoNegativeFlag<FrontendOpts<"UseTemporary">>;
2683 defm use_cxa_atexit : BoolFOption<"use-cxa-atexit",
2684   CodeGenOpts<"CXAAtExit">, DefaultTrue,
2685   NegFlag<SetFalse, [CC1Option], "Don't use __cxa_atexit for calling destructors">,
2686   PosFlag<SetTrue>>;
2687 def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>;
2688 def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>, Flags<[CC1Option]>,
2689   MarshallingInfoNegativeFlag<CodeGenOpts<"AsmVerbose">>;
2690 def fno_working_directory : Flag<["-"], "fno-working-directory">, Group<f_Group>;
2691 def fno_wrapv : Flag<["-"], "fno-wrapv">, Group<f_Group>;
2692 def fobjc_arc : Flag<["-"], "fobjc-arc">, Group<f_Group>, Flags<[CC1Option]>,
2693   HelpText<"Synthesize retain and release calls for Objective-C pointers">;
2694 def fno_objc_arc : Flag<["-"], "fno-objc-arc">, Group<f_Group>;
2695 defm objc_encode_cxx_class_template_spec : BoolFOption<"objc-encode-cxx-class-template-spec",
2696   LangOpts<"EncodeCXXClassTemplateSpec">, DefaultFalse,
2697   PosFlag<SetTrue, [CC1Option], "Fully encode c++ class template specialization">,
2698   NegFlag<SetFalse>>;
2699 defm objc_convert_messages_to_runtime_calls : BoolFOption<"objc-convert-messages-to-runtime-calls",
2700   CodeGenOpts<"ObjCConvertMessagesToRuntimeCalls">, DefaultTrue,
2701   NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>>;
2702 defm objc_arc_exceptions : BoolFOption<"objc-arc-exceptions",
2703   CodeGenOpts<"ObjCAutoRefCountExceptions">, DefaultFalse,
2704   PosFlag<SetTrue, [CC1Option], "Use EH-safe code when synthesizing retains and releases in -fobjc-arc">,
2705   NegFlag<SetFalse>>;
2706 def fobjc_atdefs : Flag<["-"], "fobjc-atdefs">, Group<clang_ignored_f_Group>;
2707 def fobjc_call_cxx_cdtors : Flag<["-"], "fobjc-call-cxx-cdtors">, Group<clang_ignored_f_Group>;
2708 defm objc_exceptions : BoolFOption<"objc-exceptions",
2709   LangOpts<"ObjCExceptions">, DefaultFalse,
2710   PosFlag<SetTrue, [CC1Option], "Enable Objective-C exceptions">, NegFlag<SetFalse>>;
2711 defm application_extension : BoolFOption<"application-extension",
2712   LangOpts<"AppExt">, DefaultFalse,
2713   PosFlag<SetTrue, [CC1Option], "Restrict code to those available for App Extensions">,
2714   NegFlag<SetFalse>>;
2715 defm relaxed_template_template_args : BoolFOption<"relaxed-template-template-args",
2716   LangOpts<"RelaxedTemplateTemplateArgs">, DefaultFalse,
2717   PosFlag<SetTrue, [CC1Option], "Enable C++17 relaxed template template argument matching">,
2718   NegFlag<SetFalse>>;
2719 defm sized_deallocation : BoolFOption<"sized-deallocation",
2720   LangOpts<"SizedDeallocation">, DefaultFalse,
2721   PosFlag<SetTrue, [CC1Option], "Enable C++14 sized global deallocation functions">,
2722   NegFlag<SetFalse>>;
2723 defm aligned_allocation : BoolFOption<"aligned-allocation",
2724   LangOpts<"AlignedAllocation">, Default<cpp17.KeyPath>,
2725   PosFlag<SetTrue, [], "Enable C++17 aligned allocation functions">,
2726   NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
2727 def fnew_alignment_EQ : Joined<["-"], "fnew-alignment=">,
2728   HelpText<"Specifies the largest alignment guaranteed by '::operator new(size_t)'">,
2729   MetaVarName<"<align>">, Group<f_Group>, Flags<[CC1Option]>,
2730   MarshallingInfoInt<LangOpts<"NewAlignOverride">>;
2731 def : Separate<["-"], "fnew-alignment">, Alias<fnew_alignment_EQ>;
2732 def : Flag<["-"], "faligned-new">, Alias<faligned_allocation>;
2733 def : Flag<["-"], "fno-aligned-new">, Alias<fno_aligned_allocation>;
2734 def faligned_new_EQ : Joined<["-"], "faligned-new=">;
2735
2736 def fobjc_legacy_dispatch : Flag<["-"], "fobjc-legacy-dispatch">, Group<f_Group>;
2737 def fobjc_new_property : Flag<["-"], "fobjc-new-property">, Group<clang_ignored_f_Group>;
2738 defm objc_infer_related_result_type : BoolFOption<"objc-infer-related-result-type",
2739   LangOpts<"ObjCInferRelatedResultType">, DefaultTrue,
2740   NegFlag<SetFalse, [CC1Option], "do not infer Objective-C related result type based on method family">,
2741   PosFlag<SetTrue>>;
2742 def fobjc_link_runtime: Flag<["-"], "fobjc-link-runtime">, Group<f_Group>;
2743 def fobjc_weak : Flag<["-"], "fobjc-weak">, Group<f_Group>, Flags<[CC1Option]>,
2744   HelpText<"Enable ARC-style weak references in Objective-C">;
2745
2746 // Objective-C ABI options.
2747 def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2748   HelpText<"Specify the target Objective-C runtime kind and version">;
2749 def fobjc_abi_version_EQ : Joined<["-"], "fobjc-abi-version=">, Group<f_Group>;
2750 def fobjc_nonfragile_abi_version_EQ : Joined<["-"], "fobjc-nonfragile-abi-version=">, Group<f_Group>;
2751 def fobjc_nonfragile_abi : Flag<["-"], "fobjc-nonfragile-abi">, Group<f_Group>;
2752 def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Group>;
2753
2754 def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>;
2755 def fobjc_disable_direct_methods_for_testing :
2756   Flag<["-"], "fobjc-disable-direct-methods-for-testing">,
2757   Group<f_Group>, Flags<[CC1Option]>,
2758   HelpText<"Ignore attribute objc_direct so that direct methods can be tested">,
2759   MarshallingInfoFlag<LangOpts<"ObjCDisableDirectMethodsForTesting">>;
2760 defm objc_avoid_heapify_local_blocks : BoolFOption<"objc-avoid-heapify-local-blocks",
2761   CodeGenOpts<"ObjCAvoidHeapifyLocalBlocks">, DefaultFalse,
2762   PosFlag<SetTrue, [], "Try">,
2763   NegFlag<SetFalse, [], "Don't try">,
2764   BothFlags<[CC1Option, NoDriverOption], " to avoid heapifying local blocks">>;
2765
2766 def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>,
2767   HelpText<"Omit the frame pointer from functions that don't need it. "
2768   "Some stack unwinding cases, such as profilers and sanitizers, may prefer specifying -fno-omit-frame-pointer. "
2769   "On many targets, -O1 and higher omit the frame pointer by default. "
2770   "-m[no-]omit-leaf-frame-pointer takes precedence for leaf functions">;
2771 def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, FlangOption, FC1Option]>,
2772   HelpText<"Parse OpenMP pragmas and generate parallel code.">;
2773 def fno_openmp : Flag<["-"], "fno-openmp">, Group<f_Group>, Flags<[NoArgumentUnused]>;
2774 def fopenmp_version_EQ : Joined<["-"], "fopenmp-version=">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, FlangOption, FC1Option]>,
2775   HelpText<"Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang">;
2776 defm openmp_extensions: BoolFOption<"openmp-extensions",
2777   LangOpts<"OpenMPExtensions">, DefaultTrue,
2778   PosFlag<SetTrue, [CC1Option, NoArgumentUnused],
2779           "Enable all Clang extensions for OpenMP directives and clauses">,
2780   NegFlag<SetFalse, [CC1Option, NoArgumentUnused],
2781           "Disable all Clang extensions for OpenMP directives and clauses">>;
2782 def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group<f_Group>;
2783 def fopenmp_use_tls : Flag<["-"], "fopenmp-use-tls">, Group<f_Group>,
2784   Flags<[NoArgumentUnused, HelpHidden]>;
2785 def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group<f_Group>,
2786   Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2787 def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">, Flags<[NoXarchOption, CC1Option]>,
2788   HelpText<"Specify comma-separated list of triples OpenMP offloading targets to be supported">;
2789 def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">,
2790   Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2791 def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">,
2792   Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2793 def fopenmp_simd : Flag<["-"], "fopenmp-simd">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>,
2794   HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
2795 def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2796   HelpText<"Use the experimental OpenMP-IR-Builder codegen path.">;
2797 def fno_openmp_simd : Flag<["-"], "fno-openmp-simd">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>;
2798 def fopenmp_cuda_mode : Flag<["-"], "fopenmp-cuda-mode">, Group<f_Group>,
2799   Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2800 def fno_openmp_cuda_mode : Flag<["-"], "fno-openmp-cuda-mode">, Group<f_Group>,
2801   Flags<[NoArgumentUnused, HelpHidden]>;
2802 def fopenmp_cuda_number_of_sm_EQ : Joined<["-"], "fopenmp-cuda-number-of-sm=">, Group<f_Group>,
2803   Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2804 def fopenmp_cuda_blocks_per_sm_EQ : Joined<["-"], "fopenmp-cuda-blocks-per-sm=">, Group<f_Group>,
2805   Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2806 def fopenmp_cuda_teams_reduction_recs_num_EQ : Joined<["-"], "fopenmp-cuda-teams-reduction-recs-num=">, Group<f_Group>,
2807   Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2808
2809 //===----------------------------------------------------------------------===//
2810 // Shared cc1 + fc1 OpenMP Target Options
2811 //===----------------------------------------------------------------------===//
2812
2813 let Flags = [CC1Option, FC1Option, NoArgumentUnused] in {
2814 let Group = f_Group in {
2815
2816 def fopenmp_target_debug : Flag<["-"], "fopenmp-target-debug">,
2817   HelpText<"Enable debugging in the OpenMP offloading device RTL">;
2818 def fno_openmp_target_debug : Flag<["-"], "fno-openmp-target-debug">;
2819
2820 } // let Group = f_Group
2821 } // let Flags = [CC1Option, FC1Option, NoArgumentUnused]
2822
2823 let Flags = [CC1Option, FC1Option, NoArgumentUnused, HelpHidden] in {
2824 let Group = f_Group in {
2825
2826 def fopenmp_target_debug_EQ : Joined<["-"], "fopenmp-target-debug=">;
2827 def fopenmp_assume_teams_oversubscription : Flag<["-"], "fopenmp-assume-teams-oversubscription">;
2828 def fopenmp_assume_threads_oversubscription : Flag<["-"], "fopenmp-assume-threads-oversubscription">;
2829 def fno_openmp_assume_teams_oversubscription : Flag<["-"], "fno-openmp-assume-teams-oversubscription">;
2830 def fno_openmp_assume_threads_oversubscription : Flag<["-"], "fno-openmp-assume-threads-oversubscription">;
2831 def fopenmp_assume_no_thread_state : Flag<["-"], "fopenmp-assume-no-thread-state">,
2832   HelpText<"Assert no thread in a parallel region modifies an ICV">,
2833   MarshallingInfoFlag<LangOpts<"OpenMPNoThreadState">>;
2834 def fopenmp_assume_no_nested_parallelism : Flag<["-"], "fopenmp-assume-no-nested-parallelism">,
2835   HelpText<"Assert no nested parallel regions in the GPU">,
2836   MarshallingInfoFlag<LangOpts<"OpenMPNoNestedParallelism">>;
2837
2838 } // let Group = f_Group
2839 } // let Flags = [CC1Option, FC1Option, NoArgumentUnused, HelpHidden]
2840
2841 def fopenmp_offload_mandatory : Flag<["-"], "fopenmp-offload-mandatory">, Group<f_Group>,
2842   Flags<[CC1Option, NoArgumentUnused]>,
2843   HelpText<"Do not create a host fallback if offloading to the device fails.">,
2844   MarshallingInfoFlag<LangOpts<"OpenMPOffloadMandatory">>;
2845 def fopenmp_target_jit : Flag<["-"], "fopenmp-target-jit">, Group<f_Group>,
2846   Flags<[CoreOption, NoArgumentUnused]>,
2847   HelpText<"Emit code that can be JIT compiled for OpenMP offloading. Implies -foffload-lto=full">;
2848 def fno_openmp_target_jit : Flag<["-"], "fno-openmp-target-jit">, Group<f_Group>,
2849   Flags<[CoreOption, NoArgumentUnused, HelpHidden]>;
2850 def fopenmp_target_new_runtime : Flag<["-"], "fopenmp-target-new-runtime">,
2851   Group<f_Group>, Flags<[CC1Option, HelpHidden]>;
2852 def fno_openmp_target_new_runtime : Flag<["-"], "fno-openmp-target-new-runtime">,
2853   Group<f_Group>, Flags<[CC1Option, HelpHidden]>;
2854 defm openmp_optimistic_collapse : BoolFOption<"openmp-optimistic-collapse",
2855   LangOpts<"OpenMPOptimisticCollapse">, DefaultFalse,
2856   PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>, BothFlags<[NoArgumentUnused, HelpHidden]>>;
2857 def static_openmp: Flag<["-"], "static-openmp">,
2858   HelpText<"Use the static host OpenMP runtime while linking.">;
2859 def offload_new_driver : Flag<["--"], "offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
2860   MarshallingInfoFlag<LangOpts<"OffloadingNewDriver">>, HelpText<"Use the new driver for offloading compilation.">;
2861 def no_offload_new_driver : Flag<["--"], "no-offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
2862   HelpText<"Don't Use the new driver for offloading compilation.">;
2863 def offload_device_only : Flag<["--"], "offload-device-only">, Flags<[FlangOption]>,
2864   HelpText<"Only compile for the offloading device.">;
2865 def offload_host_only : Flag<["--"], "offload-host-only">, Flags<[FlangOption]>,
2866   HelpText<"Only compile for the offloading host.">;
2867 def offload_host_device : Flag<["--"], "offload-host-device">, Flags<[FlangOption]>,
2868   HelpText<"Only compile for the offloading host.">;
2869 def cuda_device_only : Flag<["--"], "cuda-device-only">, Alias<offload_device_only>,
2870   HelpText<"Compile CUDA code for device only">;
2871 def cuda_host_only : Flag<["--"], "cuda-host-only">, Alias<offload_host_only>,
2872   HelpText<"Compile CUDA code for host only. Has no effect on non-CUDA compilations.">;
2873 def cuda_compile_host_device : Flag<["--"], "cuda-compile-host-device">, Alias<offload_host_device>,
2874   HelpText<"Compile CUDA code for both host and device (default). Has no "
2875            "effect on non-CUDA compilations.">;
2876 def fopenmp_new_driver : Flag<["-"], "fopenmp-new-driver">, Flags<[HelpHidden]>,
2877   HelpText<"Use the new driver for OpenMP offloading.">;
2878 def fno_openmp_new_driver : Flag<["-"], "fno-openmp-new-driver">, Flags<[HelpHidden]>,
2879   HelpText<"Don't use the new driver for OpenMP offloading.">;
2880 def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>, Flags<[CC1Option]>,
2881   HelpText<"Disable tail call optimization, keeping the call stack accurate">,
2882   MarshallingInfoFlag<CodeGenOpts<"DisableTailCalls">>;
2883 def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group<f_Group>;
2884 defm escaping_block_tail_calls : BoolFOption<"escaping-block-tail-calls",
2885   CodeGenOpts<"NoEscapingBlockTailCalls">, DefaultFalse,
2886   NegFlag<SetTrue, [CC1Option]>, PosFlag<SetFalse>>;
2887 def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">;
2888 def force__flat__namespace : Flag<["-"], "force_flat_namespace">;
2889 def force__load : Separate<["-"], "force_load">;
2890 def force_addr : Joined<["-"], "fforce-addr">, Group<clang_ignored_f_Group>;
2891 def foutput_class_dir_EQ : Joined<["-"], "foutput-class-dir=">, Group<f_Group>;
2892 def fpack_struct : Flag<["-"], "fpack-struct">, Group<f_Group>;
2893 def fno_pack_struct : Flag<["-"], "fno-pack-struct">, Group<f_Group>;
2894 def fpack_struct_EQ : Joined<["-"], "fpack-struct=">, Group<f_Group>, Flags<[CC1Option]>,
2895   HelpText<"Specify the default maximum struct packing alignment">,
2896   MarshallingInfoInt<LangOpts<"PackStruct">>;
2897 def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group<f_Group>, Flags<[CC1Option]>,
2898   HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">,
2899   MarshallingInfoInt<LangOpts<"MaxTypeAlign">>;
2900 def fno_max_type_align : Flag<["-"], "fno-max-type-align">, Group<f_Group>;
2901 defm pascal_strings : BoolFOption<"pascal-strings",
2902   LangOpts<"PascalStrings">, DefaultFalse,
2903   PosFlag<SetTrue, [CC1Option], "Recognize and construct Pascal-style string literals">,
2904   NegFlag<SetFalse>>;
2905 // Note: This flag has different semantics in the driver and in -cc1. The driver accepts -fpatchable-function-entry=M,N
2906 // and forwards it to -cc1 as -fpatchable-function-entry=M and -fpatchable-function-entry-offset=N. In -cc1, both flags
2907 // are treated as a single integer.
2908 def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group<f_Group>, Flags<[CC1Option]>,
2909   MetaVarName<"<N,M>">, HelpText<"Generate M NOPs before function entry and N-M NOPs after function entry">,
2910   MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryCount">>;
2911 def fms_hotpatch : Flag<["-"], "fms-hotpatch">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2912   HelpText<"Ensure that all functions can be hotpatched at runtime">,
2913   MarshallingInfoFlag<CodeGenOpts<"HotPatch">>;
2914 def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
2915   HelpText<"Override the default ABI to return all structs on the stack">;
2916 def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group<f_Group>;
2917 def fpic : Flag<["-"], "fpic">, Group<f_Group>;
2918 def fno_pic : Flag<["-"], "fno-pic">, Group<f_Group>;
2919 def fpie : Flag<["-"], "fpie">, Group<f_Group>;
2920 def fno_pie : Flag<["-"], "fno-pie">, Group<f_Group>;
2921 defm pic_data_is_text_relative : SimpleMFlag<"pic-data-is-text-relative",
2922      "Assume", "Don't assume", " data segments are relative to text segment">;
2923 def fdirect_access_external_data : Flag<["-"], "fdirect-access-external-data">, Group<f_Group>, Flags<[CC1Option]>,
2924   HelpText<"Don't use GOT indirection to reference external data symbols">;
2925 def fno_direct_access_external_data : Flag<["-"], "fno-direct-access-external-data">, Group<f_Group>, Flags<[CC1Option]>,
2926   HelpText<"Use GOT indirection to reference external data symbols">;
2927 defm plt : BoolFOption<"plt",
2928   CodeGenOpts<"NoPLT">, DefaultFalse,
2929   NegFlag<SetTrue, [CC1Option], "Use GOT indirection instead of PLT to make external function calls (x86 only)">,
2930   PosFlag<SetFalse>>;
2931 defm ropi : BoolFOption<"ropi",
2932   LangOpts<"ROPI">, DefaultFalse,
2933   PosFlag<SetTrue, [CC1Option], "Generate read-only position independent code (ARM only)">,
2934   NegFlag<SetFalse>>;
2935 defm rwpi : BoolFOption<"rwpi",
2936   LangOpts<"RWPI">, DefaultFalse,
2937   PosFlag<SetTrue, [CC1Option], "Generate read-write position independent code (ARM only)">,
2938   NegFlag<SetFalse>>;
2939 def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>, Flags<[NoXarchOption]>, MetaVarName<"<dsopath>">,
2940   HelpText<"Load the named plugin (dynamic shared object)">;
2941 def fplugin_arg : Joined<["-"], "fplugin-arg-">,
2942   MetaVarName<"<name>-<arg>">,
2943   HelpText<"Pass <arg> to plugin <name>">;
2944 def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">,
2945   Group<f_Group>, Flags<[CC1Option,FlangOption,FC1Option]>, MetaVarName<"<dsopath>">,
2946   HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">,
2947   MarshallingInfoStringVector<CodeGenOpts<"PassPlugins">>;
2948 defm preserve_as_comments : BoolFOption<"preserve-as-comments",
2949   CodeGenOpts<"PreserveAsmComments">, DefaultTrue,
2950   NegFlag<SetFalse, [CC1Option], "Do not preserve comments in inline assembly">,
2951   PosFlag<SetTrue>>;
2952 def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
2953 def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<clang_ignored_f_Group>;
2954 def freg_struct_return : Flag<["-"], "freg-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
2955   HelpText<"Override the default ABI to return small structs in registers">;
2956 defm rtti : BoolFOption<"rtti",
2957   LangOpts<"RTTI">, Default<cplusplus.KeyPath>,
2958   NegFlag<SetFalse, [CC1Option], "Disable generation of rtti information">,
2959   PosFlag<SetTrue>>, ShouldParseIf<cplusplus.KeyPath>;
2960 defm rtti_data : BoolFOption<"rtti-data",
2961   LangOpts<"RTTIData">, Default<frtti.KeyPath>,
2962   NegFlag<SetFalse, [CC1Option], "Disable generation of RTTI data">,
2963   PosFlag<SetTrue>>, ShouldParseIf<frtti.KeyPath>;
2964 def : Flag<["-"], "fsched-interblock">, Group<clang_ignored_f_Group>;
2965 defm short_enums : BoolFOption<"short-enums",
2966   LangOpts<"ShortEnums">, DefaultFalse,
2967   PosFlag<SetTrue, [CC1Option], "Allocate to an enum type only as many bytes as it"
2968            " needs for the declared range of possible values">,
2969   NegFlag<SetFalse>>;
2970 defm char8__t : BoolFOption<"char8_t",
2971   LangOpts<"Char8">, Default<cpp20.KeyPath>,
2972   PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
2973   BothFlags<[CC1Option], " C++ builtin type char8_t">>;
2974 def fshort_wchar : Flag<["-"], "fshort-wchar">, Group<f_Group>,
2975   HelpText<"Force wchar_t to be a short unsigned int">;
2976 def fno_short_wchar : Flag<["-"], "fno-short-wchar">, Group<f_Group>,
2977   HelpText<"Force wchar_t to be an unsigned int">;
2978 def fshow_overloads_EQ : Joined<["-"], "fshow-overloads=">, Group<f_Group>, Flags<[CC1Option]>,
2979   HelpText<"Which overload candidates to show when overload resolution fails. Defaults to 'all'">,
2980   Values<"best,all">,
2981   NormalizedValues<["Ovl_Best", "Ovl_All"]>,
2982   MarshallingInfoEnum<DiagnosticOpts<"ShowOverloads">, "Ovl_All">;
2983 defm show_column : BoolFOption<"show-column",
2984   DiagnosticOpts<"ShowColumn">, DefaultTrue,
2985   NegFlag<SetFalse, [CC1Option], "Do not include column number on diagnostics">,
2986   PosFlag<SetTrue>>;
2987 defm show_source_location : BoolFOption<"show-source-location",
2988   DiagnosticOpts<"ShowLocation">, DefaultTrue,
2989   NegFlag<SetFalse, [CC1Option], "Do not include source location information with diagnostics">,
2990   PosFlag<SetTrue>>;
2991 defm spell_checking : BoolFOption<"spell-checking",
2992   LangOpts<"SpellChecking">, DefaultTrue,
2993   NegFlag<SetFalse, [CC1Option], "Disable spell-checking">, PosFlag<SetTrue>>;
2994 def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<f_Group>, Flags<[CC1Option]>,
2995   HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit)">,
2996   MarshallingInfoInt<DiagnosticOpts<"SpellCheckingLimit">, "DiagnosticOptions::DefaultSpellCheckingLimit">;
2997 def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group<f_Group>;
2998 defm signed_char : BoolFOption<"signed-char",
2999   LangOpts<"CharIsSigned">, DefaultTrue,
3000   NegFlag<SetFalse, [CC1Option], "char is unsigned">, PosFlag<SetTrue, [], "char is signed">>,
3001   ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
3002 defm split_stack : BoolFOption<"split-stack",
3003   CodeGenOpts<"EnableSegmentedStacks">, DefaultFalse,
3004   NegFlag<SetFalse, [], "Wouldn't use segmented stack">,
3005   PosFlag<SetTrue, [CC1Option], "Use segmented stack">>;
3006 def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
3007   HelpText<"Enable stack protectors for all functions">;
3008 defm stack_clash_protection : BoolFOption<"stack-clash-protection",
3009   CodeGenOpts<"StackClashProtector">, DefaultFalse,
3010   PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
3011   BothFlags<[], " stack clash protection">>,
3012   DocBrief<"Instrument stack allocation to prevent stack clash attacks">;
3013 def fstack_protector_strong : Flag<["-"], "fstack-protector-strong">, Group<f_Group>,
3014   HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. "
3015            "Compared to -fstack-protector, this uses a stronger heuristic "
3016            "that includes functions containing arrays of any size (and any type), "
3017            "as well as any calls to alloca or the taking of an address from a local variable">;
3018 def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
3019   HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. "
3020            "This uses a loose heuristic which considers functions vulnerable if they "
3021            "contain a char (or 8bit integer) array or constant sized calls to alloca "
3022            ", which are of greater size than ssp-buffer-size (default: 8 bytes). All "
3023            "variable sized calls to alloca are considered vulnerable. A function with "
3024            "a stack protector has a guard value added to the stack frame that is "
3025            "checked on function exit. The guard value must be positioned in the "
3026            "stack frame such that a buffer overflow from a vulnerable variable will "
3027            "overwrite the guard value before overwriting the function's return "
3028            "address. The reference stack guard value is stored in a global variable.">;
3029 def ftrivial_auto_var_init : Joined<["-"], "ftrivial-auto-var-init=">, Group<f_Group>,
3030   Flags<[CC1Option, CoreOption]>, HelpText<"Initialize trivial automatic stack variables. Defaults to 'uninitialized'">,
3031   Values<"uninitialized,zero,pattern">,
3032   NormalizedValuesScope<"LangOptions::TrivialAutoVarInitKind">,
3033   NormalizedValues<["Uninitialized", "Zero", "Pattern"]>,
3034   MarshallingInfoEnum<LangOpts<"TrivialAutoVarInit">, "Uninitialized">;
3035 def ftrivial_auto_var_init_stop_after : Joined<["-"], "ftrivial-auto-var-init-stop-after=">, Group<f_Group>,
3036   Flags<[CC1Option, CoreOption]>, HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
3037   MarshallingInfoInt<LangOpts<"TrivialAutoVarInitStopAfter">>;
3038 def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
3039   HelpText<"Emit full debug info for all types used by the program">;
3040 def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
3041   HelpText<"Limit debug information produced to reduce size of debug binary">;
3042 def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Flags<[CoreOption]>, Alias<fno_standalone_debug>;
3043 def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Flags<[CoreOption]>, Alias<fstandalone_debug>;
3044 def fdebug_macro : Flag<["-"], "fdebug-macro">, Group<f_Group>, Flags<[CoreOption]>,
3045   HelpText<"Emit macro debug information">;
3046 def fno_debug_macro : Flag<["-"], "fno-debug-macro">, Group<f_Group>, Flags<[CoreOption]>,
3047   HelpText<"Do not emit macro debug information">;
3048 def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group<f_Group>,
3049   Flags<[NoXarchOption, CoreOption]>;
3050 def fstrict_enums : Flag<["-"], "fstrict-enums">, Group<f_Group>, Flags<[CC1Option]>,
3051   HelpText<"Enable optimizations based on the strict definition of an enum's "
3052            "value range">,
3053   MarshallingInfoFlag<CodeGenOpts<"StrictEnums">>;
3054 defm strict_vtable_pointers : BoolFOption<"strict-vtable-pointers",
3055   CodeGenOpts<"StrictVTablePointers">, DefaultFalse,
3056   PosFlag<SetTrue, [CC1Option], "Enable optimizations based on the strict rules for"
3057             " overwriting polymorphic C++ objects">,
3058   NegFlag<SetFalse>>;
3059 def fstrict_overflow : Flag<["-"], "fstrict-overflow">, Group<f_Group>;
3060 def fdriver_only : Flag<["-"], "fdriver-only">, Flags<[NoXarchOption, CoreOption]>,
3061   Group<Action_Group>, HelpText<"Only run the driver.">;
3062 def fsyntax_only : Flag<["-"], "fsyntax-only">,
3063   Flags<[NoXarchOption,CoreOption,CC1Option,FC1Option,FlangOption]>, Group<Action_Group>,
3064   HelpText<"Run the preprocessor, parser and semantic analysis stages">;
3065 def ftabstop_EQ : Joined<["-"], "ftabstop=">, Group<f_Group>;
3066 def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group<f_Group>, Flags<[CC1Option]>,
3067   HelpText<"Set the maximum depth of recursive template instantiation">,
3068   MarshallingInfoInt<LangOpts<"InstantiationDepth">, "1024">;
3069 def : Joined<["-"], "ftemplate-depth-">, Group<f_Group>, Alias<ftemplate_depth_EQ>;
3070 def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">, Group<f_Group>, Flags<[CC1Option]>,
3071   HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit)">,
3072   MarshallingInfoInt<DiagnosticOpts<"TemplateBacktraceLimit">, "DiagnosticOptions::DefaultTemplateBacktraceLimit">;
3073 def foperator_arrow_depth_EQ : Joined<["-"], "foperator-arrow-depth=">, Group<f_Group>, Flags<[CC1Option]>,
3074   HelpText<"Maximum number of 'operator->'s to call for a member access">,
3075   MarshallingInfoInt<LangOpts<"ArrowDepth">, "256">;
3076
3077 def fsave_optimization_record : Flag<["-"], "fsave-optimization-record">,
3078   Group<f_Group>, HelpText<"Generate a YAML optimization record file">;
3079 def fsave_optimization_record_EQ : Joined<["-"], "fsave-optimization-record=">,
3080   Group<f_Group>, HelpText<"Generate an optimization record file in a specific format">,
3081   MetaVarName<"<format>">;
3082 def fno_save_optimization_record : Flag<["-"], "fno-save-optimization-record">,
3083   Group<f_Group>, Flags<[NoArgumentUnused]>;
3084 def foptimization_record_file_EQ : Joined<["-"], "foptimization-record-file=">,
3085   Group<f_Group>,
3086   HelpText<"Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch <arch> options.">,
3087   MetaVarName<"<file>">;
3088 def foptimization_record_passes_EQ : Joined<["-"], "foptimization-record-passes=">,
3089   Group<f_Group>,
3090   HelpText<"Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)">,
3091   MetaVarName<"<regex>">;
3092
3093 def fvectorize : Flag<["-"], "fvectorize">, Group<f_Group>,
3094   HelpText<"Enable the loop vectorization passes">;
3095 def fno_vectorize : Flag<["-"], "fno-vectorize">, Group<f_Group>;
3096 def : Flag<["-"], "ftree-vectorize">, Alias<fvectorize>;
3097 def : Flag<["-"], "fno-tree-vectorize">, Alias<fno_vectorize>;
3098 def fslp_vectorize : Flag<["-"], "fslp-vectorize">, Group<f_Group>,
3099   HelpText<"Enable the superword-level parallelism vectorization passes">;
3100 def fno_slp_vectorize : Flag<["-"], "fno-slp-vectorize">, Group<f_Group>;
3101 def : Flag<["-"], "ftree-slp-vectorize">, Alias<fslp_vectorize>;
3102 def : Flag<["-"], "fno-tree-slp-vectorize">, Alias<fno_slp_vectorize>;
3103 def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">,
3104   HelpText<"Warn if a function definition returns or accepts an object larger "
3105            "in bytes than a given value">, Flags<[HelpHidden]>;
3106 def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">, Flags<[CC1Option]>,
3107   MarshallingInfoInt<LangOpts<"NumLargeByValueCopy">>;
3108
3109 // These "special" warning flags are effectively processed as f_Group flags by the driver:
3110 // Just silence warnings about -Wlarger-than for now.
3111 def Wlarger_than_EQ : Joined<["-"], "Wlarger-than=">, Group<clang_ignored_f_Group>;
3112 def Wlarger_than_ : Joined<["-"], "Wlarger-than-">, Alias<Wlarger_than_EQ>;
3113
3114 // This is converted to -fwarn-stack-size=N and also passed through by the driver.
3115 // FIXME: The driver should strip out the =<value> when passing W_value_Group through.
3116 def Wframe_larger_than_EQ : Joined<["-"], "Wframe-larger-than=">, Group<W_value_Group>,
3117                             Flags<[NoXarchOption, CC1Option]>;
3118 def Wframe_larger_than : Flag<["-"], "Wframe-larger-than">, Alias<Wframe_larger_than_EQ>;
3119
3120 def : Flag<["-"], "fterminated-vtables">, Alias<fapple_kext>;
3121 defm threadsafe_statics : BoolFOption<"threadsafe-statics",
3122   LangOpts<"ThreadsafeStatics">, DefaultTrue,
3123   NegFlag<SetFalse, [CC1Option], "Do not emit code to make initialization of local statics thread safe">,
3124   PosFlag<SetTrue>>;
3125 def ftime_report : Flag<["-"], "ftime-report">, Group<f_Group>, Flags<[CC1Option]>,
3126   MarshallingInfoFlag<CodeGenOpts<"TimePasses">>;
3127 def ftime_report_EQ: Joined<["-"], "ftime-report=">, Group<f_Group>,
3128   Flags<[CC1Option]>, Values<"per-pass,per-pass-run">,
3129   MarshallingInfoFlag<CodeGenOpts<"TimePassesPerRun">>,
3130   HelpText<"(For new pass manager) 'per-pass': one report for each pass; "
3131            "'per-pass-run': one report for each pass invocation">;
3132 def ftime_trace : Flag<["-"], "ftime-trace">, Group<f_Group>,
3133   HelpText<"Turn on time profiler. Generates JSON file based on output filename.">,
3134   DocBrief<[{
3135 Turn on time profiler. Generates JSON file based on output filename. Results
3136 can be analyzed with chrome://tracing or `Speedscope App
3137 <https://www.speedscope.app>`_ for flamegraph visualization.}]>,
3138   Flags<[CoreOption]>;
3139 def ftime_trace_granularity_EQ : Joined<["-"], "ftime-trace-granularity=">, Group<f_Group>,
3140   HelpText<"Minimum time granularity (in microseconds) traced by time profiler">,
3141   Flags<[CC1Option, CoreOption]>,
3142   MarshallingInfoInt<FrontendOpts<"TimeTraceGranularity">, "500u">;
3143 def ftime_trace_EQ : Joined<["-"], "ftime-trace=">, Group<f_Group>,
3144   HelpText<"Similar to -ftime-trace. Specify the JSON file or a directory which will contain the JSON file">,
3145   Flags<[CC1Option, CoreOption]>,
3146   MarshallingInfoString<FrontendOpts<"TimeTracePath">>;
3147 def fproc_stat_report : Joined<["-"], "fproc-stat-report">, Group<f_Group>,
3148   HelpText<"Print subprocess statistics">;
3149 def fproc_stat_report_EQ : Joined<["-"], "fproc-stat-report=">, Group<f_Group>,
3150   HelpText<"Save subprocess statistics to the given file">;
3151 def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group<f_Group>, Flags<[CC1Option]>,
3152   Values<"global-dynamic,local-dynamic,initial-exec,local-exec">,
3153   NormalizedValuesScope<"CodeGenOptions">,
3154   NormalizedValues<["GeneralDynamicTLSModel", "LocalDynamicTLSModel", "InitialExecTLSModel", "LocalExecTLSModel"]>,
3155   MarshallingInfoEnum<CodeGenOpts<"DefaultTLSModel">, "GeneralDynamicTLSModel">;
3156 def ftrapv : Flag<["-"], "ftrapv">, Group<f_Group>, Flags<[CC1Option]>,
3157   HelpText<"Trap on integer overflow">;
3158 def ftrapv_handler_EQ : Joined<["-"], "ftrapv-handler=">, Group<f_Group>,
3159   MetaVarName<"<function name>">,
3160   HelpText<"Specify the function to be called on overflow">;
3161 def ftrapv_handler : Separate<["-"], "ftrapv-handler">, Group<f_Group>, Flags<[CC1Option]>;
3162 def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>, Flags<[CC1Option]>,
3163   HelpText<"Issue call to specified function rather than a trap instruction">,
3164   MarshallingInfoString<CodeGenOpts<"TrapFuncName">>;
3165 def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
3166   HelpText<"Turn on loop unroller">, Flags<[CC1Option]>;
3167 def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<f_Group>,
3168   HelpText<"Turn off loop unroller">, Flags<[CC1Option]>;
3169 defm reroll_loops : BoolFOption<"reroll-loops",
3170   CodeGenOpts<"RerollLoops">, DefaultFalse,
3171   PosFlag<SetTrue, [CC1Option], "Turn on loop reroller">, NegFlag<SetFalse>>;
3172 def ffinite_loops: Flag<["-"],  "ffinite-loops">, Group<f_Group>,
3173   HelpText<"Assume all loops are finite.">, Flags<[CC1Option]>;
3174 def fno_finite_loops: Flag<["-"], "fno-finite-loops">, Group<f_Group>,
3175   HelpText<"Do not assume that any loop is finite.">, Flags<[CC1Option]>;
3176
3177 def ftrigraphs : Flag<["-"], "ftrigraphs">, Group<f_Group>,
3178   HelpText<"Process trigraph sequences">, Flags<[CC1Option]>;
3179 def fno_trigraphs : Flag<["-"], "fno-trigraphs">, Group<f_Group>,
3180   HelpText<"Do not process trigraph sequences">, Flags<[CC1Option]>;
3181 def funsigned_bitfields : Flag<["-"], "funsigned-bitfields">, Group<f_Group>;
3182 def funsigned_char : Flag<["-"], "funsigned-char">, Group<f_Group>;
3183 def fno_unsigned_char : Flag<["-"], "fno-unsigned-char">;
3184 def funwind_tables : Flag<["-"], "funwind-tables">, Group<f_Group>;
3185 defm register_global_dtors_with_atexit : BoolFOption<"register-global-dtors-with-atexit",
3186   CodeGenOpts<"RegisterGlobalDtorsWithAtExit">, DefaultFalse,
3187   PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
3188   BothFlags<[], " atexit or __cxa_atexit to register global destructors">>;
3189 defm use_init_array : BoolFOption<"use-init-array",
3190   CodeGenOpts<"UseInitArray">, DefaultTrue,
3191   NegFlag<SetFalse, [CC1Option], "Use .ctors/.dtors instead of .init_array/.fini_array">,
3192   PosFlag<SetTrue>>;
3193 def fno_var_tracking : Flag<["-"], "fno-var-tracking">, Group<clang_ignored_f_Group>;
3194 def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>,
3195   HelpText<"Generate verbose assembly output">;
3196 def dA : Flag<["-"], "dA">, Alias<fverbose_asm>;
3197 defm visibility_from_dllstorageclass : BoolFOption<"visibility-from-dllstorageclass",
3198   LangOpts<"VisibilityFromDLLStorageClass">, DefaultFalse,
3199   PosFlag<SetTrue, [CC1Option], "Set the visibility of symbols in the generated code from their DLL storage class">,
3200   NegFlag<SetFalse>>;
3201 def fvisibility_dllexport_EQ : Joined<["-"], "fvisibility-dllexport=">, Group<f_Group>, Flags<[CC1Option]>,
3202   HelpText<"The visibility for dllexport definitions [-fvisibility-from-dllstorageclass]">,
3203   MarshallingInfoVisibility<LangOpts<"DLLExportVisibility">, "DefaultVisibility">,
3204   ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
3205 def fvisibility_nodllstorageclass_EQ : Joined<["-"], "fvisibility-nodllstorageclass=">, Group<f_Group>, Flags<[CC1Option]>,
3206   HelpText<"The visibility for definitions without an explicit DLL export class [-fvisibility-from-dllstorageclass]">,
3207   MarshallingInfoVisibility<LangOpts<"NoDLLStorageClassVisibility">, "HiddenVisibility">,
3208   ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
3209 def fvisibility_externs_dllimport_EQ : Joined<["-"], "fvisibility-externs-dllimport=">, Group<f_Group>, Flags<[CC1Option]>,
3210   HelpText<"The visibility for dllimport external declarations [-fvisibility-from-dllstorageclass]">,
3211   MarshallingInfoVisibility<LangOpts<"ExternDeclDLLImportVisibility">, "DefaultVisibility">,
3212   ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
3213 def fvisibility_externs_nodllstorageclass_EQ : Joined<["-"], "fvisibility-externs-nodllstorageclass=">, Group<f_Group>, Flags<[CC1Option]>,
3214   HelpText<"The visibility for external declarations without an explicit DLL dllstorageclass [-fvisibility-from-dllstorageclass]">,
3215   MarshallingInfoVisibility<LangOpts<"ExternDeclNoDLLStorageClassVisibility">, "HiddenVisibility">,
3216   ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
3217 def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>, Flags<[CC1Option]>,
3218   HelpText<"Set the default symbol visibility for all global definitions">,
3219   MarshallingInfoVisibility<LangOpts<"ValueVisibilityMode">, "DefaultVisibility">;
3220 defm visibility_inlines_hidden : BoolFOption<"visibility-inlines-hidden",
3221   LangOpts<"InlineVisibilityHidden">, DefaultFalse,
3222   PosFlag<SetTrue, [CC1Option], "Give inline C++ member functions hidden visibility by default">,
3223   NegFlag<SetFalse>>;
3224 defm visibility_inlines_hidden_static_local_var : BoolFOption<"visibility-inlines-hidden-static-local-var",
3225   LangOpts<"VisibilityInlinesHiddenStaticLocalVar">, DefaultFalse,
3226   PosFlag<SetTrue, [CC1Option], "When -fvisibility-inlines-hidden is enabled, static variables in"
3227             " inline C++ member functions will also be given hidden visibility by default">,
3228   NegFlag<SetFalse, [], "Disables -fvisibility-inlines-hidden-static-local-var"
3229          " (this is the default on non-darwin targets)">, BothFlags<[CC1Option]>>;
3230 def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group<f_Group>,
3231   HelpText<"Give global types 'default' visibility and global functions and "
3232            "variables 'hidden' visibility by default">;
3233 def fvisibility_global_new_delete_hidden : Flag<["-"], "fvisibility-global-new-delete-hidden">, Group<f_Group>,
3234   HelpText<"Give global C++ operator new and delete declarations hidden visibility">, Flags<[CC1Option]>,
3235   MarshallingInfoFlag<LangOpts<"GlobalAllocationFunctionVisibilityHidden">>;
3236 def mdefault_visibility_export_mapping_EQ : Joined<["-"], "mdefault-visibility-export-mapping=">,
3237   Values<"none,explicit,all">,
3238   NormalizedValuesScope<"LangOptions::DefaultVisiblityExportMapping">,
3239   NormalizedValues<["None", "Explicit", "All"]>,
3240   HelpText<"Mapping between default visibility and export">,
3241   Group<m_Group>, Flags<[CC1Option,TargetSpecific]>,
3242   MarshallingInfoEnum<LangOpts<"DefaultVisibilityExportMapping">,"None">;
3243 defm new_infallible : BoolFOption<"new-infallible",
3244   LangOpts<"NewInfallible">, DefaultFalse,
3245   PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
3246   BothFlags<[CC1Option], " treating throwing global C++ operator new as always returning valid memory "
3247   "(annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.">>;
3248 defm whole_program_vtables : BoolFOption<"whole-program-vtables",
3249   CodeGenOpts<"WholeProgramVTables">, DefaultFalse,
3250   PosFlag<SetTrue, [CC1Option], "Enables whole-program vtable optimization. Requires -flto">,
3251   NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
3252 defm split_lto_unit : BoolFOption<"split-lto-unit",
3253   CodeGenOpts<"EnableSplitLTOUnit">, DefaultFalse,
3254   PosFlag<SetTrue, [CC1Option], "Enables splitting of the LTO unit">,
3255   NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
3256 defm force_emit_vtables : BoolFOption<"force-emit-vtables",
3257   CodeGenOpts<"ForceEmitVTables">, DefaultFalse,
3258   PosFlag<SetTrue, [CC1Option], "Emits more virtual tables to improve devirtualization">,
3259   NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
3260   DocBrief<[{In order to improve devirtualization, forces emitting of vtables even in
3261 modules where it isn't necessary. It causes more inline virtual functions
3262 to be emitted.}]>;
3263 defm virtual_function_elimination : BoolFOption<"virtual-function-elimination",
3264   CodeGenOpts<"VirtualFunctionElimination">, DefaultFalse,
3265   PosFlag<SetTrue, [CC1Option], "Enables dead virtual function elimination optimization. Requires -flto=full">,
3266   NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
3267
3268 def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>, Flags<[CC1Option]>,
3269   HelpText<"Treat signed integer overflow as two's complement">;
3270 def fwritable_strings : Flag<["-"], "fwritable-strings">, Group<f_Group>, Flags<[CC1Option]>,
3271   HelpText<"Store string literals as writable data">,
3272   MarshallingInfoFlag<LangOpts<"WritableStrings">>;
3273 defm zero_initialized_in_bss : BoolFOption<"zero-initialized-in-bss",
3274   CodeGenOpts<"NoZeroInitializedInBSS">, DefaultFalse,
3275   NegFlag<SetTrue, [CC1Option], "Don't place zero initialized data in BSS">,
3276   PosFlag<SetFalse>>;
3277 defm function_sections : BoolFOption<"function-sections",
3278   CodeGenOpts<"FunctionSections">, DefaultFalse,
3279   PosFlag<SetTrue, [CC1Option], "Place each function in its own section">,
3280   NegFlag<SetFalse>>;
3281 def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
3282   Flags<[CC1Option, CC1AsOption]>,
3283   HelpText<"Place each function's basic blocks in unique sections (ELF Only)">,
3284   DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>,
3285   Values<"all,labels,none,list=">,
3286   MarshallingInfoString<CodeGenOpts<"BBSections">, [{"none"}]>;
3287 defm data_sections : BoolFOption<"data-sections",
3288   CodeGenOpts<"DataSections">, DefaultFalse,
3289   PosFlag<SetTrue, [CC1Option], "Place each data in its own section">, NegFlag<SetFalse>>;
3290 defm stack_size_section : BoolFOption<"stack-size-section",
3291   CodeGenOpts<"StackSizeSection">, DefaultFalse,
3292   PosFlag<SetTrue, [CC1Option], "Emit section containing metadata on function stack sizes">,
3293   NegFlag<SetFalse>>;
3294 def fstack_usage : Flag<["-"], "fstack-usage">, Group<f_Group>,
3295   HelpText<"Emit .su file containing information on function stack sizes">;
3296 def stack_usage_file : Separate<["-"], "stack-usage-file">,
3297   Flags<[CC1Option, NoDriverOption]>,
3298   HelpText<"Filename (or -) to write stack usage output to">,
3299   MarshallingInfoString<CodeGenOpts<"StackUsageOutput">>;
3300
3301 defm unique_basic_block_section_names : BoolFOption<"unique-basic-block-section-names",
3302   CodeGenOpts<"UniqueBasicBlockSectionNames">, DefaultFalse,
3303   PosFlag<SetTrue, [CC1Option], "Use unique names for basic block sections (ELF Only)">,
3304   NegFlag<SetFalse>>;
3305 defm unique_internal_linkage_names : BoolFOption<"unique-internal-linkage-names",
3306   CodeGenOpts<"UniqueInternalLinkageNames">, DefaultFalse,
3307   PosFlag<SetTrue, [CC1Option], "Uniqueify Internal Linkage Symbol Names by appending"
3308             " the MD5 hash of the module path">,
3309   NegFlag<SetFalse>>;
3310 defm unique_section_names : BoolFOption<"unique-section-names",
3311   CodeGenOpts<"UniqueSectionNames">, DefaultTrue,
3312   NegFlag<SetFalse, [CC1Option], "Don't use unique names for text and data sections">,
3313   PosFlag<SetTrue>>;
3314
3315 defm split_machine_functions: BoolFOption<"split-machine-functions",
3316   CodeGenOpts<"SplitMachineFunctions">, DefaultFalse,
3317   PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
3318   BothFlags<[], " late function splitting using profile information (x86 ELF)">>;
3319
3320 defm strict_return : BoolFOption<"strict-return",
3321   CodeGenOpts<"StrictReturn">, DefaultTrue,
3322   NegFlag<SetFalse, [CC1Option], "Don't treat control flow paths that fall off the end"
3323             " of a non-void function as unreachable">,
3324   PosFlag<SetTrue>>;
3325
3326 def fenable_matrix : Flag<["-"], "fenable-matrix">, Group<f_Group>,
3327     Flags<[CC1Option]>,
3328     HelpText<"Enable matrix data type and related builtin functions">,
3329     MarshallingInfoFlag<LangOpts<"MatrixTypes">>;
3330
3331 def fzero_call_used_regs_EQ
3332     : Joined<["-"], "fzero-call-used-regs=">, Group<f_Group>, Flags<[CC1Option]>,
3333       HelpText<"Clear call-used registers upon function return (AArch64/x86 only)">,
3334       Values<"skip,used-gpr-arg,used-gpr,used-arg,used,all-gpr-arg,all-gpr,all-arg,all">,
3335       NormalizedValues<["Skip", "UsedGPRArg", "UsedGPR", "UsedArg", "Used",
3336                         "AllGPRArg", "AllGPR", "AllArg", "All"]>,
3337       NormalizedValuesScope<"llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind">,
3338       MarshallingInfoEnum<CodeGenOpts<"ZeroCallUsedRegs">, "Skip">;
3339
3340 def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
3341   HelpText<"Place debug types in their own section (ELF Only)">;
3342 def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group<f_Group>;
3343 defm debug_ranges_base_address : BoolFOption<"debug-ranges-base-address",
3344   CodeGenOpts<"DebugRangesBaseAddress">, DefaultFalse,
3345   PosFlag<SetTrue, [CC1Option], "Use DWARF base address selection entries in .debug_ranges">,
3346   NegFlag<SetFalse>>;
3347 defm split_dwarf_inlining : BoolFOption<"split-dwarf-inlining",
3348   CodeGenOpts<"SplitDwarfInlining">, DefaultFalse,
3349   NegFlag<SetFalse, []>,
3350   PosFlag<SetTrue, [CC1Option], "Provide minimal debug info in the object/executable"
3351           " to facilitate online symbolication/stack traces in the absence of"
3352           " .dwo/.dwp files when using Split DWARF">>;
3353 def fdebug_default_version: Joined<["-"], "fdebug-default-version=">, Group<f_Group>,
3354   HelpText<"Default DWARF version to use, if a -g option caused DWARF debug info to be produced">;
3355 def fdebug_prefix_map_EQ
3356   : Joined<["-"], "fdebug-prefix-map=">, Group<f_Group>,
3357     Flags<[CC1Option,CC1AsOption]>,
3358     MetaVarName<"<old>=<new>">,
3359     HelpText<"For paths in debug info, remap directory <old> to <new>. If multiple options match a path, the last option wins">;
3360 def fcoverage_prefix_map_EQ
3361   : Joined<["-"], "fcoverage-prefix-map=">, Group<f_Group>,
3362     Flags<[CC1Option]>,
3363     MetaVarName<"<old>=<new>">,
3364     HelpText<"remap file source paths <old> to <new> in coverage mapping. If there are multiple options, prefix replacement is applied in reverse order starting from the last one">;
3365 def ffile_prefix_map_EQ
3366   : Joined<["-"], "ffile-prefix-map=">, Group<f_Group>,
3367     HelpText<"remap file source paths in debug info, predefined preprocessor "
3368              "macros and __builtin_FILE(). Implies -ffile-reproducible.">;
3369 def fmacro_prefix_map_EQ
3370   : Joined<["-"], "fmacro-prefix-map=">, Group<f_Group>, Flags<[CC1Option]>,
3371     HelpText<"remap file source paths in predefined preprocessor macros and "
3372              "__builtin_FILE(). Implies -ffile-reproducible.">;
3373 defm force_dwarf_frame : BoolFOption<"force-dwarf-frame",
3374   CodeGenOpts<"ForceDwarfFrameSection">, DefaultFalse,
3375   PosFlag<SetTrue, [CC1Option], "Always emit a debug frame section">, NegFlag<SetFalse>>;
3376 def femit_dwarf_unwind_EQ : Joined<["-"], "femit-dwarf-unwind=">,
3377   Group<f_Group>, Flags<[CC1Option, CC1AsOption]>,
3378   HelpText<"When to emit DWARF unwind (EH frame) info">,
3379   Values<"always,no-compact-unwind,default">,
3380   NormalizedValues<["Always", "NoCompactUnwind", "Default"]>,
3381   NormalizedValuesScope<"llvm::EmitDwarfUnwindType">,
3382   MarshallingInfoEnum<CodeGenOpts<"EmitDwarfUnwind">, "Default">;
3383 defm emit_compact_unwind_non_canonical : BoolFOption<"emit-compact-unwind-non-canonical",
3384   CodeGenOpts<"EmitCompactUnwindNonCanonical">, DefaultFalse,
3385   PosFlag<SetTrue, [CC1Option, CC1AsOption], "Try emitting Compact-Unwind for non-canonical entries. Maybe overriden by other constraints">, NegFlag<SetFalse>>;
3386 def g_Flag : Flag<["-"], "g">, Group<g_Group>,
3387     Flags<[CoreOption,FlangOption]>, HelpText<"Generate source-level debug information">;
3388 def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<gN_Group>,
3389   Flags<[CoreOption,FlangOption]>, HelpText<"Emit debug line number tables only">;
3390 def gline_directives_only : Flag<["-"], "gline-directives-only">, Group<gN_Group>,
3391   Flags<[CoreOption]>, HelpText<"Emit debug line info directives only">;
3392 def gmlt : Flag<["-"], "gmlt">, Alias<gline_tables_only>;
3393 def g0 : Flag<["-"], "g0">, Group<gN_Group>;
3394 def g1 : Flag<["-"], "g1">, Group<gN_Group>, Alias<gline_tables_only>;
3395 def g2 : Flag<["-"], "g2">, Group<gN_Group>;
3396 def g3 : Flag<["-"], "g3">, Group<gN_Group>;
3397 def ggdb : Flag<["-"], "ggdb">, Group<gTune_Group>;
3398 def ggdb0 : Flag<["-"], "ggdb0">, Group<ggdbN_Group>;
3399 def ggdb1 : Flag<["-"], "ggdb1">, Group<ggdbN_Group>;
3400 def ggdb2 : Flag<["-"], "ggdb2">, Group<ggdbN_Group>;
3401 def ggdb3 : Flag<["-"], "ggdb3">, Group<ggdbN_Group>;
3402 def glldb : Flag<["-"], "glldb">, Group<gTune_Group>;
3403 def gsce : Flag<["-"], "gsce">, Group<gTune_Group>;
3404 def gdbx : Flag<["-"], "gdbx">, Group<gTune_Group>;
3405 // Equivalent to our default dwarf version. Forces usual dwarf emission when
3406 // CodeView is enabled.
3407 def gdwarf : Flag<["-"], "gdwarf">, Group<g_Group>, Flags<[CoreOption]>,
3408   HelpText<"Generate source-level debug information with the default dwarf version">;
3409 def gdwarf_2 : Flag<["-"], "gdwarf-2">, Group<g_Group>,
3410   HelpText<"Generate source-level debug information with dwarf version 2">;
3411 def gdwarf_3 : Flag<["-"], "gdwarf-3">, Group<g_Group>,
3412   HelpText<"Generate source-level debug information with dwarf version 3">;
3413 def gdwarf_4 : Flag<["-"], "gdwarf-4">, Group<g_Group>,
3414   HelpText<"Generate source-level debug information with dwarf version 4">;
3415 def gdwarf_5 : Flag<["-"], "gdwarf-5">, Group<g_Group>,
3416   HelpText<"Generate source-level debug information with dwarf version 5">;
3417 def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>,
3418   Flags<[CC1Option, CC1AsOption]>,
3419   HelpText<"Enables DWARF64 format for ELF binaries, if debug information emission is enabled.">,
3420   MarshallingInfoFlag<CodeGenOpts<"Dwarf64">>;
3421 def gdwarf32 : Flag<["-"], "gdwarf32">, Group<g_Group>,
3422   Flags<[CC1Option, CC1AsOption]>,
3423   HelpText<"Enables DWARF32 format for ELF binaries, if debug information emission is enabled.">;
3424
3425 def gcodeview : Flag<["-"], "gcodeview">,
3426   HelpText<"Generate CodeView debug information">,
3427   Flags<[CC1Option, CC1AsOption, CoreOption]>,
3428   MarshallingInfoFlag<CodeGenOpts<"EmitCodeView">>;
3429 defm codeview_ghash : BoolOption<"g", "codeview-ghash",
3430   CodeGenOpts<"CodeViewGHash">, DefaultFalse,
3431   PosFlag<SetTrue, [CC1Option], "Emit type record hashes in a .debug$H section">,
3432   NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
3433 defm codeview_command_line : BoolOption<"g", "codeview-command-line",
3434   CodeGenOpts<"CodeViewCommandLine">, DefaultTrue,
3435   PosFlag<SetTrue, [], "Emit compiler path and command line into CodeView debug information">,
3436   NegFlag<SetFalse, [], "Don't emit compiler path and command line into CodeView debug information">,
3437   BothFlags<[CoreOption, CC1Option]>>;
3438 defm inline_line_tables : BoolGOption<"inline-line-tables",
3439   CodeGenOpts<"NoInlineLineTables">, DefaultFalse,
3440   NegFlag<SetTrue, [CC1Option], "Don't emit inline line tables.">,
3441   PosFlag<SetFalse>, BothFlags<[CoreOption]>>;
3442
3443 def gfull : Flag<["-"], "gfull">, Group<g_Group>;
3444 def gused : Flag<["-"], "gused">, Group<g_Group>;
3445 def gstabs : Joined<["-"], "gstabs">, Group<g_Group>, Flags<[Unsupported]>;
3446 def gcoff : Joined<["-"], "gcoff">, Group<g_Group>, Flags<[Unsupported]>;
3447 def gxcoff : Joined<["-"], "gxcoff">, Group<g_Group>, Flags<[Unsupported]>;
3448 def gvms : Joined<["-"], "gvms">, Group<g_Group>, Flags<[Unsupported]>;
3449 def gtoggle : Flag<["-"], "gtoggle">, Group<g_flags_Group>, Flags<[Unsupported]>;
3450 def grecord_command_line : Flag<["-"], "grecord-command-line">,
3451   Group<g_flags_Group>;
3452 def gno_record_command_line : Flag<["-"], "gno-record-command-line">,
3453   Group<g_flags_Group>;
3454 def : Flag<["-"], "grecord-gcc-switches">, Alias<grecord_command_line>;
3455 def : Flag<["-"], "gno-record-gcc-switches">, Alias<gno_record_command_line>;
3456 defm strict_dwarf : BoolOption<"g", "strict-dwarf",
3457   CodeGenOpts<"DebugStrictDwarf">, DefaultFalse,
3458   PosFlag<SetTrue, [CC1Option], "Restrict DWARF features to those defined in "
3459           "the specified version, avoiding features from later versions.">,
3460   NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
3461   Group<g_flags_Group>;
3462 defm column_info : BoolOption<"g", "column-info",
3463   CodeGenOpts<"DebugColumnInfo">, DefaultTrue,
3464   NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>, BothFlags<[CoreOption]>>,
3465   Group<g_flags_Group>;
3466 def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>,
3467   Flags<[CoreOption]>;
3468 def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group<g_flags_Group>,
3469   Flags<[CoreOption]>, HelpText<"Set DWARF fission mode">,
3470   Values<"split,single">;
3471 def gno_split_dwarf : Flag<["-"], "gno-split-dwarf">, Group<g_flags_Group>,
3472   Flags<[CoreOption]>;
3473 def gsimple_template_names : Flag<["-"], "gsimple-template-names">, Group<g_flags_Group>;
3474 def gsimple_template_names_EQ
3475     : Joined<["-"], "gsimple-template-names=">,
3476       HelpText<"Use simple template names in DWARF, or include the full "
3477                "template name with a modified prefix for validation">,
3478       Values<"simple,mangled">, Flags<[CC1Option, NoDriverOption]>;
3479 def gsrc_hash_EQ : Joined<["-"], "gsrc-hash=">,
3480   Group<g_flags_Group>, Flags<[CC1Option, NoDriverOption]>,
3481   Values<"md5,sha1,sha256">,
3482   NormalizedValues<["DSH_MD5", "DSH_SHA1", "DSH_SHA256"]>,
3483   NormalizedValuesScope<"CodeGenOptions">,
3484   MarshallingInfoEnum<CodeGenOpts<"DebugSrcHash">, "DSH_MD5">;
3485 def gno_simple_template_names : Flag<["-"], "gno-simple-template-names">,
3486                                 Group<g_flags_Group>;
3487 def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
3488 def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>;
3489 def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
3490 def gno_pubnames : Flag<["-"], "gno-pubnames">, Group<g_flags_Group>;
3491 def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group<g_flags_Group>;
3492 def gmodules : Flag <["-"], "gmodules">, Group<gN_Group>,
3493   HelpText<"Generate debug info with external references to clang modules"
3494            " or precompiled headers">;
3495 def gno_modules : Flag <["-"], "gno-modules">, Group<g_flags_Group>;
3496 def gz_EQ : Joined<["-"], "gz=">, Group<g_flags_Group>,
3497     HelpText<"DWARF debug sections compression type">;
3498 def gz : Flag<["-"], "gz">, Alias<gz_EQ>, AliasArgs<["zlib"]>, Group<g_flags_Group>;
3499 def gembed_source : Flag<["-"], "gembed-source">, Group<g_flags_Group>, Flags<[CC1Option]>,
3500     HelpText<"Embed source text in DWARF debug sections">,
3501     MarshallingInfoFlag<CodeGenOpts<"EmbedSource">>;
3502 def gno_embed_source : Flag<["-"], "gno-embed-source">, Group<g_flags_Group>,
3503     Flags<[NoXarchOption]>,
3504     HelpText<"Restore the default behavior of not embedding source text in DWARF debug sections">;
3505 def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">;
3506 def help : Flag<["-", "--"], "help">, Flags<[CC1Option,CC1AsOption, FC1Option,
3507     FlangOption]>, HelpText<"Display available options">,
3508     MarshallingInfoFlag<FrontendOpts<"ShowHelp">>;
3509 def ibuiltininc : Flag<["-"], "ibuiltininc">, Group<clang_i_Group>,
3510   HelpText<"Enable builtin #include directories even when -nostdinc is used "
3511            "before or after -ibuiltininc. "
3512            "Using -nobuiltininc after the option disables it">;
3513 def index_header_map : Flag<["-"], "index-header-map">, Flags<[CC1Option]>,
3514   HelpText<"Make the next included directory (-I or -F) an indexer header map">;
3515 def idirafter : JoinedOrSeparate<["-"], "idirafter">, Group<clang_i_Group>, Flags<[CC1Option]>,
3516   HelpText<"Add directory to AFTER include search path">;
3517 def iframework : JoinedOrSeparate<["-"], "iframework">, Group<clang_i_Group>, Flags<[CC1Option]>,
3518   HelpText<"Add directory to SYSTEM framework search path">;
3519 def iframeworkwithsysroot : JoinedOrSeparate<["-"], "iframeworkwithsysroot">,
3520   Group<clang_i_Group>,
3521   HelpText<"Add directory to SYSTEM framework search path, "
3522            "absolute paths are relative to -isysroot">,
3523   MetaVarName<"<directory>">, Flags<[CC1Option]>;
3524 def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>, Flags<[CC1Option]>,
3525   HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">,
3526   MarshallingInfoStringVector<PreprocessorOpts<"MacroIncludes">>;
3527 def image__base : Separate<["-"], "image_base">;
3528 def include_ : JoinedOrSeparate<["-", "--"], "include">, Group<clang_i_Group>, EnumName<"include">,
3529     MetaVarName<"<file>">, HelpText<"Include file before parsing">, Flags<[CC1Option]>;
3530 def include_pch : Separate<["-"], "include-pch">, Group<clang_i_Group>, Flags<[CC1Option]>,
3531   HelpText<"Include precompiled header file">, MetaVarName<"<file>">,
3532   MarshallingInfoString<PreprocessorOpts<"ImplicitPCHInclude">>;
3533 def relocatable_pch : Flag<["-", "--"], "relocatable-pch">, Flags<[CC1Option]>,
3534   HelpText<"Whether to build a relocatable precompiled header">,
3535   MarshallingInfoFlag<FrontendOpts<"RelocatablePCH">>;
3536 def verify_pch : Flag<["-"], "verify-pch">, Group<Action_Group>, Flags<[CC1Option]>,
3537   HelpText<"Load and verify that a pre-compiled header file is not stale">;
3538 def init : Separate<["-"], "init">;
3539 def install__name : Separate<["-"], "install_name">;
3540 def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>, Flags<[CC1Option]>,
3541   HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"<dir>">;
3542 def iquote : JoinedOrSeparate<["-"], "iquote">, Group<clang_i_Group>, Flags<[CC1Option]>,
3543   HelpText<"Add directory to QUOTE include search path">, MetaVarName<"<directory>">;
3544 def isysroot : JoinedOrSeparate<["-"], "isysroot">, Group<clang_i_Group>, Flags<[CC1Option]>,
3545   HelpText<"Set the system root directory (usually /)">, MetaVarName<"<dir>">,
3546   MarshallingInfoString<HeaderSearchOpts<"Sysroot">, [{"/"}]>;
3547 def isystem : JoinedOrSeparate<["-"], "isystem">, Group<clang_i_Group>,
3548   Flags<[CC1Option]>,
3549   HelpText<"Add directory to SYSTEM include search path">, MetaVarName<"<directory>">;
3550 def isystem_after : JoinedOrSeparate<["-"], "isystem-after">,
3551   Group<clang_i_Group>, Flags<[NoXarchOption]>, MetaVarName<"<directory>">,
3552   HelpText<"Add directory to end of the SYSTEM include search path">;
3553 def iwithprefixbefore : JoinedOrSeparate<["-"], "iwithprefixbefore">, Group<clang_i_Group>,
3554   HelpText<"Set directory to include search path with prefix">, MetaVarName<"<dir>">,
3555   Flags<[CC1Option]>;
3556 def iwithprefix : JoinedOrSeparate<["-"], "iwithprefix">, Group<clang_i_Group>, Flags<[CC1Option]>,
3557   HelpText<"Set directory to SYSTEM include search path with prefix">, MetaVarName<"<dir>">;
3558 def iwithsysroot : JoinedOrSeparate<["-"], "iwithsysroot">, Group<clang_i_Group>,
3559   HelpText<"Add directory to SYSTEM include search path, "
3560            "absolute paths are relative to -isysroot">, MetaVarName<"<directory>">,
3561   Flags<[CC1Option]>;
3562 def ivfsoverlay : JoinedOrSeparate<["-"], "ivfsoverlay">, Group<clang_i_Group>, Flags<[CC1Option]>,
3563   HelpText<"Overlay the virtual filesystem described by file over the real file system">;
3564 def vfsoverlay : JoinedOrSeparate<["-", "--"], "vfsoverlay">, Flags<[CC1Option, CoreOption]>,
3565   HelpText<"Overlay the virtual filesystem described by file over the real file system. "
3566            "Additionally, pass this overlay file to the linker if it supports it">;
3567 def imultilib : Separate<["-"], "imultilib">, Group<gfortran_Group>;
3568 def K : Flag<["-"], "K">, Flags<[LinkerInput]>;
3569 def keep__private__externs : Flag<["-"], "keep_private_externs">;
3570 def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>,
3571         Group<Link_Group>;
3572 def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>;
3573 def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>;
3574 def mlittle_endian : Flag<["-"], "mlittle-endian">, Group<m_Group>, Flags<[NoXarchOption,TargetSpecific]>;
3575 def EL : Flag<["-"], "EL">, Alias<mlittle_endian>;
3576 def mbig_endian : Flag<["-"], "mbig-endian">, Group<m_Group>, Flags<[NoXarchOption,TargetSpecific]>;
3577 def EB : Flag<["-"], "EB">, Alias<mbig_endian>;
3578 def m16 : Flag<["-"], "m16">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3579 def m32 : Flag<["-"], "m32">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3580 def maix32 : Flag<["-"], "maix32">, Group<m_Group>, Flags<[NoXarchOption]>;
3581 def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group<m_Group>, Flags<[NoXarchOption,CC1Option]>,
3582   HelpText<"Enable hexagon-qdsp6 backward compatibility">,
3583   MarshallingInfoFlag<LangOpts<"HexagonQdsp6Compat">>;
3584 def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3585 def maix64 : Flag<["-"], "maix64">, Group<m_Group>, Flags<[NoXarchOption]>;
3586 def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3587 def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>,
3588   HelpText<"Use Intel MCU ABI">;
3589 def mno_iamcu : Flag<["-"], "mno-iamcu">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3590 def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group<clang_ignored_m_Group>;
3591 def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group<clang_ignored_m_Group>;
3592 def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group<clang_ignored_m_Group>;
3593
3594 let Flags = [TargetSpecific] in {
3595 def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>;
3596 def malign_branch_EQ : CommaJoined<["-"], "malign-branch=">, Group<m_Group>,
3597   HelpText<"Specify types of branches to align">;
3598 def malign_branch_boundary_EQ : Joined<["-"], "malign-branch-boundary=">, Group<m_Group>,
3599   HelpText<"Specify the boundary's size to align branches">;
3600 def mpad_max_prefix_size_EQ : Joined<["-"], "mpad-max-prefix-size=">, Group<m_Group>,
3601   HelpText<"Specify maximum number of prefixes to use for padding">;
3602 def mbranches_within_32B_boundaries : Flag<["-"], "mbranches-within-32B-boundaries">, Group<m_Group>,
3603   HelpText<"Align selected branches (fused, jcc, jmp) within 32-byte boundary">;
3604 def mfancy_math_387 : Flag<["-"], "mfancy-math-387">, Group<clang_ignored_m_Group>;
3605 def mlong_calls : Flag<["-"], "mlong-calls">, Group<m_Group>,
3606   HelpText<"Generate branches with extended addressability, usually via indirect jumps.">;
3607 } // let Flags = [TargetSpecific]
3608 def mdouble_EQ : Joined<["-"], "mdouble=">, Group<m_Group>,
3609   MetaVarName<"<n">, Values<"32,64">, Flags<[CC1Option]>,
3610   HelpText<"Force double to be <n> bits">,
3611   MarshallingInfoInt<LangOpts<"DoubleSize">, "0">;
3612 def mlong_double_64 : Flag<["-"], "mlong-double-64">, Group<LongDouble_Group>, Flags<[CC1Option]>,
3613   HelpText<"Force long double to be 64 bits">;
3614 def mlong_double_80 : Flag<["-"], "mlong-double-80">, Group<LongDouble_Group>, Flags<[CC1Option]>,
3615   HelpText<"Force long double to be 80 bits, padded to 128 bits for storage">;
3616 def mlong_double_128 : Flag<["-"], "mlong-double-128">, Group<LongDouble_Group>, Flags<[CC1Option]>,
3617   HelpText<"Force long double to be 128 bits">;
3618 let Flags = [TargetSpecific] in {
3619 def mno_long_calls : Flag<["-"], "mno-long-calls">, Group<m_Group>,
3620   HelpText<"Restore the default behaviour of not generating long calls">;
3621 } // let Flags = [TargetSpecific]
3622 def mexecute_only : Flag<["-"], "mexecute-only">, Group<m_arm_Features_Group>,
3623   HelpText<"Disallow generation of data access to code sections (ARM only)">;
3624 def mno_execute_only : Flag<["-"], "mno-execute-only">, Group<m_arm_Features_Group>,
3625   HelpText<"Allow generation of data access to code sections (ARM only)">;
3626 let Flags = [TargetSpecific] in {
3627 def mtp_mode_EQ : Joined<["-"], "mtp=">, Group<m_arm_Features_Group>, Values<"soft,cp15,tpidrurw,tpidruro,tpidrprw,el0,el1,el2,el3,tpidr_el0,tpidr_el1,tpidr_el2,tpidr_el3,tpidrro_el0">,
3628   HelpText<"Thread pointer access method. "
3629            "For AArch32: 'soft' uses a function call, or 'tpidrurw', 'tpidruro' or 'tpidrprw' use the three CP15 registers. 'cp15' is an alias for 'tpidruro'. "
3630            "For AArch64: 'tpidr_el0', 'tpidr_el1', 'tpidr_el2', 'tpidr_el3' or 'tpidrro_el0' use the five system registers. 'elN' is an alias for 'tpidr_elN'.">;
3631 def mpure_code : Flag<["-"], "mpure-code">, Alias<mexecute_only>; // Alias for GCC compatibility
3632 def mno_pure_code : Flag<["-"], "mno-pure-code">, Alias<mno_execute_only>;
3633 def mtvos_version_min_EQ : Joined<["-"], "mtvos-version-min=">, Group<m_Group>;
3634 def mappletvos_version_min_EQ : Joined<["-"], "mappletvos-version-min=">, Alias<mtvos_version_min_EQ>;
3635 def mtvos_simulator_version_min_EQ : Joined<["-"], "mtvos-simulator-version-min=">;
3636 def mappletvsimulator_version_min_EQ : Joined<["-"], "mappletvsimulator-version-min=">, Alias<mtvos_simulator_version_min_EQ>;
3637 def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, Group<m_Group>;
3638 def mwatchos_simulator_version_min_EQ : Joined<["-"], "mwatchos-simulator-version-min=">, Group<m_Group>;
3639 def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias<mwatchos_simulator_version_min_EQ>;
3640 } // let Flags = [TargetSpecific]
3641 def march_EQ : Joined<["-"], "march=">, Group<m_Group>, Flags<[CoreOption,TargetSpecific]>,
3642   HelpText<"For a list of available architectures for the target use '-mcpu=help'">;
3643 def masm_EQ : Joined<["-"], "masm=">, Group<m_Group>, Flags<[NoXarchOption]>;
3644 def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group<m_Group>, Flags<[CC1Option]>,
3645   Values<"att,intel">,
3646   NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["IAD_ATT", "IAD_Intel"]>,
3647   MarshallingInfoEnum<CodeGenOpts<"InlineAsmDialect">, "IAD_ATT">;
3648 def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>, Flags<[CC1Option]>,
3649   MarshallingInfoString<TargetOpts<"CodeModel">, [{"default"}]>;
3650 def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>, Flags<[NoXarchOption, CC1Option]>,
3651   HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
3652            "12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">,
3653   MarshallingInfoInt<CodeGenOpts<"TLSSize">>;
3654 def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group<m_Group>;
3655 def mdefault_build_attributes : Joined<["-"], "mdefault-build-attributes">, Group<m_Group>;
3656 def mno_default_build_attributes : Joined<["-"], "mno-default-build-attributes">, Group<m_Group>;
3657 let Flags = [TargetSpecific] in {
3658 def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group<clang_ignored_m_Group>;
3659 def mconsole : Joined<["-"], "mconsole">, Group<m_Group>;
3660 def mwindows : Joined<["-"], "mwindows">, Group<m_Group>;
3661 def mdll : Joined<["-"], "mdll">, Group<m_Group>;
3662 def municode : Joined<["-"], "municode">, Group<m_Group>;
3663 def mthreads : Joined<["-"], "mthreads">, Group<m_Group>;
3664 def mguard_EQ : Joined<["-"], "mguard=">, Group<m_Group>,
3665   HelpText<"Enable or disable Control Flow Guard checks and guard tables emission">,
3666   Values<"none,cf,cf-nochecks">;
3667 def mcpu_EQ : Joined<["-"], "mcpu=">, Group<m_Group>,
3668   HelpText<"For a list of available CPUs for the target use '-mcpu=help'">;
3669 def mmcu_EQ : Joined<["-"], "mmcu=">, Group<m_Group>;
3670 def msim : Flag<["-"], "msim">, Group<m_Group>;
3671 def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group<m_Group>;
3672 def mfix_and_continue : Flag<["-"], "mfix-and-continue">, Group<clang_ignored_m_Group>;
3673 def mieee_fp : Flag<["-"], "mieee-fp">, Group<clang_ignored_m_Group>;
3674 def minline_all_stringops : Flag<["-"], "minline-all-stringops">, Group<clang_ignored_m_Group>;
3675 def mno_inline_all_stringops : Flag<["-"], "mno-inline-all-stringops">, Group<clang_ignored_m_Group>;
3676 } // let Flags = [TargetSpecific]
3677 def malign_double : Flag<["-"], "malign-double">, Group<m_Group>, Flags<[CC1Option]>,
3678   HelpText<"Align doubles to two words in structs (x86 only)">,
3679   MarshallingInfoFlag<LangOpts<"AlignDouble">>;
3680 let Flags = [TargetSpecific] in {
3681 def mfloat_abi_EQ : Joined<["-"], "mfloat-abi=">, Group<m_Group>, Values<"soft,softfp,hard">;
3682 def mfpmath_EQ : Joined<["-"], "mfpmath=">, Group<m_Group>;
3683 def mfpu_EQ : Joined<["-"], "mfpu=">, Group<m_Group>;
3684 def mhwdiv_EQ : Joined<["-"], "mhwdiv=">, Group<m_Group>;
3685 def mhwmult_EQ : Joined<["-"], "mhwmult=">, Group<m_Group>;
3686 } // let Flags = [TargetSpecific]
3687 def mglobal_merge : Flag<["-"], "mglobal-merge">, Group<m_Group>, Flags<[CC1Option]>,
3688   HelpText<"Enable merging of globals">;
3689 let Flags = [TargetSpecific] in {
3690 def mhard_float : Flag<["-"], "mhard-float">, Group<m_Group>;
3691 def mios_version_min_EQ : Joined<["-"], "mios-version-min=">,
3692   Group<m_Group>, HelpText<"Set iOS deployment target">;
3693 def : Joined<["-"], "miphoneos-version-min=">,
3694   Group<m_Group>, Alias<mios_version_min_EQ>;
3695 def mios_simulator_version_min_EQ : Joined<["-"], "mios-simulator-version-min=">, Group<m_Group>;
3696 def : Joined<["-"], "miphonesimulator-version-min=">, Alias<mios_simulator_version_min_EQ>;
3697 def mkernel : Flag<["-"], "mkernel">, Group<m_Group>;
3698 def mlinker_version_EQ : Joined<["-"], "mlinker-version=">, Group<m_Group>, Flags<[NoXarchOption]>;
3699 } // let Flags = [TargetSpecific]
3700 def mllvm : Separate<["-"], "mllvm">,Flags<[CC1Option,CC1AsOption,CoreOption,FC1Option,FlangOption]>,
3701   HelpText<"Additional arguments to forward to LLVM's option processing">,
3702   MarshallingInfoStringVector<FrontendOpts<"LLVMArgs">>;
3703 def : Joined<["-"], "mllvm=">, Flags<[CoreOption,FlangOption]>, Alias<mllvm>,
3704   HelpText<"Alias for -mllvm">, MetaVarName<"<arg>">;
3705 def mmlir : Separate<["-"], "mmlir">, Flags<[CoreOption,FC1Option,FlangOption]>,
3706   HelpText<"Additional arguments to forward to MLIR's option processing">;
3707 def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">,
3708   Group<m_Group>, Flags<[CC1Option]>, HelpText<"Set Fuchsia API level">,
3709   MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>;
3710 def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
3711   Group<m_Group>, HelpText<"Set macOS deployment target">;
3712 def : Joined<["-"], "mmacosx-version-min=">,
3713   Group<m_Group>, Alias<mmacos_version_min_EQ>;
3714 def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CC1Option]>,
3715   HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">,
3716   MarshallingInfoFlag<LangOpts<"MSBitfields">>;
3717 def moutline : Flag<["-"], "moutline">, Group<f_clang_Group>, Flags<[CC1Option]>,
3718     HelpText<"Enable function outlining (AArch64 only)">;
3719 def mno_outline : Flag<["-"], "mno-outline">, Group<f_clang_Group>, Flags<[CC1Option]>,
3720     HelpText<"Disable function outlining (AArch64 only)">;
3721 def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
3722   HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">;
3723 def mskip_rax_setup : Flag<["-"], "mskip-rax-setup">, Group<m_Group>, Flags<[CC1Option]>,
3724   HelpText<"Skip setting up RAX register when passing variable arguments (x86 only)">,
3725   MarshallingInfoFlag<CodeGenOpts<"SkipRaxSetup">>;
3726 def mno_skip_rax_setup : Flag<["-"], "mno-skip-rax-setup">, Group<m_Group>, Flags<[CC1Option]>;
3727 def mstackrealign : Flag<["-"], "mstackrealign">, Group<m_Group>, Flags<[CC1Option]>,
3728   HelpText<"Force realign the stack at entry to every function">,
3729   MarshallingInfoFlag<CodeGenOpts<"StackRealignment">>;
3730 def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group<m_Group>, Flags<[CC1Option]>,
3731   HelpText<"Set the stack alignment">,
3732   MarshallingInfoInt<CodeGenOpts<"StackAlignment">>;
3733 def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group<m_Group>, Flags<[CC1Option]>,
3734   HelpText<"Set the stack probe size">,
3735   MarshallingInfoInt<CodeGenOpts<"StackProbeSize">, "4096">;
3736 def mstack_arg_probe : Flag<["-"], "mstack-arg-probe">, Group<m_Group>,
3737   HelpText<"Enable stack probes">;
3738 def mzos_sys_include_EQ : Joined<["-"], "mzos-sys-include=">, MetaVarName<"<SysInclude>">,
3739     HelpText<"Path to system headers on z/OS">;
3740 def mno_stack_arg_probe : Flag<["-"], "mno-stack-arg-probe">, Group<m_Group>, Flags<[CC1Option]>,
3741   HelpText<"Disable stack probes which are enabled by default">,
3742   MarshallingInfoFlag<CodeGenOpts<"NoStackArgProbe">>;
3743 def mthread_model : Separate<["-"], "mthread-model">, Group<m_Group>, Flags<[CC1Option]>,
3744   HelpText<"The thread model to use. Defaults to 'posix')">, Values<"posix,single">,
3745   NormalizedValues<["POSIX", "Single"]>, NormalizedValuesScope<"LangOptions::ThreadModelKind">,
3746   MarshallingInfoEnum<LangOpts<"ThreadModel">, "POSIX">;
3747 def meabi : Separate<["-"], "meabi">, Group<m_Group>, Flags<[CC1Option]>,
3748   HelpText<"Set EABI type. Default depends on triple)">, Values<"default,4,5,gnu">,
3749   MarshallingInfoEnum<TargetOpts<"EABIVersion">, "Default">,
3750   NormalizedValuesScope<"llvm::EABI">,
3751   NormalizedValues<["Default", "EABI4", "EABI5", "GNU"]>;
3752 def mtargetos_EQ : Joined<["-"], "mtargetos=">, Group<m_Group>,
3753   HelpText<"Set the deployment target to be the specified OS and OS version">;
3754 def mzos_hlq_le_EQ : Joined<["-"], "mzos-hlq-le=">, MetaVarName<"<LeHLQ>">,
3755   HelpText<"High level qualifier for z/OS Language Environment datasets">;
3756 def mzos_hlq_clang_EQ : Joined<["-"], "mzos-hlq-clang=">, MetaVarName<"<ClangHLQ>">,
3757   HelpText<"High level qualifier for z/OS C++RT side deck datasets">;
3758 def mzos_hlq_csslib_EQ : Joined<["-"], "mzos-hlq-csslib=">, MetaVarName<"<CsslibHLQ>">,
3759   HelpText<"High level qualifier for z/OS CSSLIB dataset">;
3760
3761 def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group<m_Group>;
3762 def mno_global_merge : Flag<["-"], "mno-global-merge">, Group<m_Group>, Flags<[CC1Option]>,
3763   HelpText<"Disable merging of globals">;
3764 def mno_pascal_strings : Flag<["-"], "mno-pascal-strings">,
3765   Alias<fno_pascal_strings>;
3766 def mno_red_zone : Flag<["-"], "mno-red-zone">, Group<m_Group>;
3767 def mno_tls_direct_seg_refs : Flag<["-"], "mno-tls-direct-seg-refs">, Group<m_Group>, Flags<[CC1Option]>,
3768   HelpText<"Disable direct TLS access through segment registers">,
3769   MarshallingInfoFlag<CodeGenOpts<"IndirectTlsSegRefs">>;
3770 def mno_relax_all : Flag<["-"], "mno-relax-all">, Group<m_Group>;
3771 let Flags = [TargetSpecific] in {
3772 def mno_rtd: Flag<["-"], "mno-rtd">, Group<m_Group>;
3773 def mno_soft_float : Flag<["-"], "mno-soft-float">, Group<m_Group>;
3774 def mno_stackrealign : Flag<["-"], "mno-stackrealign">, Group<m_Group>;
3775 } // let Flags = [TargetSpecific]
3776
3777 def mretpoline : Flag<["-"], "mretpoline">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>;
3778 def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>;
3779 defm speculative_load_hardening : BoolOption<"m", "speculative-load-hardening",
3780   CodeGenOpts<"SpeculativeLoadHardening">, DefaultFalse,
3781   PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
3782   Group<m_Group>;
3783 def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3784   HelpText<"Enable all mitigations for Load Value Injection (LVI)">;
3785 def mno_lvi_hardening : Flag<["-"], "mno-lvi-hardening">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3786   HelpText<"Disable mitigations for Load Value Injection (LVI)">;
3787 def mlvi_cfi : Flag<["-"], "mlvi-cfi">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3788   HelpText<"Enable only control-flow mitigations for Load Value Injection (LVI)">;
3789 def mno_lvi_cfi : Flag<["-"], "mno-lvi-cfi">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3790   HelpText<"Disable control-flow mitigations for Load Value Injection (LVI)">;
3791 def m_seses : Flag<["-"], "mseses">, Group<m_Group>, Flags<[CoreOption, NoXarchOption]>,
3792   HelpText<"Enable speculative execution side effect suppression (SESES). "
3793     "Includes LVI control flow integrity mitigations">;
3794 def mno_seses : Flag<["-"], "mno-seses">, Group<m_Group>, Flags<[CoreOption, NoXarchOption]>,
3795   HelpText<"Disable speculative execution side effect suppression (SESES)">;
3796
3797 def mrelax : Flag<["-"], "mrelax">, Group<m_Group>,
3798   HelpText<"Enable linker relaxation">;
3799 def mno_relax : Flag<["-"], "mno-relax">, Group<m_Group>,
3800   HelpText<"Disable linker relaxation">;
3801 def msmall_data_limit_EQ : Joined<["-"], "msmall-data-limit=">, Group<m_Group>,
3802   Alias<G>,
3803   HelpText<"Put global and static data smaller than the limit into a special section">;
3804 let Flags = [TargetSpecific] in {
3805 def msave_restore : Flag<["-"], "msave-restore">, Group<m_riscv_Features_Group>,
3806   HelpText<"Enable using library calls for save and restore">;
3807 def mno_save_restore : Flag<["-"], "mno-save-restore">, Group<m_riscv_Features_Group>,
3808   HelpText<"Disable using library calls for save and restore">;
3809 } // let Flags = [TargetSpecific]
3810 def mcmodel_EQ_medlow : Flag<["-"], "mcmodel=medlow">, Group<m_Group>,
3811   Flags<[CC1Option]>, Alias<mcmodel_EQ>, AliasArgs<["small"]>,
3812   HelpText<"Equivalent to -mcmodel=small, compatible with RISC-V gcc.">;
3813 def mcmodel_EQ_medany : Flag<["-"], "mcmodel=medany">, Group<m_Group>,
3814   Flags<[CC1Option]>, Alias<mcmodel_EQ>, AliasArgs<["medium"]>,
3815   HelpText<"Equivalent to -mcmodel=medium, compatible with RISC-V gcc.">;
3816 let Flags = [TargetSpecific] in {
3817 def menable_experimental_extensions : Flag<["-"], "menable-experimental-extensions">, Group<m_Group>,
3818   HelpText<"Enable use of experimental RISC-V extensions.">;
3819 def mrvv_vector_bits_EQ : Joined<["-"], "mrvv-vector-bits=">, Group<m_Group>,
3820   HelpText<"Specify the size in bits of an RVV vector register. Defaults to "
3821            "the vector length agnostic value of \"scalable\". Accepts power of "
3822            "2 values between 64 and 65536. Also accepts \"zvl\" "
3823            "to use the value implied by -march/-mcpu. Value will be reflected "
3824            "in __riscv_v_fixed_vlen preprocessor define (RISC-V only)">;
3825
3826 def munaligned_access : Flag<["-"], "munaligned-access">, Group<m_Group>,
3827   HelpText<"Allow memory accesses to be unaligned (AArch32/AArch64/LoongArch only)">;
3828 def mno_unaligned_access : Flag<["-"], "mno-unaligned-access">, Group<m_Group>,
3829   HelpText<"Force all memory accesses to be aligned (AArch32/AArch64/LoongArch only)">;
3830 } // let Flags = [TargetSpecific]
3831 def mstrict_align : Flag<["-"], "mstrict-align">, Alias<mno_unaligned_access>, Flags<[CC1Option,HelpHidden]>,
3832   HelpText<"Force all memory accesses to be aligned (same as mno-unaligned-access)">;
3833 def mno_strict_align : Flag<["-"], "mno-strict-align">, Alias<munaligned_access>, Flags<[CC1Option,HelpHidden]>,
3834   HelpText<"Allow memory accesses to be unaligned (same as munaligned-access)">;
3835 let Flags = [TargetSpecific] in {
3836 def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_arm_Features_Group>;
3837 def mrestrict_it: Flag<["-"], "mrestrict-it">, Group<m_arm_Features_Group>,
3838   HelpText<"Disallow generation of complex IT blocks. It is off by default.">;
3839 def mno_restrict_it: Flag<["-"], "mno-restrict-it">, Group<m_arm_Features_Group>,
3840   HelpText<"Allow generation of complex IT blocks.">;
3841 def marm : Flag<["-"], "marm">, Alias<mno_thumb>;
3842 def ffixed_r9 : Flag<["-"], "ffixed-r9">, Group<m_arm_Features_Group>,
3843   HelpText<"Reserve the r9 register (ARM only)">;
3844 def mno_movt : Flag<["-"], "mno-movt">, Group<m_arm_Features_Group>,
3845   HelpText<"Disallow use of movt/movw pairs (ARM only)">;
3846 def mcrc : Flag<["-"], "mcrc">, Group<m_Group>,
3847   HelpText<"Allow use of CRC instructions (ARM/Mips only)">;
3848 def mnocrc : Flag<["-"], "mnocrc">, Group<m_arm_Features_Group>,
3849   HelpText<"Disallow use of CRC instructions (ARM only)">;
3850 def mno_neg_immediates: Flag<["-"], "mno-neg-immediates">, Group<m_arm_Features_Group>,
3851   HelpText<"Disallow converting instructions with negative immediates to their negation or inversion.">;
3852 } // let Flags = [TargetSpecific]
3853 def mcmse : Flag<["-"], "mcmse">, Group<m_arm_Features_Group>,
3854   Flags<[NoXarchOption,CC1Option]>,
3855   HelpText<"Allow use of CMSE (Armv8-M Security Extensions)">,
3856   MarshallingInfoFlag<LangOpts<"Cmse">>;
3857 def ForceAAPCSBitfieldLoad : Flag<["-"], "faapcs-bitfield-load">, Group<m_arm_Features_Group>,
3858   Flags<[NoXarchOption,CC1Option]>,
3859   HelpText<"Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).">,
3860   MarshallingInfoFlag<CodeGenOpts<"ForceAAPCSBitfieldLoad">>;
3861 defm aapcs_bitfield_width : BoolOption<"f", "aapcs-bitfield-width",
3862   CodeGenOpts<"AAPCSBitfieldWidth">, DefaultTrue,
3863   NegFlag<SetFalse, [], "Do not follow">, PosFlag<SetTrue, [], "Follow">,
3864   BothFlags<[NoXarchOption, CC1Option], " the AAPCS standard requirement stating that"
3865             " volatile bit-field width is dictated by the field container type. (ARM only).">>,
3866   Group<m_arm_Features_Group>;
3867 let Flags = [TargetSpecific] in {
3868 def mframe_chain : Joined<["-"], "mframe-chain=">,
3869   Group<m_arm_Features_Group>, Values<"none,aapcs,aapcs+leaf">,
3870   HelpText<"Select the frame chain model used to emit frame records (Arm only).">;
3871 def mgeneral_regs_only : Flag<["-"], "mgeneral-regs-only">, Group<m_Group>,
3872   HelpText<"Generate code which only uses the general purpose registers (AArch64/x86 only)">;
3873 def mfix_cmse_cve_2021_35465 : Flag<["-"], "mfix-cmse-cve-2021-35465">,
3874   Group<m_arm_Features_Group>,
3875   HelpText<"Work around VLLDM erratum CVE-2021-35465 (ARM only)">;
3876 def mno_fix_cmse_cve_2021_35465 : Flag<["-"], "mno-fix-cmse-cve-2021-35465">,
3877   Group<m_arm_Features_Group>,
3878   HelpText<"Don't work around VLLDM erratum CVE-2021-35465 (ARM only)">;
3879 def mfix_cortex_a57_aes_1742098 : Flag<["-"], "mfix-cortex-a57-aes-1742098">,
3880   Group<m_arm_Features_Group>,
3881   HelpText<"Work around Cortex-A57 Erratum 1742098 (ARM only)">;
3882 def mno_fix_cortex_a57_aes_1742098 : Flag<["-"], "mno-fix-cortex-a57-aes-1742098">,
3883   Group<m_arm_Features_Group>,
3884   HelpText<"Don't work around Cortex-A57 Erratum 1742098 (ARM only)">;
3885 def mfix_cortex_a72_aes_1655431 : Flag<["-"], "mfix-cortex-a72-aes-1655431">,
3886   Group<m_arm_Features_Group>,
3887   HelpText<"Work around Cortex-A72 Erratum 1655431 (ARM only)">,
3888   Alias<mfix_cortex_a57_aes_1742098>;
3889 def mno_fix_cortex_a72_aes_1655431 : Flag<["-"], "mno-fix-cortex-a72-aes-1655431">,
3890   Group<m_arm_Features_Group>,
3891   HelpText<"Don't work around Cortex-A72 Erratum 1655431 (ARM only)">,
3892   Alias<mno_fix_cortex_a57_aes_1742098>;
3893 def mfix_cortex_a53_835769 : Flag<["-"], "mfix-cortex-a53-835769">,
3894   Group<m_aarch64_Features_Group>,
3895   HelpText<"Workaround Cortex-A53 erratum 835769 (AArch64 only)">;
3896 def mno_fix_cortex_a53_835769 : Flag<["-"], "mno-fix-cortex-a53-835769">,
3897   Group<m_aarch64_Features_Group>,
3898   HelpText<"Don't workaround Cortex-A53 erratum 835769 (AArch64 only)">;
3899 def mmark_bti_property : Flag<["-"], "mmark-bti-property">,
3900   Group<m_aarch64_Features_Group>,
3901   HelpText<"Add .note.gnu.property with BTI to assembly files (AArch64 only)">;
3902 def mno_bti_at_return_twice : Flag<["-"], "mno-bti-at-return-twice">,
3903   Group<m_arm_Features_Group>,
3904   HelpText<"Do not add a BTI instruction after a setjmp or other"
3905            " return-twice construct (Arm/AArch64 only)">;
3906
3907 foreach i = {1-31} in
3908   def ffixed_x#i : Flag<["-"], "ffixed-x"#i>, Group<m_Group>,
3909     HelpText<"Reserve the x"#i#" register (AArch64/RISC-V only)">;
3910
3911 foreach i = {8-15,18} in
3912   def fcall_saved_x#i : Flag<["-"], "fcall-saved-x"#i>, Group<m_aarch64_Features_Group>,
3913     HelpText<"Make the x"#i#" register call-saved (AArch64 only)">;
3914
3915 def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">, Group<m_aarch64_Features_Group>,
3916   HelpText<"Specify the size in bits of an SVE vector register. Defaults to the"
3917            " vector length agnostic value of \"scalable\". (AArch64 only)">;
3918 } // let Flags = [TargetSpecific]
3919
3920 def mvscale_min_EQ : Joined<["-"], "mvscale-min=">,
3921   Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
3922   HelpText<"Specify the vscale minimum. Defaults to \"1\". (AArch64/RISC-V only)">,
3923   MarshallingInfoInt<LangOpts<"VScaleMin">>;
3924 def mvscale_max_EQ : Joined<["-"], "mvscale-max=">,
3925   Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
3926   HelpText<"Specify the vscale maximum. Defaults to the"
3927            " vector length agnostic value of \"0\". (AArch64/RISC-V only)">,
3928   MarshallingInfoInt<LangOpts<"VScaleMax">>;
3929
3930 def msign_return_address_EQ : Joined<["-"], "msign-return-address=">,
3931   Flags<[CC1Option]>, Group<m_Group>, Values<"none,all,non-leaf">,
3932   HelpText<"Select return address signing scope">;
3933 let Flags = [TargetSpecific] in {
3934 def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">,
3935   Group<m_Group>,
3936   HelpText<"Enforce targets of indirect branches and function returns">;
3937
3938 def mharden_sls_EQ : Joined<["-"], "mharden-sls=">, Group<m_Group>,
3939   HelpText<"Select straight-line speculation hardening scope (ARM/AArch64/X86"
3940            " only). <arg> must be: all, none, retbr(ARM/AArch64),"
3941            " blr(ARM/AArch64), comdat(ARM/AArch64), nocomdat(ARM/AArch64),"
3942            " return(X86), indirect-jmp(X86)">;
3943
3944 def msimd128 : Flag<["-"], "msimd128">, Group<m_wasm_Features_Group>;
3945 def mno_simd128 : Flag<["-"], "mno-simd128">, Group<m_wasm_Features_Group>;
3946 def mrelaxed_simd : Flag<["-"], "mrelaxed-simd">, Group<m_wasm_Features_Group>;
3947 def mno_relaxed_simd : Flag<["-"], "mno-relaxed-simd">, Group<m_wasm_Features_Group>;
3948 def mnontrapping_fptoint : Flag<["-"], "mnontrapping-fptoint">, Group<m_wasm_Features_Group>;
3949 def mno_nontrapping_fptoint : Flag<["-"], "mno-nontrapping-fptoint">, Group<m_wasm_Features_Group>;
3950 def msign_ext : Flag<["-"], "msign-ext">, Group<m_wasm_Features_Group>;
3951 def mno_sign_ext : Flag<["-"], "mno-sign-ext">, Group<m_wasm_Features_Group>;
3952 def mexception_handing : Flag<["-"], "mexception-handling">, Group<m_wasm_Features_Group>;
3953 def mno_exception_handing : Flag<["-"], "mno-exception-handling">, Group<m_wasm_Features_Group>;
3954 def matomics : Flag<["-"], "matomics">, Group<m_wasm_Features_Group>;
3955 def mno_atomics : Flag<["-"], "mno-atomics">, Group<m_wasm_Features_Group>;
3956 def mbulk_memory : Flag<["-"], "mbulk-memory">, Group<m_wasm_Features_Group>;
3957 def mno_bulk_memory : Flag<["-"], "mno-bulk-memory">, Group<m_wasm_Features_Group>;
3958 def mmutable_globals : Flag<["-"], "mmutable-globals">, Group<m_wasm_Features_Group>;
3959 def mno_mutable_globals : Flag<["-"], "mno-mutable-globals">, Group<m_wasm_Features_Group>;
3960 def mmultivalue : Flag<["-"], "mmultivalue">, Group<m_wasm_Features_Group>;
3961 def mno_multivalue : Flag<["-"], "mno-multivalue">, Group<m_wasm_Features_Group>;
3962 def mtail_call : Flag<["-"], "mtail-call">, Group<m_wasm_Features_Group>;
3963 def mno_tail_call : Flag<["-"], "mno-tail-call">, Group<m_wasm_Features_Group>;
3964 def mreference_types : Flag<["-"], "mreference-types">, Group<m_wasm_Features_Group>;
3965 def mno_reference_types : Flag<["-"], "mno-reference-types">, Group<m_wasm_Features_Group>;
3966 def mextended_const : Flag<["-"], "mextended-const">, Group<m_wasm_Features_Group>;
3967 def mno_extended_const : Flag<["-"], "mno-extended-const">, Group<m_wasm_Features_Group>;
3968 def mexec_model_EQ : Joined<["-"], "mexec-model=">, Group<m_wasm_Features_Driver_Group>,
3969                      Values<"command,reactor">,
3970                      HelpText<"Execution model (WebAssembly only)">,
3971   DocBrief<"Select between \"command\" and \"reactor\" executable models. "
3972            "Commands have a main-function which scopes the lifetime of the "
3973            "program. Reactors are activated and remain active until "
3974            "explicitly terminated.">;
3975 } // let Flags = [TargetSpecific]
3976
3977 defm amdgpu_ieee : BoolOption<"m", "amdgpu-ieee",
3978   CodeGenOpts<"EmitIEEENaNCompliantInsts">, DefaultTrue,
3979   PosFlag<SetTrue, [], "Sets the IEEE bit in the expected default floating point "
3980   " mode register. Floating point opcodes that support exception flag "
3981   "gathering quiet and propagate signaling NaN inputs per IEEE 754-2008. "
3982   "This option changes the ABI. (AMDGPU only)">,
3983   NegFlag<SetFalse, [CC1Option]>>, Group<m_Group>;
3984
3985 def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
3986   HelpText<"Specify code object ABI version. Defaults to 4. (AMDGPU only)">,
3987   Flags<[CC1Option]>,
3988   Values<"none,2,3,4,5">,
3989   NormalizedValuesScope<"TargetOptions">,
3990   NormalizedValues<["COV_None", "COV_2", "COV_3", "COV_4", "COV_5"]>,
3991   MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_4">;
3992
3993 defm cumode : SimpleMFlag<"cumode",
3994   "Specify CU wavefront", "Specify WGP wavefront",
3995   " execution mode (AMDGPU only)", m_amdgpu_Features_Group>;
3996 defm tgsplit : SimpleMFlag<"tgsplit", "Enable", "Disable",
3997   " threadgroup split execution mode (AMDGPU only)", m_amdgpu_Features_Group>;
3998 defm wavefrontsize64 : SimpleMFlag<"wavefrontsize64",
3999   "Specify wavefront size 64", "Specify wavefront size 32",
4000   " mode (AMDGPU only)">;
4001
4002 defm unsafe_fp_atomics : BoolOption<"m", "unsafe-fp-atomics",
4003   TargetOpts<"AllowAMDGPUUnsafeFPAtomics">, DefaultFalse,
4004   PosFlag<SetTrue, [CC1Option], "Enable generation of unsafe floating point "
4005           "atomic instructions. May generate more efficient code, but may not "
4006           "respect rounding and denormal modes, and may give incorrect results "
4007           "for certain memory destinations. (AMDGPU only)">,
4008   NegFlag<SetFalse>>, Group<m_Group>;
4009
4010 def faltivec : Flag<["-"], "faltivec">, Group<f_Group>, Flags<[NoXarchOption]>;
4011 def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>, Flags<[NoXarchOption]>;
4012 let Flags = [TargetSpecific] in {
4013 def maltivec : Flag<["-"], "maltivec">, Group<m_ppc_Features_Group>,
4014   HelpText<"Enable AltiVec vector initializer syntax">;
4015 def mno_altivec : Flag<["-"], "mno-altivec">, Group<m_ppc_Features_Group>;
4016 def mpcrel: Flag<["-"], "mpcrel">, Group<m_ppc_Features_Group>;
4017 def mno_pcrel: Flag<["-"], "mno-pcrel">, Group<m_ppc_Features_Group>;
4018 def mprefixed: Flag<["-"], "mprefixed">, Group<m_ppc_Features_Group>;
4019 def mno_prefixed: Flag<["-"], "mno-prefixed">, Group<m_ppc_Features_Group>;
4020 def mspe : Flag<["-"], "mspe">, Group<m_ppc_Features_Group>;
4021 def mno_spe : Flag<["-"], "mno-spe">, Group<m_ppc_Features_Group>;
4022 def mefpu2 : Flag<["-"], "mefpu2">, Group<m_ppc_Features_Group>;
4023 } // let Flags = [TargetSpecific]
4024 def mabi_EQ_quadword_atomics : Flag<["-"], "mabi=quadword-atomics">,
4025   Group<m_Group>, Flags<[CC1Option]>,
4026   HelpText<"Enable quadword atomics ABI on AIX (AIX PPC64 only). Uses lqarx/stqcx. instructions.">,
4027   MarshallingInfoFlag<LangOpts<"EnableAIXQuadwordAtomicsABI">>;
4028 let Flags = [TargetSpecific] in {
4029 def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>;
4030 def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>;
4031 def msecure_plt : Flag<["-"], "msecure-plt">, Group<m_ppc_Features_Group>;
4032 def mpower8_vector : Flag<["-"], "mpower8-vector">,
4033     Group<m_ppc_Features_Group>;
4034 def mno_power8_vector : Flag<["-"], "mno-power8-vector">,
4035     Group<m_ppc_Features_Group>;
4036 def mpower9_vector : Flag<["-"], "mpower9-vector">,
4037     Group<m_ppc_Features_Group>;
4038 def mno_power9_vector : Flag<["-"], "mno-power9-vector">,
4039     Group<m_ppc_Features_Group>;
4040 def mpower10_vector : Flag<["-"], "mpower10-vector">,
4041     Group<m_ppc_Features_Group>;
4042 def mno_power10_vector : Flag<["-"], "mno-power10-vector">,
4043     Group<m_ppc_Features_Group>;
4044 def mpower8_crypto : Flag<["-"], "mcrypto">,
4045     Group<m_ppc_Features_Group>;
4046 def mnopower8_crypto : Flag<["-"], "mno-crypto">,
4047     Group<m_ppc_Features_Group>;
4048 def mdirect_move : Flag<["-"], "mdirect-move">,
4049     Group<m_ppc_Features_Group>;
4050 def mnodirect_move : Flag<["-"], "mno-direct-move">,
4051     Group<m_ppc_Features_Group>;
4052 def mpaired_vector_memops: Flag<["-"], "mpaired-vector-memops">,
4053     Group<m_ppc_Features_Group>;
4054 def mnopaired_vector_memops: Flag<["-"], "mno-paired-vector-memops">,
4055     Group<m_ppc_Features_Group>;
4056 def mhtm : Flag<["-"], "mhtm">, Group<m_ppc_Features_Group>;
4057 def mno_htm : Flag<["-"], "mno-htm">, Group<m_ppc_Features_Group>;
4058 def mfprnd : Flag<["-"], "mfprnd">, Group<m_ppc_Features_Group>;
4059 def mno_fprnd : Flag<["-"], "mno-fprnd">, Group<m_ppc_Features_Group>;
4060 def mcmpb : Flag<["-"], "mcmpb">, Group<m_ppc_Features_Group>;
4061 def mno_cmpb : Flag<["-"], "mno-cmpb">, Group<m_ppc_Features_Group>;
4062 def misel : Flag<["-"], "misel">, Group<m_ppc_Features_Group>;
4063 def mno_isel : Flag<["-"], "mno-isel">, Group<m_ppc_Features_Group>;
4064 def mmfocrf : Flag<["-"], "mmfocrf">, Group<m_ppc_Features_Group>;
4065 def mmfcrf : Flag<["-"], "mmfcrf">, Alias<mmfocrf>;
4066 def mno_mfocrf : Flag<["-"], "mno-mfocrf">, Group<m_ppc_Features_Group>;
4067 def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Alias<mno_mfocrf>;
4068 def mpopcntd : Flag<["-"], "mpopcntd">, Group<m_ppc_Features_Group>;
4069 def mno_popcntd : Flag<["-"], "mno-popcntd">, Group<m_ppc_Features_Group>;
4070 def mcrbits : Flag<["-"], "mcrbits">, Group<m_ppc_Features_Group>,
4071     HelpText<"Control the CR-bit tracking feature on PowerPC. ``-mcrbits`` "
4072              "(the enablement of CR-bit tracking support) is the default for "
4073              "POWER8 and above, as well as for all other CPUs when "
4074              "optimization is applied (-O2 and above).">;
4075 def mno_crbits : Flag<["-"], "mno-crbits">, Group<m_ppc_Features_Group>;
4076 def minvariant_function_descriptors :
4077   Flag<["-"], "minvariant-function-descriptors">, Group<m_ppc_Features_Group>;
4078 def mno_invariant_function_descriptors :
4079   Flag<["-"], "mno-invariant-function-descriptors">,
4080   Group<m_ppc_Features_Group>;
4081 def mfloat128: Flag<["-"], "mfloat128">,
4082     Group<m_ppc_Features_Group>;
4083 def mno_float128 : Flag<["-"], "mno-float128">,
4084     Group<m_ppc_Features_Group>;
4085 def mlongcall: Flag<["-"], "mlongcall">,
4086     Group<m_ppc_Features_Group>;
4087 def mno_longcall : Flag<["-"], "mno-longcall">,
4088     Group<m_ppc_Features_Group>;
4089 def mmma: Flag<["-"], "mmma">, Group<m_ppc_Features_Group>;
4090 def mno_mma: Flag<["-"], "mno-mma">, Group<m_ppc_Features_Group>;
4091 def mrop_protect : Flag<["-"], "mrop-protect">,
4092     Group<m_ppc_Features_Group>;
4093 def mprivileged : Flag<["-"], "mprivileged">,
4094     Group<m_ppc_Features_Group>;
4095 } // let Flags = [TargetSpecific]
4096 def maix_struct_return : Flag<["-"], "maix-struct-return">,
4097   Group<m_Group>, Flags<[CC1Option]>,
4098   HelpText<"Return all structs in memory (PPC32 only)">,
4099   DocBrief<"Override the default ABI for 32-bit targets to return all "
4100            "structs in memory, as in the Power 32-bit ABI for Linux (2011), "
4101            "and on AIX and Darwin.">;
4102 def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">,
4103   Group<m_Group>, Flags<[CC1Option]>,
4104   HelpText<"Return small structs in registers (PPC32 only)">,
4105   DocBrief<"Override the default ABI for 32-bit targets to return small "
4106            "structs in registers, as in the System V ABI (1995).">;
4107 def mxcoff_roptr : Flag<["-"], "mxcoff-roptr">, Group<m_Group>, Flags<[CC1Option,TargetSpecific]>,
4108   HelpText<"Place constant objects with relocatable address values in the RO data section and add -bforceimprw to the linker flags (AIX only)">;
4109 def mno_xcoff_roptr : Flag<["-"], "mno-xcoff-roptr">, Group<m_Group>, TargetSpecific;
4110
4111 let Flags = [TargetSpecific] in {
4112 def mvx : Flag<["-"], "mvx">, Group<m_Group>;
4113 def mno_vx : Flag<["-"], "mno-vx">, Group<m_Group>;
4114 } // let Flags = [TargetSpecific]
4115
4116 defm zvector : BoolFOption<"zvector",
4117   LangOpts<"ZVector">, DefaultFalse,
4118   PosFlag<SetTrue, [CC1Option], "Enable System z vector language extension">,
4119   NegFlag<SetFalse>>;
4120 def mzvector : Flag<["-"], "mzvector">, Alias<fzvector>;
4121 def mno_zvector : Flag<["-"], "mno-zvector">, Alias<fno_zvector>;
4122
4123 def mxcoff_build_id_EQ : Joined<["-"], "mxcoff-build-id=">, Group<Link_Group>, MetaVarName<"<0xHEXSTRING>">,
4124   HelpText<"On AIX, request creation of a build-id string, \"0xHEXSTRING\", in the string table of the loader section inside the linked binary">;
4125 def mignore_xcoff_visibility : Flag<["-"], "mignore-xcoff-visibility">, Group<m_Group>,
4126 HelpText<"Not emit the visibility attribute for asm in AIX OS or give all symbols 'unspecified' visibility in XCOFF object file">,
4127   Flags<[CC1Option,TargetSpecific]>;
4128 defm backchain : BoolOption<"m", "backchain",
4129   CodeGenOpts<"Backchain">, DefaultFalse,
4130   PosFlag<SetTrue, [], "Link stack frames through backchain on System Z">,
4131   NegFlag<SetFalse>, BothFlags<[NoXarchOption,CC1Option]>>, Group<m_Group>;
4132
4133 def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings">, Group<m_Group>;
4134 def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Group<m_Group>;
4135 def momit_leaf_frame_pointer : Flag<["-"], "momit-leaf-frame-pointer">, Group<m_Group>,
4136   HelpText<"Omit frame pointer setup for leaf functions">;
4137 def moslib_EQ : Joined<["-"], "moslib=">, Group<m_Group>;
4138 def mpascal_strings : Flag<["-"], "mpascal-strings">, Alias<fpascal_strings>;
4139 def mred_zone : Flag<["-"], "mred-zone">, Group<m_Group>;
4140 def mtls_direct_seg_refs : Flag<["-"], "mtls-direct-seg-refs">, Group<m_Group>,
4141   HelpText<"Enable direct TLS access through segment registers (default)">;
4142 def mregparm_EQ : Joined<["-"], "mregparm=">, Group<m_Group>;
4143 def mrelax_all : Flag<["-"], "mrelax-all">, Group<m_Group>, Flags<[CC1Option,CC1AsOption]>,
4144   HelpText<"(integrated-as) Relax all machine instructions">,
4145   MarshallingInfoFlag<CodeGenOpts<"RelaxAll">>;
4146 def mincremental_linker_compatible : Flag<["-"], "mincremental-linker-compatible">, Group<m_Group>,
4147   Flags<[CC1Option,CC1AsOption]>,
4148   HelpText<"(integrated-as) Emit an object file which can be used with an incremental linker">,
4149   MarshallingInfoFlag<CodeGenOpts<"IncrementalLinkerCompatible">>;
4150 def mno_incremental_linker_compatible : Flag<["-"], "mno-incremental-linker-compatible">, Group<m_Group>,
4151   HelpText<"(integrated-as) Emit an object file which cannot be used with an incremental linker">;
4152 def mrtd : Flag<["-"], "mrtd">, Group<m_Group>, Flags<[CC1Option]>,
4153   HelpText<"Make StdCall calling convention the default">;
4154 def msmall_data_threshold_EQ : Joined <["-"], "msmall-data-threshold=">,
4155   Group<m_Group>, Alias<G>;
4156 def msoft_float : Flag<["-"], "msoft-float">, Group<m_Group>, Flags<[CC1Option]>,
4157   HelpText<"Use software floating point">,
4158   MarshallingInfoFlag<CodeGenOpts<"SoftFloat">>;
4159 def mno_fmv : Flag<["-"], "mno-fmv">, Group<f_clang_Group>, Flags<[CC1Option]>,
4160   HelpText<"Disable function multiversioning">;
4161 def moutline_atomics : Flag<["-"], "moutline-atomics">, Group<f_clang_Group>, Flags<[CC1Option]>,
4162   HelpText<"Generate local calls to out-of-line atomic operations">;
4163 def mno_outline_atomics : Flag<["-"], "mno-outline-atomics">, Group<f_clang_Group>, Flags<[CC1Option]>,
4164   HelpText<"Don't generate local calls to out-of-line atomic operations">;
4165 def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group<m_Group>,
4166   HelpText<"Don't generate implicit floating point or vector instructions">;
4167 def mimplicit_float : Flag<["-"], "mimplicit-float">, Group<m_Group>;
4168 def mrecip : Flag<["-"], "mrecip">, Group<m_Group>,
4169   HelpText<"Equivalent to '-mrecip=all'">;
4170 def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group<m_Group>, Flags<[CC1Option]>,
4171   HelpText<"Control use of approximate reciprocal and reciprocal square root instructions followed by <n> iterations of "
4172            "Newton-Raphson refinement. "
4173            "<value> = ( ['!'] ['vec-'] ('rcp'|'sqrt') [('h'|'s'|'d')] [':'<n>] ) | 'all' | 'default' | 'none'">,
4174   MarshallingInfoStringVector<CodeGenOpts<"Reciprocals">>;
4175 def mprefer_vector_width_EQ : Joined<["-"], "mprefer-vector-width=">, Group<m_Group>, Flags<[CC1Option]>,
4176   HelpText<"Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.">,
4177   MarshallingInfoString<CodeGenOpts<"PreferVectorWidth">>;
4178 def mstack_protector_guard_EQ : Joined<["-"], "mstack-protector-guard=">, Group<m_Group>, Flags<[CC1Option]>,
4179   HelpText<"Use the given guard (global, tls) for addressing the stack-protector guard">,
4180   MarshallingInfoString<CodeGenOpts<"StackProtectorGuard">>;
4181 def mstack_protector_guard_offset_EQ : Joined<["-"], "mstack-protector-guard-offset=">, Group<m_Group>, Flags<[CC1Option]>,
4182   HelpText<"Use the given offset for addressing the stack-protector guard">,
4183   MarshallingInfoInt<CodeGenOpts<"StackProtectorGuardOffset">, "INT_MAX", "int">;
4184 def mstack_protector_guard_symbol_EQ : Joined<["-"], "mstack-protector-guard-symbol=">, Group<m_Group>, Flags<[CC1Option]>,
4185   HelpText<"Use the given symbol for addressing the stack-protector guard">,
4186   MarshallingInfoString<CodeGenOpts<"StackProtectorGuardSymbol">>;
4187 def mstack_protector_guard_reg_EQ : Joined<["-"], "mstack-protector-guard-reg=">, Group<m_Group>, Flags<[CC1Option]>,
4188   HelpText<"Use the given reg for addressing the stack-protector guard">,
4189   MarshallingInfoString<CodeGenOpts<"StackProtectorGuardReg">>;
4190 def mfentry : Flag<["-"], "mfentry">, HelpText<"Insert calls to fentry at function entry (x86/SystemZ only)">,
4191   Flags<[CC1Option]>, Group<m_Group>,
4192   MarshallingInfoFlag<CodeGenOpts<"CallFEntry">>;
4193 def mnop_mcount : Flag<["-"], "mnop-mcount">, HelpText<"Generate mcount/__fentry__ calls as nops. To activate they need to be patched in.">,
4194   Flags<[CC1Option]>, Group<m_Group>,
4195   MarshallingInfoFlag<CodeGenOpts<"MNopMCount">>;
4196 def mrecord_mcount : Flag<["-"], "mrecord-mcount">, HelpText<"Generate a __mcount_loc section entry for each __fentry__ call.">,
4197   Flags<[CC1Option]>, Group<m_Group>,
4198   MarshallingInfoFlag<CodeGenOpts<"RecordMCount">>;
4199 def mpacked_stack : Flag<["-"], "mpacked-stack">, HelpText<"Use packed stack layout (SystemZ only).">,
4200   Flags<[CC1Option]>, Group<m_Group>,
4201   MarshallingInfoFlag<CodeGenOpts<"PackedStack">>;
4202 def mno_packed_stack : Flag<["-"], "mno-packed-stack">, Flags<[CC1Option]>, Group<m_Group>;
4203
4204 let Flags = [TargetSpecific] in {
4205 def mips16 : Flag<["-"], "mips16">, Group<m_mips_Features_Group>;
4206 def mno_mips16 : Flag<["-"], "mno-mips16">, Group<m_mips_Features_Group>;
4207 def mmicromips : Flag<["-"], "mmicromips">, Group<m_mips_Features_Group>;
4208 def mno_micromips : Flag<["-"], "mno-micromips">, Group<m_mips_Features_Group>;
4209 def mxgot : Flag<["-"], "mxgot">, Group<m_mips_Features_Group>;
4210 def mno_xgot : Flag<["-"], "mno-xgot">, Group<m_mips_Features_Group>;
4211 def mldc1_sdc1 : Flag<["-"], "mldc1-sdc1">, Group<m_mips_Features_Group>;
4212 def mno_ldc1_sdc1 : Flag<["-"], "mno-ldc1-sdc1">, Group<m_mips_Features_Group>;
4213 def mcheck_zero_division : Flag<["-"], "mcheck-zero-division">,
4214                            Group<m_mips_Features_Group>;
4215 def mno_check_zero_division : Flag<["-"], "mno-check-zero-division">,
4216                               Group<m_mips_Features_Group>;
4217 def mfix4300 : Flag<["-"], "mfix4300">, Group<m_mips_Features_Group>;
4218 def mcompact_branches_EQ : Joined<["-"], "mcompact-branches=">,
4219                            Group<m_mips_Features_Group>;
4220 } // let Flags = [TargetSpecific]
4221 def mbranch_likely : Flag<["-"], "mbranch-likely">, Group<m_Group>,
4222   IgnoredGCCCompat;
4223 def mno_branch_likely : Flag<["-"], "mno-branch-likely">, Group<m_Group>,
4224   IgnoredGCCCompat;
4225 let Flags = [TargetSpecific] in {
4226 def mindirect_jump_EQ : Joined<["-"], "mindirect-jump=">,
4227   Group<m_mips_Features_Group>,
4228   HelpText<"Change indirect jump instructions to inhibit speculation">;
4229 def mdsp : Flag<["-"], "mdsp">, Group<m_mips_Features_Group>;
4230 def mno_dsp : Flag<["-"], "mno-dsp">, Group<m_mips_Features_Group>;
4231 def mdspr2 : Flag<["-"], "mdspr2">, Group<m_mips_Features_Group>;
4232 def mno_dspr2 : Flag<["-"], "mno-dspr2">, Group<m_mips_Features_Group>;
4233 def msingle_float : Flag<["-"], "msingle-float">, Group<m_Group>;
4234 def mdouble_float : Flag<["-"], "mdouble-float">, Group<m_Group>;
4235 def mmadd4 : Flag<["-"], "mmadd4">, Group<m_mips_Features_Group>,
4236   HelpText<"Enable the generation of 4-operand madd.s, madd.d and related instructions.">;
4237 def mno_madd4 : Flag<["-"], "mno-madd4">, Group<m_mips_Features_Group>,
4238   HelpText<"Disable the generation of 4-operand madd.s, madd.d and related instructions.">;
4239 def mmsa : Flag<["-"], "mmsa">, Group<m_mips_Features_Group>,
4240   HelpText<"Enable MSA ASE (MIPS only)">;
4241 def mno_msa : Flag<["-"], "mno-msa">, Group<m_mips_Features_Group>,
4242   HelpText<"Disable MSA ASE (MIPS only)">;
4243 def mmt : Flag<["-"], "mmt">, Group<m_mips_Features_Group>,
4244   HelpText<"Enable MT ASE (MIPS only)">;
4245 def mno_mt : Flag<["-"], "mno-mt">, Group<m_mips_Features_Group>,
4246   HelpText<"Disable MT ASE (MIPS only)">;
4247 def mfp64 : Flag<["-"], "mfp64">, Group<m_mips_Features_Group>,
4248   HelpText<"Use 64-bit floating point registers (MIPS only)">;
4249 def mfp32 : Flag<["-"], "mfp32">, Group<m_mips_Features_Group>,
4250   HelpText<"Use 32-bit floating point registers (MIPS only)">;
4251 def mgpopt : Flag<["-"], "mgpopt">, Group<m_mips_Features_Group>,
4252   HelpText<"Use GP relative accesses for symbols known to be in a small"
4253            " data section (MIPS)">;
4254 def mno_gpopt : Flag<["-"], "mno-gpopt">, Group<m_mips_Features_Group>,
4255   HelpText<"Do not use GP relative accesses for symbols known to be in a small"
4256            " data section (MIPS)">;
4257 def mlocal_sdata : Flag<["-"], "mlocal-sdata">,
4258   Group<m_mips_Features_Group>,
4259   HelpText<"Extend the -G behaviour to object local data (MIPS)">;
4260 def mno_local_sdata : Flag<["-"], "mno-local-sdata">,
4261   Group<m_mips_Features_Group>,
4262   HelpText<"Do not extend the -G behaviour to object local data (MIPS)">;
4263 def mextern_sdata : Flag<["-"], "mextern-sdata">,
4264   Group<m_mips_Features_Group>,
4265   HelpText<"Assume that externally defined data is in the small data if it"
4266            " meets the -G <size> threshold (MIPS)">;
4267 def mno_extern_sdata : Flag<["-"], "mno-extern-sdata">,
4268   Group<m_mips_Features_Group>,
4269   HelpText<"Do not assume that externally defined data is in the small data if"
4270            " it meets the -G <size> threshold (MIPS)">;
4271 def membedded_data : Flag<["-"], "membedded-data">,
4272   Group<m_mips_Features_Group>,
4273   HelpText<"Place constants in the .rodata section instead of the .sdata "
4274            "section even if they meet the -G <size> threshold (MIPS)">;
4275 def mno_embedded_data : Flag<["-"], "mno-embedded-data">,
4276   Group<m_mips_Features_Group>,
4277   HelpText<"Do not place constants in the .rodata section instead of the "
4278            ".sdata if they meet the -G <size> threshold (MIPS)">;
4279 def mnan_EQ : Joined<["-"], "mnan=">, Group<m_mips_Features_Group>;
4280 def mabs_EQ : Joined<["-"], "mabs=">, Group<m_mips_Features_Group>;
4281 def mabicalls : Flag<["-"], "mabicalls">, Group<m_mips_Features_Group>,
4282   HelpText<"Enable SVR4-style position-independent code (Mips only)">;
4283 def mno_abicalls : Flag<["-"], "mno-abicalls">, Group<m_mips_Features_Group>,
4284   HelpText<"Disable SVR4-style position-independent code (Mips only)">;
4285 def mno_crc : Flag<["-"], "mno-crc">, Group<m_mips_Features_Group>,
4286   HelpText<"Disallow use of CRC instructions (Mips only)">;
4287 def mvirt : Flag<["-"], "mvirt">, Group<m_mips_Features_Group>;
4288 def mno_virt : Flag<["-"], "mno-virt">, Group<m_mips_Features_Group>;
4289 def mginv : Flag<["-"], "mginv">, Group<m_mips_Features_Group>;
4290 def mno_ginv : Flag<["-"], "mno-ginv">, Group<m_mips_Features_Group>;
4291 } // let Flags = [TargetSpecific]
4292 def mips1 : Flag<["-"], "mips1">,
4293   Alias<march_EQ>, AliasArgs<["mips1"]>, Group<m_mips_Features_Group>,
4294   HelpText<"Equivalent to -march=mips1">, Flags<[HelpHidden]>;
4295 def mips2 : Flag<["-"], "mips2">,
4296   Alias<march_EQ>, AliasArgs<["mips2"]>, Group<m_mips_Features_Group>,
4297   HelpText<"Equivalent to -march=mips2">, Flags<[HelpHidden]>;
4298 def mips3 : Flag<["-"], "mips3">,
4299   Alias<march_EQ>, AliasArgs<["mips3"]>, Group<m_mips_Features_Group>,
4300   HelpText<"Equivalent to -march=mips3">, Flags<[HelpHidden]>;
4301 def mips4 : Flag<["-"], "mips4">,
4302   Alias<march_EQ>, AliasArgs<["mips4"]>, Group<m_mips_Features_Group>,
4303   HelpText<"Equivalent to -march=mips4">, Flags<[HelpHidden]>;
4304 def mips5 : Flag<["-"], "mips5">,
4305   Alias<march_EQ>, AliasArgs<["mips5"]>, Group<m_mips_Features_Group>,
4306   HelpText<"Equivalent to -march=mips5">, Flags<[HelpHidden]>;
4307 def mips32 : Flag<["-"], "mips32">,
4308   Alias<march_EQ>, AliasArgs<["mips32"]>, Group<m_mips_Features_Group>,
4309   HelpText<"Equivalent to -march=mips32">, Flags<[HelpHidden]>;
4310 def mips32r2 : Flag<["-"], "mips32r2">,
4311   Alias<march_EQ>, AliasArgs<["mips32r2"]>, Group<m_mips_Features_Group>,
4312   HelpText<"Equivalent to -march=mips32r2">, Flags<[HelpHidden]>;
4313 def mips32r3 : Flag<["-"], "mips32r3">,
4314   Alias<march_EQ>, AliasArgs<["mips32r3"]>, Group<m_mips_Features_Group>,
4315   HelpText<"Equivalent to -march=mips32r3">, Flags<[HelpHidden]>;
4316 def mips32r5 : Flag<["-"], "mips32r5">,
4317   Alias<march_EQ>, AliasArgs<["mips32r5"]>, Group<m_mips_Features_Group>,
4318   HelpText<"Equivalent to -march=mips32r5">, Flags<[HelpHidden]>;
4319 def mips32r6 : Flag<["-"], "mips32r6">,
4320   Alias<march_EQ>, AliasArgs<["mips32r6"]>, Group<m_mips_Features_Group>,
4321   HelpText<"Equivalent to -march=mips32r6">, Flags<[HelpHidden]>;
4322 def mips64 : Flag<["-"], "mips64">,
4323   Alias<march_EQ>, AliasArgs<["mips64"]>, Group<m_mips_Features_Group>,
4324   HelpText<"Equivalent to -march=mips64">, Flags<[HelpHidden]>;
4325 def mips64r2 : Flag<["-"], "mips64r2">,
4326   Alias<march_EQ>, AliasArgs<["mips64r2"]>, Group<m_mips_Features_Group>,
4327   HelpText<"Equivalent to -march=mips64r2">, Flags<[HelpHidden]>;
4328 def mips64r3 : Flag<["-"], "mips64r3">,
4329   Alias<march_EQ>, AliasArgs<["mips64r3"]>, Group<m_mips_Features_Group>,
4330   HelpText<"Equivalent to -march=mips64r3">, Flags<[HelpHidden]>;
4331 def mips64r5 : Flag<["-"], "mips64r5">,
4332   Alias<march_EQ>, AliasArgs<["mips64r5"]>, Group<m_mips_Features_Group>,
4333   HelpText<"Equivalent to -march=mips64r5">, Flags<[HelpHidden]>;
4334 def mips64r6 : Flag<["-"], "mips64r6">,
4335   Alias<march_EQ>, AliasArgs<["mips64r6"]>, Group<m_mips_Features_Group>,
4336   HelpText<"Equivalent to -march=mips64r6">, Flags<[HelpHidden]>;
4337 def mfpxx : Flag<["-"], "mfpxx">, Group<m_mips_Features_Group>,
4338   HelpText<"Avoid FPU mode dependent operations when used with the O32 ABI">,
4339   Flags<[HelpHidden]>;
4340 def modd_spreg : Flag<["-"], "modd-spreg">, Group<m_mips_Features_Group>,
4341   HelpText<"Enable odd single-precision floating point registers">,
4342   Flags<[HelpHidden]>;
4343 def mno_odd_spreg : Flag<["-"], "mno-odd-spreg">, Group<m_mips_Features_Group>,
4344   HelpText<"Disable odd single-precision floating point registers">,
4345   Flags<[HelpHidden]>;
4346 def mrelax_pic_calls : Flag<["-"], "mrelax-pic-calls">,
4347   Group<m_mips_Features_Group>,
4348   HelpText<"Produce relaxation hints for linkers to try optimizing PIC "
4349            "call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
4350 def mno_relax_pic_calls : Flag<["-"], "mno-relax-pic-calls">,
4351   Group<m_mips_Features_Group>,
4352   HelpText<"Do not produce relaxation hints for linkers to try optimizing PIC "
4353            "call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
4354 def mglibc : Flag<["-"], "mglibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
4355 def muclibc : Flag<["-"], "muclibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
4356 def module_file_info : Flag<["-"], "module-file-info">, Flags<[NoXarchOption,CC1Option]>, Group<Action_Group>,
4357   HelpText<"Provide information about a particular module file">;
4358 def mthumb : Flag<["-"], "mthumb">, Group<m_Group>;
4359 def mtune_EQ : Joined<["-"], "mtune=">, Group<m_Group>,
4360   HelpText<"Only supported on AArch64, PowerPC, RISC-V, SystemZ, and X86">;
4361 def multi__module : Flag<["-"], "multi_module">;
4362 def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
4363 def multiply__defined : Separate<["-"], "multiply_defined">;
4364 def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Group<m_Group>;
4365 def canonical_prefixes : Flag<["-"], "canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
4366   HelpText<"Use absolute paths for invoking subcommands (default)">;
4367 def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
4368   HelpText<"Use relative paths for invoking subcommands">;
4369 def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>;
4370 def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[NoXarchOption]>;
4371 def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
4372 def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">;
4373 def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>, Group<IncludePath_Group>,
4374   HelpText<"Disable builtin #include directories">,
4375   MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseBuiltinIncludes">>;
4376 def nogpuinc : Flag<["-"], "nogpuinc">, Group<IncludePath_Group>,
4377   HelpText<"Do not add include paths for CUDA/HIP and"
4378   " do not include the default CUDA/HIP wrapper headers">;
4379 def nohipwrapperinc : Flag<["-"], "nohipwrapperinc">, Group<IncludePath_Group>,
4380   HelpText<"Do not include the default HIP wrapper headers and include paths">;
4381 def : Flag<["-"], "nocudainc">, Alias<nogpuinc>;
4382 def nogpulib : Flag<["-"], "nogpulib">, MarshallingInfoFlag<LangOpts<"NoGPULib">>,
4383   Flags<[CC1Option]>, HelpText<"Do not link device library for CUDA/HIP device compilation">;
4384 def : Flag<["-"], "nocudalib">, Alias<nogpulib>;
4385 def nodefaultlibs : Flag<["-"], "nodefaultlibs">;
4386 def nodriverkitlib : Flag<["-"], "nodriverkitlib">;
4387 def nofixprebinding : Flag<["-"], "nofixprebinding">;
4388 def nolibc : Flag<["-"], "nolibc">;
4389 def nomultidefs : Flag<["-"], "nomultidefs">;
4390 def nopie : Flag<["-"], "nopie">;
4391 def no_pie : Flag<["-"], "no-pie">, Alias<nopie>;
4392 def noprebind : Flag<["-"], "noprebind">;
4393 def noprofilelib : Flag<["-"], "noprofilelib">;
4394 def noseglinkedit : Flag<["-"], "noseglinkedit">;
4395 def nostartfiles : Flag<["-"], "nostartfiles">, Group<Link_Group>;
4396 def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>, Group<IncludePath_Group>;
4397 def nostdlibinc : Flag<["-"], "nostdlibinc">, Group<IncludePath_Group>;
4398 def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>, Group<IncludePath_Group>,
4399   HelpText<"Disable standard #include directories for the C++ standard library">,
4400   MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardCXXIncludes">>;
4401 def nostdlib : Flag<["-"], "nostdlib">, Group<Link_Group>;
4402 def nostdlibxx : Flag<["-"], "nostdlib++">;
4403 def object : Flag<["-"], "object">;
4404 def o : JoinedOrSeparate<["-"], "o">, Flags<[NoXarchOption,
4405   CC1Option, CC1AsOption, FC1Option, FlangOption]>,
4406   HelpText<"Write output to <file>">, MetaVarName<"<file>">,
4407   MarshallingInfoString<FrontendOpts<"OutputFile">>;
4408 def object_file_name_EQ : Joined<["-"], "object-file-name=">, Flags<[CC1Option, CC1AsOption, CoreOption]>,
4409   HelpText<"Set the output <file> for debug infos">, MetaVarName<"<file>">,
4410   MarshallingInfoString<CodeGenOpts<"ObjectFilenameForDebug">>;
4411 def object_file_name : Separate<["-"], "object-file-name">, Flags<[CC1Option, CC1AsOption, CoreOption]>,
4412     Alias<object_file_name_EQ>;
4413 def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">;
4414 def pass_exit_codes : Flag<["-", "--"], "pass-exit-codes">, Flags<[Unsupported]>;
4415 def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group<pedantic_Group>, Flags<[CC1Option]>,
4416   MarshallingInfoFlag<DiagnosticOpts<"PedanticErrors">>;
4417 def pedantic : Flag<["-", "--"], "pedantic">, Group<pedantic_Group>, Flags<[CC1Option,FlangOption,FC1Option]>,
4418   HelpText<"Warn on language extensions">, MarshallingInfoFlag<DiagnosticOpts<"Pedantic">>;
4419 def p : Flag<["-"], "p">, HelpText<"Enable mcount instrumentation with prof">;
4420 def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC1Option]>,
4421   MarshallingInfoFlag<CodeGenOpts<"InstrumentForProfiling">>;
4422 def pipe : Flag<["-", "--"], "pipe">,
4423   HelpText<"Use pipes between commands, when possible">;
4424 def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">;
4425 def prebind : Flag<["-"], "prebind">;
4426 def preload : Flag<["-"], "preload">;
4427 def print_file_name_EQ : Joined<["-", "--"], "print-file-name=">,
4428   HelpText<"Print the full library path of <file>">, MetaVarName<"<file>">;
4429 def print_ivar_layout : Flag<["-"], "print-ivar-layout">, Flags<[CC1Option]>,
4430   HelpText<"Enable Objective-C Ivar layout bitmap print trace">,
4431   MarshallingInfoFlag<LangOpts<"ObjCGCBitmapPrint">>;
4432 def print_libgcc_file_name : Flag<["-", "--"], "print-libgcc-file-name">,
4433   HelpText<"Print the library path for the currently used compiler runtime "
4434            "library (\"libgcc.a\" or \"libclang_rt.builtins.*.a\")">;
4435 def print_multi_directory : Flag<["-", "--"], "print-multi-directory">;
4436 def print_multi_lib : Flag<["-", "--"], "print-multi-lib">;
4437 def print_multi_flags : Flag<["-", "--"], "print-multi-flags-experimental">,
4438   HelpText<"Print the flags used for selecting multilibs (experimental)">;
4439 def print_multi_os_directory : Flag<["-", "--"], "print-multi-os-directory">,
4440   Flags<[Unsupported]>;
4441 def print_target_triple : Flag<["-", "--"], "print-target-triple">,
4442   HelpText<"Print the normalized target triple">, Flags<[FlangOption]>;
4443 def print_effective_triple : Flag<["-", "--"], "print-effective-triple">,
4444   HelpText<"Print the effective target triple">, Flags<[FlangOption]>;
4445 // GCC --disable-multiarch, GCC --enable-multiarch (upstream and Debian
4446 // specific) have different behaviors. We choose not to support the option.
4447 def : Flag<["-", "--"], "print-multiarch">, Flags<[Unsupported]>;
4448 def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">,
4449   HelpText<"Print the full program path of <name>">, MetaVarName<"<name>">;
4450 def print_resource_dir : Flag<["-", "--"], "print-resource-dir">,
4451   HelpText<"Print the resource directory pathname">;
4452 def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
4453   HelpText<"Print the paths used for finding libraries and programs">;
4454 def print_targets : Flag<["-", "--"], "print-targets">,
4455   HelpText<"Print the registered targets">;
4456 def print_rocm_search_dirs : Flag<["-", "--"], "print-rocm-search-dirs">,
4457   HelpText<"Print the paths used for finding ROCm installation">;
4458 def print_runtime_dir : Flag<["-", "--"], "print-runtime-dir">,
4459   HelpText<"Print the directory pathname containing clangs runtime libraries">;
4460 def print_diagnostic_options : Flag<["-", "--"], "print-diagnostic-options">,
4461   HelpText<"Print all of Clang's warning options">;
4462 def private__bundle : Flag<["-"], "private_bundle">;
4463 def pthreads : Flag<["-"], "pthreads">;
4464 defm pthread : BoolOption<"", "pthread",
4465   LangOpts<"POSIXThreads">, DefaultFalse,
4466   PosFlag<SetTrue, [], "Support POSIX threads in generated code">,
4467   NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
4468 def pie : Flag<["-"], "pie">, Group<Link_Group>;
4469 def static_pie : Flag<["-"], "static-pie">, Group<Link_Group>;
4470 def read__only__relocs : Separate<["-"], "read_only_relocs">;
4471 def remap : Flag<["-"], "remap">;
4472 def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[NoXarchOption,CC1Option]>,
4473   HelpText<"Rewrite Objective-C source to C++">, Group<Action_Group>;
4474 def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">, Flags<[NoXarchOption]>,
4475   HelpText<"Rewrite Legacy Objective-C source to C++">;
4476 def rdynamic : Flag<["-"], "rdynamic">, Group<Link_Group>;
4477 def resource_dir : Separate<["-"], "resource-dir">,
4478   Flags<[NoXarchOption, CC1Option, CoreOption, HelpHidden]>,
4479   HelpText<"The directory which holds the compiler resource files">,
4480   MarshallingInfoString<HeaderSearchOpts<"ResourceDir">>;
4481 def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[NoXarchOption, CoreOption]>,
4482   Alias<resource_dir>;
4483 def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>, Group<Link_Group>;
4484 def rtlib_EQ : Joined<["-", "--"], "rtlib=">,
4485   HelpText<"Compiler runtime library to use">;
4486 def frtlib_add_rpath: Flag<["-"], "frtlib-add-rpath">, Flags<[NoArgumentUnused]>,
4487   HelpText<"Add -rpath with architecture-specific resource directory to the linker flags. "
4488   "When --hip-link is specified, also add -rpath with HIP runtime library directory to the linker flags">;
4489 def fno_rtlib_add_rpath: Flag<["-"], "fno-rtlib-add-rpath">, Flags<[NoArgumentUnused]>,
4490   HelpText<"Do not add -rpath with architecture-specific resource directory to the linker flags. "
4491   "When --hip-link is specified, do not add -rpath with HIP runtime library directory to the linker flags">;
4492 def offload_add_rpath: Flag<["--"], "offload-add-rpath">, Flags<[NoArgumentUnused]>,
4493   Alias<frtlib_add_rpath>;
4494 def no_offload_add_rpath: Flag<["--"], "no-offload-add-rpath">, Flags<[NoArgumentUnused]>,
4495   Alias<frtlib_add_rpath>;
4496 def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>,
4497         Group<Link_Group>;
4498 def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[CC1Option, FlangOption, FC1Option, NoXarchOption]>,
4499   HelpText<"Save intermediate compilation results.">;
4500 def save_temps : Flag<["-", "--"], "save-temps">, Flags<[FlangOption, FC1Option, NoXarchOption]>,
4501   Alias<save_temps_EQ>, AliasArgs<["cwd"]>,
4502   HelpText<"Save intermediate compilation results">;
4503 def save_stats_EQ : Joined<["-", "--"], "save-stats=">, Flags<[NoXarchOption]>,
4504   HelpText<"Save llvm statistics.">;
4505 def save_stats : Flag<["-", "--"], "save-stats">, Flags<[NoXarchOption]>,
4506   Alias<save_stats_EQ>, AliasArgs<["cwd"]>,
4507   HelpText<"Save llvm statistics.">;
4508 def via_file_asm : Flag<["-", "--"], "via-file-asm">, InternalDebugOpt,
4509   HelpText<"Write assembly to file for input to assemble jobs">;
4510 def sectalign : MultiArg<["-"], "sectalign", 3>;
4511 def sectcreate : MultiArg<["-"], "sectcreate", 3>;
4512 def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>;
4513 def sectorder : MultiArg<["-"], "sectorder", 3>;
4514 def seg1addr : JoinedOrSeparate<["-"], "seg1addr">;
4515 def seg__addr__table__filename : Separate<["-"], "seg_addr_table_filename">;
4516 def seg__addr__table : Separate<["-"], "seg_addr_table">;
4517 def segaddr : MultiArg<["-"], "segaddr", 2>;
4518 def segcreate : MultiArg<["-"], "segcreate", 3>;
4519 def seglinkedit : Flag<["-"], "seglinkedit">;
4520 def segprot : MultiArg<["-"], "segprot", 3>;
4521 def segs__read__only__addr : Separate<["-"], "segs_read_only_addr">;
4522 def segs__read__write__addr : Separate<["-"], "segs_read_write_addr">;
4523 def segs__read__ : Joined<["-"], "segs_read_">;
4524 def shared_libgcc : Flag<["-"], "shared-libgcc">;
4525 def shared : Flag<["-", "--"], "shared">, Group<Link_Group>;
4526 def single__module : Flag<["-"], "single_module">;
4527 def specs_EQ : Joined<["-", "--"], "specs=">, Group<Link_Group>;
4528 def specs : Separate<["-", "--"], "specs">, Flags<[Unsupported]>;
4529 def start_no_unused_arguments : Flag<["--"], "start-no-unused-arguments">, Flags<[CoreOption]>,
4530   HelpText<"Don't emit warnings about unused arguments for the following arguments">;
4531 def static_libgcc : Flag<["-"], "static-libgcc">;
4532 def static_libstdcxx : Flag<["-"], "static-libstdc++">;
4533 def static : Flag<["-", "--"], "static">, Group<Link_Group>, Flags<[NoArgumentUnused]>;
4534 def std_default_EQ : Joined<["-"], "std-default=">;
4535 def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option,FlangOption,FC1Option]>,
4536   Group<CompileOnly_Group>, HelpText<"Language standard to compile for">,
4537   ValuesCode<[{
4538     static constexpr const char VALUES_CODE [] =
4539     #define LANGSTANDARD(id, name, lang, desc, features) name ","
4540     #define LANGSTANDARD_ALIAS(id, alias) alias ","
4541     #include "clang/Basic/LangStandards.def"
4542     ;
4543   }]>;
4544 def stdlib_EQ : Joined<["-", "--"], "stdlib=">, Flags<[CC1Option]>,
4545   HelpText<"C++ standard library to use">, Values<"libc++,libstdc++,platform">;
4546 def stdlibxx_isystem : JoinedOrSeparate<["-"], "stdlib++-isystem">,
4547   Group<clang_i_Group>,
4548   HelpText<"Use directory as the C++ standard library include path">,
4549   Flags<[NoXarchOption]>, MetaVarName<"<directory>">;
4550 def unwindlib_EQ : Joined<["-", "--"], "unwindlib=">, Flags<[CC1Option]>,
4551   HelpText<"Unwind library to use">, Values<"libgcc,unwindlib,platform">;
4552 def sub__library : JoinedOrSeparate<["-"], "sub_library">;
4553 def sub__umbrella : JoinedOrSeparate<["-"], "sub_umbrella">;
4554 def system_header_prefix : Joined<["--"], "system-header-prefix=">,
4555   Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
4556   HelpText<"Treat all #include paths starting with <prefix> as including a "
4557            "system header.">;
4558 def : Separate<["--"], "system-header-prefix">, Alias<system_header_prefix>;
4559 def no_system_header_prefix : Joined<["--"], "no-system-header-prefix=">,
4560   Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
4561   HelpText<"Treat all #include paths starting with <prefix> as not including a "
4562            "system header.">;
4563 def : Separate<["--"], "no-system-header-prefix">, Alias<no_system_header_prefix>;
4564 def s : Flag<["-"], "s">, Group<Link_Group>;
4565 def target : Joined<["--"], "target=">, Flags<[NoXarchOption, CoreOption, FlangOption]>,
4566   HelpText<"Generate code for the given target">;
4567 def darwin_target_variant : Separate<["-"], "darwin-target-variant">,
4568   Flags<[NoXarchOption, CoreOption]>,
4569   HelpText<"Generate code for an additional runtime variant of the deployment target">;
4570 def print_supported_cpus : Flag<["-", "--"], "print-supported-cpus">,
4571   Group<CompileOnly_Group>, Flags<[CC1Option, CoreOption]>,
4572   HelpText<"Print supported cpu models for the given target (if target is not specified,"
4573            " it will print the supported cpus for the default target)">,
4574   MarshallingInfoFlag<FrontendOpts<"PrintSupportedCPUs">>;
4575 def : Flag<["-"], "mcpu=help">, Alias<print_supported_cpus>;
4576 def : Flag<["-"], "mtune=help">, Alias<print_supported_cpus>;
4577 def time : Flag<["-"], "time">,
4578   HelpText<"Time individual commands">;
4579 def traditional_cpp : Flag<["-", "--"], "traditional-cpp">, Flags<[CC1Option]>,
4580   HelpText<"Enable some traditional CPP emulation">,
4581   MarshallingInfoFlag<LangOpts<"TraditionalCPP">>;
4582 def traditional : Flag<["-", "--"], "traditional">;
4583 def trigraphs : Flag<["-", "--"], "trigraphs">, Alias<ftrigraphs>,
4584   HelpText<"Process trigraph sequences">;
4585 def twolevel__namespace__hints : Flag<["-"], "twolevel_namespace_hints">;
4586 def twolevel__namespace : Flag<["-"], "twolevel_namespace">;
4587 def t : Flag<["-"], "t">, Group<Link_Group>;
4588 def umbrella : Separate<["-"], "umbrella">;
4589 def undefined : JoinedOrSeparate<["-"], "undefined">, Group<u_Group>;
4590 def undef : Flag<["-"], "undef">, Group<u_Group>, Flags<[CC1Option]>,
4591   HelpText<"undef all system defines">,
4592   MarshallingInfoNegativeFlag<PreprocessorOpts<"UsePredefines">>;
4593 def unexported__symbols__list : Separate<["-"], "unexported_symbols_list">;
4594 def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
4595 def v : Flag<["-"], "v">, Flags<[CC1Option, CoreOption]>,
4596   HelpText<"Show commands to run and use verbose output">,
4597   MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
4598 def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
4599   Flags<[CC1Option]>, Group<f_Group>,
4600   HelpText<"Source-level compatibility for Altivec vectors (for PowerPC "
4601            "targets). This includes results of vector comparison (scalar for "
4602            "'xl', vector for 'gcc') as well as behavior when initializing with "
4603            "a scalar (splatting for 'xl', element zero only for 'gcc'). For "
4604            "'mixed', the compatibility is as 'gcc' for 'vector bool/vector "
4605            "pixel' and as 'xl' for other types. Current default is 'mixed'.">,
4606   Values<"mixed,gcc,xl">,
4607   NormalizedValuesScope<"LangOptions::AltivecSrcCompatKind">,
4608   NormalizedValues<["Mixed", "GCC", "XL"]>,
4609   MarshallingInfoEnum<LangOpts<"AltivecSrcCompat">, "Mixed">;
4610 def verify_debug_info : Flag<["--"], "verify-debug-info">, Flags<[NoXarchOption]>,
4611   HelpText<"Verify the binary representation of debug output">;
4612 def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>;
4613 def weak__framework : Separate<["-"], "weak_framework">, Flags<[LinkerInput]>;
4614 def weak__library : Separate<["-"], "weak_library">, Flags<[LinkerInput]>;
4615 def weak__reference__mismatches : Separate<["-"], "weak_reference_mismatches">;
4616 def whatsloaded : Flag<["-"], "whatsloaded">;
4617 def why_load : Flag<["-"], "why_load">;
4618 def whyload : Flag<["-"], "whyload">, Alias<why_load>;
4619 def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">, Flags<[CC1Option]>,
4620   MarshallingInfoFlag<DiagnosticOpts<"IgnoreWarnings">>;
4621 def x : JoinedOrSeparate<["-"], "x">,
4622 Flags<[NoXarchOption,CC1Option,FlangOption,FC1Option]>,
4623   HelpText<"Treat subsequent input files as having type <language>">,
4624   MetaVarName<"<language>">;
4625 def y : Joined<["-"], "y">;
4626
4627 defm integrated_as : BoolFOption<"integrated-as",
4628   CodeGenOpts<"DisableIntegratedAS">, DefaultFalse,
4629   NegFlag<SetTrue, [CC1Option, FlangOption], "Disable">, PosFlag<SetFalse, [], "Enable">,
4630   BothFlags<[], " the integrated assembler">>;
4631
4632 def fintegrated_cc1 : Flag<["-"], "fintegrated-cc1">,
4633                       Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
4634                       HelpText<"Run cc1 in-process">;
4635 def fno_integrated_cc1 : Flag<["-"], "fno-integrated-cc1">,
4636                          Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
4637                          HelpText<"Spawn a separate process for each cc1">;
4638
4639 def fintegrated_objemitter : Flag<["-"], "fintegrated-objemitter">,
4640   Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
4641   HelpText<"Use internal machine object code emitter.">;
4642 def fno_integrated_objemitter : Flag<["-"], "fno-integrated-objemitter">,
4643   Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
4644   HelpText<"Use external machine object code emitter.">;
4645
4646 def : Flag<["-"], "integrated-as">, Alias<fintegrated_as>, Flags<[NoXarchOption]>;
4647 def : Flag<["-"], "no-integrated-as">, Alias<fno_integrated_as>,
4648       Flags<[CC1Option, FlangOption, NoXarchOption]>;
4649
4650 def working_directory : Separate<["-"], "working-directory">, Flags<[CC1Option]>,
4651   HelpText<"Resolve file paths relative to the specified directory">,
4652   MarshallingInfoString<FileSystemOpts<"WorkingDir">>;
4653 def working_directory_EQ : Joined<["-"], "working-directory=">, Flags<[CC1Option]>,
4654   Alias<working_directory>;
4655
4656 // Double dash options, which are usually an alias for one of the previous
4657 // options.
4658
4659 def _mhwdiv_EQ : Joined<["--"], "mhwdiv=">, Alias<mhwdiv_EQ>;
4660 def _mhwdiv : Separate<["--"], "mhwdiv">, Alias<mhwdiv_EQ>;
4661 def _CLASSPATH_EQ : Joined<["--"], "CLASSPATH=">, Alias<fclasspath_EQ>;
4662 def _CLASSPATH : Separate<["--"], "CLASSPATH">, Alias<fclasspath_EQ>;
4663 def _all_warnings : Flag<["--"], "all-warnings">, Alias<Wall>;
4664 def _analyzer_no_default_checks : Flag<["--"], "analyzer-no-default-checks">, Flags<[NoXarchOption]>;
4665 def _analyzer_output : JoinedOrSeparate<["--"], "analyzer-output">, Flags<[NoXarchOption]>,
4666   HelpText<"Static analyzer report output format (html|plist|plist-multi-file|plist-html|sarif|sarif-html|text).">;
4667 def _analyze : Flag<["--"], "analyze">, Flags<[NoXarchOption, CoreOption]>,
4668   HelpText<"Run the static analyzer">;
4669 def _assemble : Flag<["--"], "assemble">, Alias<S>;
4670 def _assert_EQ : Joined<["--"], "assert=">, Alias<A>;
4671 def _assert : Separate<["--"], "assert">, Alias<A>;
4672 def _bootclasspath_EQ : Joined<["--"], "bootclasspath=">, Alias<fbootclasspath_EQ>;
4673 def _bootclasspath : Separate<["--"], "bootclasspath">, Alias<fbootclasspath_EQ>;
4674 def _classpath_EQ : Joined<["--"], "classpath=">, Alias<fclasspath_EQ>;
4675 def _classpath : Separate<["--"], "classpath">, Alias<fclasspath_EQ>;
4676 def _comments_in_macros : Flag<["--"], "comments-in-macros">, Alias<CC>;
4677 def _comments : Flag<["--"], "comments">, Alias<C>;
4678 def _compile : Flag<["--"], "compile">, Alias<c>;
4679 def _constant_cfstrings : Flag<["--"], "constant-cfstrings">;
4680 def _debug_EQ : Joined<["--"], "debug=">, Alias<g_Flag>;
4681 def _debug : Flag<["--"], "debug">, Alias<g_Flag>;
4682 def _define_macro_EQ : Joined<["--"], "define-macro=">, Alias<D>;
4683 def _define_macro : Separate<["--"], "define-macro">, Alias<D>;
4684 def _dependencies : Flag<["--"], "dependencies">, Alias<M>;
4685 def _dyld_prefix_EQ : Joined<["--"], "dyld-prefix=">;
4686 def _dyld_prefix : Separate<["--"], "dyld-prefix">, Alias<_dyld_prefix_EQ>;
4687 def _encoding_EQ : Joined<["--"], "encoding=">, Alias<fencoding_EQ>;
4688 def _encoding : Separate<["--"], "encoding">, Alias<fencoding_EQ>;
4689 def _entry : Flag<["--"], "entry">, Alias<e>;
4690 def _extdirs_EQ : Joined<["--"], "extdirs=">, Alias<fextdirs_EQ>;
4691 def _extdirs : Separate<["--"], "extdirs">, Alias<fextdirs_EQ>;
4692 def _extra_warnings : Flag<["--"], "extra-warnings">, Alias<W_Joined>;
4693 def _for_linker_EQ : Joined<["--"], "for-linker=">, Alias<Xlinker>;
4694 def _for_linker : Separate<["--"], "for-linker">, Alias<Xlinker>;
4695 def _force_link_EQ : Joined<["--"], "force-link=">, Alias<u>;
4696 def _force_link : Separate<["--"], "force-link">, Alias<u>;
4697 def _help_hidden : Flag<["--"], "help-hidden">,
4698   HelpText<"Display help for hidden options">;
4699 def _imacros_EQ : Joined<["--"], "imacros=">, Alias<imacros>;
4700 def _include_barrier : Flag<["--"], "include-barrier">, Alias<I_>;
4701 def _include_directory_after_EQ : Joined<["--"], "include-directory-after=">, Alias<idirafter>;
4702 def _include_directory_after : Separate<["--"], "include-directory-after">, Alias<idirafter>;
4703 def _include_directory_EQ : Joined<["--"], "include-directory=">, Alias<I>;
4704 def _include_directory : Separate<["--"], "include-directory">, Alias<I>;
4705 def _include_prefix_EQ : Joined<["--"], "include-prefix=">, Alias<iprefix>;
4706 def _include_prefix : Separate<["--"], "include-prefix">, Alias<iprefix>;
4707 def _include_with_prefix_after_EQ : Joined<["--"], "include-with-prefix-after=">, Alias<iwithprefix>;
4708 def _include_with_prefix_after : Separate<["--"], "include-with-prefix-after">, Alias<iwithprefix>;
4709 def _include_with_prefix_before_EQ : Joined<["--"], "include-with-prefix-before=">, Alias<iwithprefixbefore>;
4710 def _include_with_prefix_before : Separate<["--"], "include-with-prefix-before">, Alias<iwithprefixbefore>;
4711 def _include_with_prefix_EQ : Joined<["--"], "include-with-prefix=">, Alias<iwithprefix>;
4712 def _include_with_prefix : Separate<["--"], "include-with-prefix">, Alias<iwithprefix>;
4713 def _include_EQ : Joined<["--"], "include=">, Alias<include_>;
4714 def _language_EQ : Joined<["--"], "language=">, Alias<x>;
4715 def _language : Separate<["--"], "language">, Alias<x>;
4716 def _library_directory_EQ : Joined<["--"], "library-directory=">, Alias<L>;
4717 def _library_directory : Separate<["--"], "library-directory">, Alias<L>;
4718 def _no_line_commands : Flag<["--"], "no-line-commands">, Alias<P>;
4719 def _no_standard_includes : Flag<["--"], "no-standard-includes">, Alias<nostdinc>;
4720 def _no_standard_libraries : Flag<["--"], "no-standard-libraries">, Alias<nostdlib>;
4721 def _no_undefined : Flag<["--"], "no-undefined">, Flags<[LinkerInput]>;
4722 def _no_warnings : Flag<["--"], "no-warnings">, Alias<w>;
4723 def _optimize_EQ : Joined<["--"], "optimize=">, Alias<O>;
4724 def _optimize : Flag<["--"], "optimize">, Alias<O>;
4725 def _output_class_directory_EQ : Joined<["--"], "output-class-directory=">, Alias<foutput_class_dir_EQ>;
4726 def _output_class_directory : Separate<["--"], "output-class-directory">, Alias<foutput_class_dir_EQ>;
4727 def _output_EQ : Joined<["--"], "output=">, Alias<o>;
4728 def _output : Separate<["--"], "output">, Alias<o>;
4729 def _param : Separate<["--"], "param">, Group<CompileOnly_Group>;
4730 def _param_EQ : Joined<["--"], "param=">, Alias<_param>;
4731 def _precompile : Flag<["--"], "precompile">, Flags<[NoXarchOption]>,
4732   Group<Action_Group>, HelpText<"Only precompile the input">;
4733 def _prefix_EQ : Joined<["--"], "prefix=">, Alias<B>;
4734 def _prefix : Separate<["--"], "prefix">, Alias<B>;
4735 def _preprocess : Flag<["--"], "preprocess">, Alias<E>;
4736 def _print_diagnostic_categories : Flag<["--"], "print-diagnostic-categories">;
4737 def _print_file_name : Separate<["--"], "print-file-name">, Alias<print_file_name_EQ>;
4738 def _print_missing_file_dependencies : Flag<["--"], "print-missing-file-dependencies">, Alias<MG>;
4739 def _print_prog_name : Separate<["--"], "print-prog-name">, Alias<print_prog_name_EQ>;
4740 def _profile : Flag<["--"], "profile">, Alias<p>;
4741 def _resource_EQ : Joined<["--"], "resource=">, Alias<fcompile_resource_EQ>;
4742 def _resource : Separate<["--"], "resource">, Alias<fcompile_resource_EQ>;
4743 def _rtlib : Separate<["--"], "rtlib">, Alias<rtlib_EQ>;
4744 def _serialize_diags : Separate<["-", "--"], "serialize-diagnostics">, Flags<[NoXarchOption]>,
4745   HelpText<"Serialize compiler diagnostics to a file">;
4746 // We give --version different semantics from -version.
4747 def _version : Flag<["--"], "version">,
4748   Flags<[CoreOption, FlangOption]>,
4749   HelpText<"Print version information">;
4750 def _signed_char : Flag<["--"], "signed-char">, Alias<fsigned_char>;
4751 def _std : Separate<["--"], "std">, Alias<std_EQ>;
4752 def _stdlib : Separate<["--"], "stdlib">, Alias<stdlib_EQ>;
4753 def _sysroot_EQ : Joined<["--"], "sysroot=">;
4754 def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>;
4755 def _target_help : Flag<["--"], "target-help">;
4756 def _trace_includes : Flag<["--"], "trace-includes">, Alias<H>;
4757 def _undefine_macro_EQ : Joined<["--"], "undefine-macro=">, Alias<U>;
4758 def _undefine_macro : Separate<["--"], "undefine-macro">, Alias<U>;
4759 def _unsigned_char : Flag<["--"], "unsigned-char">, Alias<funsigned_char>;
4760 def _user_dependencies : Flag<["--"], "user-dependencies">, Alias<MM>;
4761 def _verbose : Flag<["--"], "verbose">, Alias<v>;
4762 def _warn__EQ : Joined<["--"], "warn-=">, Alias<W_Joined>;
4763 def _warn_ : Joined<["--"], "warn-">, Alias<W_Joined>;
4764 def _write_dependencies : Flag<["--"], "write-dependencies">, Alias<MD>;
4765 def _write_user_dependencies : Flag<["--"], "write-user-dependencies">, Alias<MMD>;
4766 def _ : Joined<["--"], "">, Flags<[Unsupported]>;
4767
4768 // Hexagon feature flags.
4769 let Flags = [TargetSpecific] in {
4770 def mieee_rnd_near : Flag<["-"], "mieee-rnd-near">,
4771   Group<m_hexagon_Features_Group>;
4772 def mv5 : Flag<["-"], "mv5">, Group<m_hexagon_Features_Group>, Alias<mcpu_EQ>,
4773   AliasArgs<["hexagonv5"]>;
4774 def mv55 : Flag<["-"], "mv55">, Group<m_hexagon_Features_Group>,
4775   Alias<mcpu_EQ>, AliasArgs<["hexagonv55"]>;
4776 def mv60 : Flag<["-"], "mv60">, Group<m_hexagon_Features_Group>,
4777   Alias<mcpu_EQ>, AliasArgs<["hexagonv60"]>;
4778 def mv62 : Flag<["-"], "mv62">, Group<m_hexagon_Features_Group>,
4779   Alias<mcpu_EQ>, AliasArgs<["hexagonv62"]>;
4780 def mv65 : Flag<["-"], "mv65">, Group<m_hexagon_Features_Group>,
4781   Alias<mcpu_EQ>, AliasArgs<["hexagonv65"]>;
4782 def mv66 : Flag<["-"], "mv66">, Group<m_hexagon_Features_Group>,
4783   Alias<mcpu_EQ>, AliasArgs<["hexagonv66"]>;
4784 def mv67 : Flag<["-"], "mv67">, Group<m_hexagon_Features_Group>,
4785   Alias<mcpu_EQ>, AliasArgs<["hexagonv67"]>;
4786 def mv67t : Flag<["-"], "mv67t">, Group<m_hexagon_Features_Group>,
4787   Alias<mcpu_EQ>, AliasArgs<["hexagonv67t"]>;
4788 def mv68 : Flag<["-"], "mv68">, Group<m_hexagon_Features_Group>,
4789   Alias<mcpu_EQ>, AliasArgs<["hexagonv68"]>;
4790 def mv69 : Flag<["-"], "mv69">, Group<m_hexagon_Features_Group>,
4791   Alias<mcpu_EQ>, AliasArgs<["hexagonv69"]>;
4792 def mv71 : Flag<["-"], "mv71">, Group<m_hexagon_Features_Group>,
4793   Alias<mcpu_EQ>, AliasArgs<["hexagonv71"]>;
4794 def mv71t : Flag<["-"], "mv71t">, Group<m_hexagon_Features_Group>,
4795   Alias<mcpu_EQ>, AliasArgs<["hexagonv71t"]>;
4796 def mv73 : Flag<["-"], "mv73">, Group<m_hexagon_Features_Group>,
4797   Alias<mcpu_EQ>, AliasArgs<["hexagonv73"]>;
4798 def mhexagon_hvx : Flag<["-"], "mhvx">, Group<m_hexagon_Features_HVX_Group>,
4799   HelpText<"Enable Hexagon Vector eXtensions">;
4800 def mhexagon_hvx_EQ : Joined<["-"], "mhvx=">,
4801   Group<m_hexagon_Features_HVX_Group>,
4802   HelpText<"Enable Hexagon Vector eXtensions">;
4803 def mno_hexagon_hvx : Flag<["-"], "mno-hvx">,
4804   Group<m_hexagon_Features_HVX_Group>,
4805   HelpText<"Disable Hexagon Vector eXtensions">;
4806 def mhexagon_hvx_length_EQ : Joined<["-"], "mhvx-length=">,
4807   Group<m_hexagon_Features_HVX_Group>, HelpText<"Set Hexagon Vector Length">,
4808   Values<"64B,128B">;
4809 def mhexagon_hvx_qfloat : Flag<["-"], "mhvx-qfloat">,
4810   Group<m_hexagon_Features_HVX_Group>,
4811   HelpText<"Enable Hexagon HVX QFloat instructions">;
4812 def mno_hexagon_hvx_qfloat : Flag<["-"], "mno-hvx-qfloat">,
4813   Group<m_hexagon_Features_HVX_Group>,
4814   HelpText<"Disable Hexagon HVX QFloat instructions">;
4815 def mhexagon_hvx_ieee_fp : Flag<["-"], "mhvx-ieee-fp">,
4816   Group<m_hexagon_Features_Group>,
4817   HelpText<"Enable Hexagon HVX IEEE floating-point">;
4818 def mno_hexagon_hvx_ieee_fp : Flag<["-"], "mno-hvx-ieee-fp">,
4819   Group<m_hexagon_Features_Group>,
4820   HelpText<"Disable Hexagon HVX IEEE floating-point">;
4821 def ffixed_r19: Flag<["-"], "ffixed-r19">, Group<f_Group>,
4822   HelpText<"Reserve register r19 (Hexagon only)">;
4823 } // let Flags = [TargetSpecific]
4824 def mmemops : Flag<["-"], "mmemops">, Group<m_hexagon_Features_Group>,
4825   Flags<[CC1Option]>, HelpText<"Enable generation of memop instructions">;
4826 def mno_memops : Flag<["-"], "mno-memops">, Group<m_hexagon_Features_Group>,
4827   Flags<[CC1Option]>, HelpText<"Disable generation of memop instructions">;
4828 def mpackets : Flag<["-"], "mpackets">, Group<m_hexagon_Features_Group>,
4829   Flags<[CC1Option]>, HelpText<"Enable generation of instruction packets">;
4830 def mno_packets : Flag<["-"], "mno-packets">, Group<m_hexagon_Features_Group>,
4831   Flags<[CC1Option]>, HelpText<"Disable generation of instruction packets">;
4832 def mnvj : Flag<["-"], "mnvj">, Group<m_hexagon_Features_Group>,
4833   Flags<[CC1Option]>, HelpText<"Enable generation of new-value jumps">;
4834 def mno_nvj : Flag<["-"], "mno-nvj">, Group<m_hexagon_Features_Group>,
4835   Flags<[CC1Option]>, HelpText<"Disable generation of new-value jumps">;
4836 def mnvs : Flag<["-"], "mnvs">, Group<m_hexagon_Features_Group>,
4837   Flags<[CC1Option]>, HelpText<"Enable generation of new-value stores">;
4838 def mno_nvs : Flag<["-"], "mno-nvs">, Group<m_hexagon_Features_Group>,
4839   Flags<[CC1Option]>, HelpText<"Disable generation of new-value stores">;
4840 def mcabac: Flag<["-"], "mcabac">, Group<m_hexagon_Features_Group>,
4841   HelpText<"Enable CABAC instructions">;
4842
4843 // SPARC feature flags
4844 let Flags = [TargetSpecific] in {
4845 def mfpu : Flag<["-"], "mfpu">, Group<m_sparc_Features_Group>;
4846 def mno_fpu : Flag<["-"], "mno-fpu">, Group<m_sparc_Features_Group>;
4847 def mfsmuld : Flag<["-"], "mfsmuld">, Group<m_sparc_Features_Group>;
4848 def mno_fsmuld : Flag<["-"], "mno-fsmuld">, Group<m_sparc_Features_Group>;
4849 def mpopc : Flag<["-"], "mpopc">, Group<m_sparc_Features_Group>;
4850 def mno_popc : Flag<["-"], "mno-popc">, Group<m_sparc_Features_Group>;
4851 def mvis : Flag<["-"], "mvis">, Group<m_sparc_Features_Group>;
4852 def mno_vis : Flag<["-"], "mno-vis">, Group<m_sparc_Features_Group>;
4853 def mvis2 : Flag<["-"], "mvis2">, Group<m_sparc_Features_Group>;
4854 def mno_vis2 : Flag<["-"], "mno-vis2">, Group<m_sparc_Features_Group>;
4855 def mvis3 : Flag<["-"], "mvis3">, Group<m_sparc_Features_Group>;
4856 def mno_vis3 : Flag<["-"], "mno-vis3">, Group<m_sparc_Features_Group>;
4857 def mhard_quad_float : Flag<["-"], "mhard-quad-float">, Group<m_sparc_Features_Group>;
4858 def msoft_quad_float : Flag<["-"], "msoft-quad-float">, Group<m_sparc_Features_Group>;
4859 } // let Flags = [TargetSpecific]
4860
4861 // M68k features flags
4862 let Flags = [TargetSpecific] in {
4863 def m68000 : Flag<["-"], "m68000">, Group<m_m68k_Features_Group>;
4864 def m68010 : Flag<["-"], "m68010">, Group<m_m68k_Features_Group>;
4865 def m68020 : Flag<["-"], "m68020">, Group<m_m68k_Features_Group>;
4866 def m68030 : Flag<["-"], "m68030">, Group<m_m68k_Features_Group>;
4867 def m68040 : Flag<["-"], "m68040">, Group<m_m68k_Features_Group>;
4868 def m68060 : Flag<["-"], "m68060">, Group<m_m68k_Features_Group>;
4869
4870 def m68881 : Flag<["-"], "m68881">, Group<m_m68k_Features_Group>;
4871
4872 foreach i = {0-6} in
4873   def ffixed_a#i : Flag<["-"], "ffixed-a"#i>, Group<m_m68k_Features_Group>,
4874     HelpText<"Reserve the a"#i#" register (M68k only)">;
4875 foreach i = {0-7} in
4876   def ffixed_d#i : Flag<["-"], "ffixed-d"#i>, Group<m_m68k_Features_Group>,
4877     HelpText<"Reserve the d"#i#" register (M68k only)">;
4878 } // let Flags = [TargetSpecific]
4879
4880 // X86 feature flags
4881 def mx87 : Flag<["-"], "mx87">, Group<m_x86_Features_Group>;
4882 def mno_x87 : Flag<["-"], "mno-x87">, Group<m_x86_Features_Group>;
4883 def m80387 : Flag<["-"], "m80387">, Alias<mx87>;
4884 def mno_80387 : Flag<["-"], "mno-80387">, Alias<mno_x87>;
4885 def mno_fp_ret_in_387 : Flag<["-"], "mno-fp-ret-in-387">, Alias<mno_x87>;
4886 def mmmx : Flag<["-"], "mmmx">, Group<m_x86_Features_Group>;
4887 def mno_mmx : Flag<["-"], "mno-mmx">, Group<m_x86_Features_Group>;
4888 def m3dnow : Flag<["-"], "m3dnow">, Group<m_x86_Features_Group>;
4889 def mno_3dnow : Flag<["-"], "mno-3dnow">, Group<m_x86_Features_Group>;
4890 def m3dnowa : Flag<["-"], "m3dnowa">, Group<m_x86_Features_Group>;
4891 def mno_3dnowa : Flag<["-"], "mno-3dnowa">, Group<m_x86_Features_Group>;
4892 def mamx_bf16 : Flag<["-"], "mamx-bf16">, Group<m_x86_Features_Group>;
4893 def mno_amx_bf16 : Flag<["-"], "mno-amx-bf16">, Group<m_x86_Features_Group>;
4894 def mamx_complex : Flag<["-"], "mamx-complex">, Group<m_x86_Features_Group>;
4895 def mno_amx_complex : Flag<["-"], "mno-amx-complex">, Group<m_x86_Features_Group>;
4896 def mamx_fp16 : Flag<["-"], "mamx-fp16">, Group<m_x86_Features_Group>;
4897 def mno_amx_fp16 : Flag<["-"], "mno-amx-fp16">, Group<m_x86_Features_Group>;
4898 def mamx_int8 : Flag<["-"], "mamx-int8">, Group<m_x86_Features_Group>;
4899 def mno_amx_int8 : Flag<["-"], "mno-amx-int8">, Group<m_x86_Features_Group>;
4900 def mamx_tile : Flag<["-"], "mamx-tile">, Group<m_x86_Features_Group>;
4901 def mno_amx_tile : Flag<["-"], "mno-amx-tile">, Group<m_x86_Features_Group>;
4902 def mcmpccxadd : Flag<["-"], "mcmpccxadd">, Group<m_x86_Features_Group>;
4903 def mno_cmpccxadd : Flag<["-"], "mno-cmpccxadd">, Group<m_x86_Features_Group>;
4904 def msse : Flag<["-"], "msse">, Group<m_x86_Features_Group>;
4905 def mno_sse : Flag<["-"], "mno-sse">, Group<m_x86_Features_Group>;
4906 def msse2 : Flag<["-"], "msse2">, Group<m_x86_Features_Group>;
4907 def mno_sse2 : Flag<["-"], "mno-sse2">, Group<m_x86_Features_Group>;
4908 def msse3 : Flag<["-"], "msse3">, Group<m_x86_Features_Group>;
4909 def mno_sse3 : Flag<["-"], "mno-sse3">, Group<m_x86_Features_Group>;
4910 def mssse3 : Flag<["-"], "mssse3">, Group<m_x86_Features_Group>;
4911 def mno_ssse3 : Flag<["-"], "mno-ssse3">, Group<m_x86_Features_Group>;
4912 def msse4_1 : Flag<["-"], "msse4.1">, Group<m_x86_Features_Group>;
4913 def mno_sse4_1 : Flag<["-"], "mno-sse4.1">, Group<m_x86_Features_Group>;
4914 def msse4_2 : Flag<["-"], "msse4.2">, Group<m_x86_Features_Group>;
4915 def mno_sse4_2 : Flag<["-"], "mno-sse4.2">, Group<m_x86_Features_Group>;
4916 def msse4 : Flag<["-"], "msse4">, Alias<msse4_2>;
4917 // -mno-sse4 turns off sse4.1 which has the effect of turning off everything
4918 // later than 4.1. -msse4 turns on 4.2 which has the effect of turning on
4919 // everything earlier than 4.2.
4920 def mno_sse4 : Flag<["-"], "mno-sse4">, Alias<mno_sse4_1>;
4921 def msse4a : Flag<["-"], "msse4a">, Group<m_x86_Features_Group>;
4922 def mno_sse4a : Flag<["-"], "mno-sse4a">, Group<m_x86_Features_Group>;
4923 def mavx : Flag<["-"], "mavx">, Group<m_x86_Features_Group>;
4924 def mno_avx : Flag<["-"], "mno-avx">, Group<m_x86_Features_Group>;
4925 def mavx2 : Flag<["-"], "mavx2">, Group<m_x86_Features_Group>;
4926 def mno_avx2 : Flag<["-"], "mno-avx2">, Group<m_x86_Features_Group>;
4927 def mavx512f : Flag<["-"], "mavx512f">, Group<m_x86_Features_Group>;
4928 def mno_avx512f : Flag<["-"], "mno-avx512f">, Group<m_x86_Features_Group>;
4929 def mavx512bf16 : Flag<["-"], "mavx512bf16">, Group<m_x86_Features_Group>;
4930 def mno_avx512bf16 : Flag<["-"], "mno-avx512bf16">, Group<m_x86_Features_Group>;
4931 def mavx512bitalg : Flag<["-"], "mavx512bitalg">, Group<m_x86_Features_Group>;
4932 def mno_avx512bitalg : Flag<["-"], "mno-avx512bitalg">, Group<m_x86_Features_Group>;
4933 def mavx512bw : Flag<["-"], "mavx512bw">, Group<m_x86_Features_Group>;
4934 def mno_avx512bw : Flag<["-"], "mno-avx512bw">, Group<m_x86_Features_Group>;
4935 def mavx512cd : Flag<["-"], "mavx512cd">, Group<m_x86_Features_Group>;
4936 def mno_avx512cd : Flag<["-"], "mno-avx512cd">, Group<m_x86_Features_Group>;
4937 def mavx512dq : Flag<["-"], "mavx512dq">, Group<m_x86_Features_Group>;
4938 def mno_avx512dq : Flag<["-"], "mno-avx512dq">, Group<m_x86_Features_Group>;
4939 def mavx512er : Flag<["-"], "mavx512er">, Group<m_x86_Features_Group>;
4940 def mno_avx512er : Flag<["-"], "mno-avx512er">, Group<m_x86_Features_Group>;
4941 def mavx512fp16 : Flag<["-"], "mavx512fp16">, Group<m_x86_Features_Group>;
4942 def mno_avx512fp16 : Flag<["-"], "mno-avx512fp16">, Group<m_x86_Features_Group>;
4943 def mavx512ifma : Flag<["-"], "mavx512ifma">, Group<m_x86_Features_Group>;
4944 def mno_avx512ifma : Flag<["-"], "mno-avx512ifma">, Group<m_x86_Features_Group>;
4945 def mavx512pf : Flag<["-"], "mavx512pf">, Group<m_x86_Features_Group>;
4946 def mno_avx512pf : Flag<["-"], "mno-avx512pf">, Group<m_x86_Features_Group>;
4947 def mavx512vbmi : Flag<["-"], "mavx512vbmi">, Group<m_x86_Features_Group>;
4948 def mno_avx512vbmi : Flag<["-"], "mno-avx512vbmi">, Group<m_x86_Features_Group>;
4949 def mavx512vbmi2 : Flag<["-"], "mavx512vbmi2">, Group<m_x86_Features_Group>;
4950 def mno_avx512vbmi2 : Flag<["-"], "mno-avx512vbmi2">, Group<m_x86_Features_Group>;
4951 def mavx512vl : Flag<["-"], "mavx512vl">, Group<m_x86_Features_Group>;
4952 def mno_avx512vl : Flag<["-"], "mno-avx512vl">, Group<m_x86_Features_Group>;
4953 def mavx512vnni : Flag<["-"], "mavx512vnni">, Group<m_x86_Features_Group>;
4954 def mno_avx512vnni : Flag<["-"], "mno-avx512vnni">, Group<m_x86_Features_Group>;
4955 def mavx512vpopcntdq : Flag<["-"], "mavx512vpopcntdq">, Group<m_x86_Features_Group>;
4956 def mno_avx512vpopcntdq : Flag<["-"], "mno-avx512vpopcntdq">, Group<m_x86_Features_Group>;
4957 def mavx512vp2intersect : Flag<["-"], "mavx512vp2intersect">, Group<m_x86_Features_Group>;
4958 def mno_avx512vp2intersect : Flag<["-"], "mno-avx512vp2intersect">, Group<m_x86_Features_Group>;
4959 def mavxifma : Flag<["-"], "mavxifma">, Group<m_x86_Features_Group>;
4960 def mno_avxifma : Flag<["-"], "mno-avxifma">, Group<m_x86_Features_Group>;
4961 def mavxneconvert : Flag<["-"], "mavxneconvert">, Group<m_x86_Features_Group>;
4962 def mno_avxneconvert : Flag<["-"], "mno-avxneconvert">, Group<m_x86_Features_Group>;
4963 def mavxvnniint16 : Flag<["-"], "mavxvnniint16">, Group<m_x86_Features_Group>;
4964 def mno_avxvnniint16 : Flag<["-"], "mno-avxvnniint16">, Group<m_x86_Features_Group>;
4965 def mavxvnniint8 : Flag<["-"], "mavxvnniint8">, Group<m_x86_Features_Group>;
4966 def mno_avxvnniint8 : Flag<["-"], "mno-avxvnniint8">, Group<m_x86_Features_Group>;
4967 def mavxvnni : Flag<["-"], "mavxvnni">, Group<m_x86_Features_Group>;
4968 def mno_avxvnni : Flag<["-"], "mno-avxvnni">, Group<m_x86_Features_Group>;
4969 def madx : Flag<["-"], "madx">, Group<m_x86_Features_Group>;
4970 def mno_adx : Flag<["-"], "mno-adx">, Group<m_x86_Features_Group>;
4971 def maes : Flag<["-"], "maes">, Group<m_x86_Features_Group>;
4972 def mno_aes : Flag<["-"], "mno-aes">, Group<m_x86_Features_Group>;
4973 def mbmi : Flag<["-"], "mbmi">, Group<m_x86_Features_Group>;
4974 def mno_bmi : Flag<["-"], "mno-bmi">, Group<m_x86_Features_Group>;
4975 def mbmi2 : Flag<["-"], "mbmi2">, Group<m_x86_Features_Group>;
4976 def mno_bmi2 : Flag<["-"], "mno-bmi2">, Group<m_x86_Features_Group>;
4977 def mcldemote : Flag<["-"], "mcldemote">, Group<m_x86_Features_Group>;
4978 def mno_cldemote : Flag<["-"], "mno-cldemote">, Group<m_x86_Features_Group>;
4979 def mclflushopt : Flag<["-"], "mclflushopt">, Group<m_x86_Features_Group>;
4980 def mno_clflushopt : Flag<["-"], "mno-clflushopt">, Group<m_x86_Features_Group>;
4981 def mclwb : Flag<["-"], "mclwb">, Group<m_x86_Features_Group>;
4982 def mno_clwb : Flag<["-"], "mno-clwb">, Group<m_x86_Features_Group>;
4983 def mwbnoinvd : Flag<["-"], "mwbnoinvd">, Group<m_x86_Features_Group>;
4984 def mno_wbnoinvd : Flag<["-"], "mno-wbnoinvd">, Group<m_x86_Features_Group>;
4985 def mclzero : Flag<["-"], "mclzero">, Group<m_x86_Features_Group>;
4986 def mno_clzero : Flag<["-"], "mno-clzero">, Group<m_x86_Features_Group>;
4987 def mcrc32 : Flag<["-"], "mcrc32">, Group<m_x86_Features_Group>;
4988 def mno_crc32 : Flag<["-"], "mno-crc32">, Group<m_x86_Features_Group>;
4989 def mcx16 : Flag<["-"], "mcx16">, Group<m_x86_Features_Group>;
4990 def mno_cx16 : Flag<["-"], "mno-cx16">, Group<m_x86_Features_Group>;
4991 def menqcmd : Flag<["-"], "menqcmd">, Group<m_x86_Features_Group>;
4992 def mno_enqcmd : Flag<["-"], "mno-enqcmd">, Group<m_x86_Features_Group>;
4993 def mf16c : Flag<["-"], "mf16c">, Group<m_x86_Features_Group>;
4994 def mno_f16c : Flag<["-"], "mno-f16c">, Group<m_x86_Features_Group>;
4995 def mfma : Flag<["-"], "mfma">, Group<m_x86_Features_Group>;
4996 def mno_fma : Flag<["-"], "mno-fma">, Group<m_x86_Features_Group>;
4997 def mfma4 : Flag<["-"], "mfma4">, Group<m_x86_Features_Group>;
4998 def mno_fma4 : Flag<["-"], "mno-fma4">, Group<m_x86_Features_Group>;
4999 def mfsgsbase : Flag<["-"], "mfsgsbase">, Group<m_x86_Features_Group>;
5000 def mno_fsgsbase : Flag<["-"], "mno-fsgsbase">, Group<m_x86_Features_Group>;
5001 def mfxsr : Flag<["-"], "mfxsr">, Group<m_x86_Features_Group>;
5002 def mno_fxsr : Flag<["-"], "mno-fxsr">, Group<m_x86_Features_Group>;
5003 def minvpcid : Flag<["-"], "minvpcid">, Group<m_x86_Features_Group>;
5004 def mno_invpcid : Flag<["-"], "mno-invpcid">, Group<m_x86_Features_Group>;
5005 def mgfni : Flag<["-"], "mgfni">, Group<m_x86_Features_Group>;
5006 def mno_gfni : Flag<["-"], "mno-gfni">, Group<m_x86_Features_Group>;
5007 def mhreset : Flag<["-"], "mhreset">, Group<m_x86_Features_Group>;
5008 def mno_hreset : Flag<["-"], "mno-hreset">, Group<m_x86_Features_Group>;
5009 def mkl : Flag<["-"], "mkl">, Group<m_x86_Features_Group>;
5010 def mno_kl : Flag<["-"], "mno-kl">, Group<m_x86_Features_Group>;
5011 def mwidekl : Flag<["-"], "mwidekl">, Group<m_x86_Features_Group>;
5012 def mno_widekl : Flag<["-"], "mno-widekl">, Group<m_x86_Features_Group>;
5013 def mlwp : Flag<["-"], "mlwp">, Group<m_x86_Features_Group>;
5014 def mno_lwp : Flag<["-"], "mno-lwp">, Group<m_x86_Features_Group>;
5015 def mlzcnt : Flag<["-"], "mlzcnt">, Group<m_x86_Features_Group>;
5016 def mno_lzcnt : Flag<["-"], "mno-lzcnt">, Group<m_x86_Features_Group>;
5017 def mmovbe : Flag<["-"], "mmovbe">, Group<m_x86_Features_Group>;
5018 def mno_movbe : Flag<["-"], "mno-movbe">, Group<m_x86_Features_Group>;
5019 def mmovdiri : Flag<["-"], "mmovdiri">, Group<m_x86_Features_Group>;
5020 def mno_movdiri : Flag<["-"], "mno-movdiri">, Group<m_x86_Features_Group>;
5021 def mmovdir64b : Flag<["-"], "mmovdir64b">, Group<m_x86_Features_Group>;
5022 def mno_movdir64b : Flag<["-"], "mno-movdir64b">, Group<m_x86_Features_Group>;
5023 def mmwaitx : Flag<["-"], "mmwaitx">, Group<m_x86_Features_Group>;
5024 def mno_mwaitx : Flag<["-"], "mno-mwaitx">, Group<m_x86_Features_Group>;
5025 def mpku : Flag<["-"], "mpku">, Group<m_x86_Features_Group>;
5026 def mno_pku : Flag<["-"], "mno-pku">, Group<m_x86_Features_Group>;
5027 def mpclmul : Flag<["-"], "mpclmul">, Group<m_x86_Features_Group>;
5028 def mno_pclmul : Flag<["-"], "mno-pclmul">, Group<m_x86_Features_Group>;
5029 def mpconfig : Flag<["-"], "mpconfig">, Group<m_x86_Features_Group>;
5030 def mno_pconfig : Flag<["-"], "mno-pconfig">, Group<m_x86_Features_Group>;
5031 def mpopcnt : Flag<["-"], "mpopcnt">, Group<m_x86_Features_Group>;
5032 def mno_popcnt : Flag<["-"], "mno-popcnt">, Group<m_x86_Features_Group>;
5033 def mprefetchi : Flag<["-"], "mprefetchi">, Group<m_x86_Features_Group>;
5034 def mno_prefetchi : Flag<["-"], "mno-prefetchi">, Group<m_x86_Features_Group>;
5035 def mprefetchwt1 : Flag<["-"], "mprefetchwt1">, Group<m_x86_Features_Group>;
5036 def mno_prefetchwt1 : Flag<["-"], "mno-prefetchwt1">, Group<m_x86_Features_Group>;
5037 def mprfchw : Flag<["-"], "mprfchw">, Group<m_x86_Features_Group>;
5038 def mno_prfchw : Flag<["-"], "mno-prfchw">, Group<m_x86_Features_Group>;
5039 def mptwrite : Flag<["-"], "mptwrite">, Group<m_x86_Features_Group>;
5040 def mno_ptwrite : Flag<["-"], "mno-ptwrite">, Group<m_x86_Features_Group>;
5041 def mraoint : Flag<["-"], "mraoint">, Group<m_x86_Features_Group>;
5042 def mno_raoint : Flag<["-"], "mno-raoint">, Group<m_x86_Features_Group>;
5043 def mrdpid : Flag<["-"], "mrdpid">, Group<m_x86_Features_Group>;
5044 def mno_rdpid : Flag<["-"], "mno-rdpid">, Group<m_x86_Features_Group>;
5045 def mrdpru : Flag<["-"], "mrdpru">, Group<m_x86_Features_Group>;
5046 def mno_rdpru : Flag<["-"], "mno-rdpru">, Group<m_x86_Features_Group>;
5047 def mrdrnd : Flag<["-"], "mrdrnd">, Group<m_x86_Features_Group>;
5048 def mno_rdrnd : Flag<["-"], "mno-rdrnd">, Group<m_x86_Features_Group>;
5049 def mrtm : Flag<["-"], "mrtm">, Group<m_x86_Features_Group>;
5050 def mno_rtm : Flag<["-"], "mno-rtm">, Group<m_x86_Features_Group>;
5051 def mrdseed : Flag<["-"], "mrdseed">, Group<m_x86_Features_Group>;
5052 def mno_rdseed : Flag<["-"], "mno-rdseed">, Group<m_x86_Features_Group>;
5053 def msahf : Flag<["-"], "msahf">, Group<m_x86_Features_Group>;
5054 def mno_sahf : Flag<["-"], "mno-sahf">, Group<m_x86_Features_Group>;
5055 def mserialize : Flag<["-"], "mserialize">, Group<m_x86_Features_Group>;
5056 def mno_serialize : Flag<["-"], "mno-serialize">, Group<m_x86_Features_Group>;
5057 def msgx : Flag<["-"], "msgx">, Group<m_x86_Features_Group>;
5058 def mno_sgx : Flag<["-"], "mno-sgx">, Group<m_x86_Features_Group>;
5059 def msha : Flag<["-"], "msha">, Group<m_x86_Features_Group>;
5060 def mno_sha : Flag<["-"], "mno-sha">, Group<m_x86_Features_Group>;
5061 def msha512 : Flag<["-"], "msha512">, Group<m_x86_Features_Group>;
5062 def mno_sha512 : Flag<["-"], "mno-sha512">, Group<m_x86_Features_Group>;
5063 def msm3 : Flag<["-"], "msm3">, Group<m_x86_Features_Group>;
5064 def mno_sm3 : Flag<["-"], "mno-sm3">, Group<m_x86_Features_Group>;
5065 def msm4 : Flag<["-"], "msm4">, Group<m_x86_Features_Group>;
5066 def mno_sm4 : Flag<["-"], "mno-sm4">, Group<m_x86_Features_Group>;
5067 def mtbm : Flag<["-"], "mtbm">, Group<m_x86_Features_Group>;
5068 def mno_tbm : Flag<["-"], "mno-tbm">, Group<m_x86_Features_Group>;
5069 def mtsxldtrk : Flag<["-"], "mtsxldtrk">, Group<m_x86_Features_Group>;
5070 def mno_tsxldtrk : Flag<["-"], "mno-tsxldtrk">, Group<m_x86_Features_Group>;
5071 def muintr : Flag<["-"], "muintr">, Group<m_x86_Features_Group>;
5072 def mno_uintr : Flag<["-"], "mno-uintr">, Group<m_x86_Features_Group>;
5073 def mvaes : Flag<["-"], "mvaes">, Group<m_x86_Features_Group>;
5074 def mno_vaes : Flag<["-"], "mno-vaes">, Group<m_x86_Features_Group>;
5075 def mvpclmulqdq : Flag<["-"], "mvpclmulqdq">, Group<m_x86_Features_Group>;
5076 def mno_vpclmulqdq : Flag<["-"], "mno-vpclmulqdq">, Group<m_x86_Features_Group>;
5077 def mwaitpkg : Flag<["-"], "mwaitpkg">, Group<m_x86_Features_Group>;
5078 def mno_waitpkg : Flag<["-"], "mno-waitpkg">, Group<m_x86_Features_Group>;
5079 def mxop : Flag<["-"], "mxop">, Group<m_x86_Features_Group>;
5080 def mno_xop : Flag<["-"], "mno-xop">, Group<m_x86_Features_Group>;
5081 def mxsave : Flag<["-"], "mxsave">, Group<m_x86_Features_Group>;
5082 def mno_xsave : Flag<["-"], "mno-xsave">, Group<m_x86_Features_Group>;
5083 def mxsavec : Flag<["-"], "mxsavec">, Group<m_x86_Features_Group>;
5084 def mno_xsavec : Flag<["-"], "mno-xsavec">, Group<m_x86_Features_Group>;
5085 def mxsaveopt : Flag<["-"], "mxsaveopt">, Group<m_x86_Features_Group>;
5086 def mno_xsaveopt : Flag<["-"], "mno-xsaveopt">, Group<m_x86_Features_Group>;
5087 def mxsaves : Flag<["-"], "mxsaves">, Group<m_x86_Features_Group>;
5088 def mno_xsaves : Flag<["-"], "mno-xsaves">, Group<m_x86_Features_Group>;
5089 def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Features_Group>;
5090 def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
5091 def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
5092 def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
5093 def mvzeroupper : Flag<["-"], "mvzeroupper">, Group<m_x86_Features_Group>;
5094 def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group<m_x86_Features_Group>;
5095 def mno_gather : Flag<["-"], "mno-gather">, Group<m_x86_Features_Group>,
5096                  HelpText<"Disable generation of gather instructions in auto-vectorization(x86 only)">;
5097 def mno_scatter : Flag<["-"], "mno-scatter">, Group<m_x86_Features_Group>,
5098                   HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;
5099
5100 // These are legacy user-facing driver-level option spellings. They are always
5101 // aliases for options that are spelled using the more common Unix / GNU flag
5102 // style of double-dash and equals-joined flags.
5103 def target_legacy_spelling : Separate<["-"], "target">,
5104                              Alias<target>,
5105                              Flags<[CoreOption]>;
5106
5107 // Special internal option to handle -Xlinker --no-demangle.
5108 def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">,
5109     Flags<[Unsupported, NoArgumentUnused]>;
5110
5111 // Special internal option to allow forwarding arbitrary arguments to linker.
5112 def Zlinker_input : Separate<["-"], "Zlinker-input">,
5113     Flags<[Unsupported, NoArgumentUnused]>;
5114
5115 // Reserved library options.
5116 def Z_reserved_lib_stdcxx : Flag<["-"], "Z-reserved-lib-stdc++">,
5117     Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>;
5118 def Z_reserved_lib_cckext : Flag<["-"], "Z-reserved-lib-cckext">,
5119     Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>;
5120
5121 // Ignored options
5122 multiclass BooleanFFlag<string name> {
5123   def f#NAME : Flag<["-"], "f"#name>;
5124   def fno_#NAME : Flag<["-"], "fno-"#name>;
5125 }
5126
5127 multiclass FlangIgnoredDiagOpt<string name> {
5128   def unsupported_warning_w#NAME : Flag<["-", "--"], "W"#name>, Group<flang_ignored_w_Group>;
5129 }
5130
5131 defm : BooleanFFlag<"keep-inline-functions">, Group<clang_ignored_gcc_optimization_f_Group>;
5132
5133 def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group<f_Group>;
5134
5135 // The default value matches BinutilsVersion in MCAsmInfo.h.
5136 def fbinutils_version_EQ : Joined<["-"], "fbinutils-version=">,
5137   MetaVarName<"<major.minor>">, Group<f_Group>, Flags<[CC1Option]>,
5138   HelpText<"Produced object files can use all ELF features supported by this "
5139   "binutils version and newer. If -fno-integrated-as is specified, the "
5140   "generated assembly will consider GNU as support. 'none' means that all ELF "
5141   "features can be used, regardless of binutils support. Defaults to 2.26.">;
5142 def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>, Flags<[CoreOption, LinkOption]>;
5143 def ld_path_EQ : Joined<["--"], "ld-path=">, Group<Link_Group>;
5144
5145 defm align_labels : BooleanFFlag<"align-labels">, Group<clang_ignored_gcc_optimization_f_Group>;
5146 def falign_labels_EQ : Joined<["-"], "falign-labels=">, Group<clang_ignored_gcc_optimization_f_Group>;
5147 defm align_loops : BooleanFFlag<"align-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
5148 defm align_jumps : BooleanFFlag<"align-jumps">, Group<clang_ignored_gcc_optimization_f_Group>;
5149 def falign_jumps_EQ : Joined<["-"], "falign-jumps=">, Group<clang_ignored_gcc_optimization_f_Group>;
5150
5151 // FIXME: This option should be supported and wired up to our diognostics, but
5152 // ignore it for now to avoid breaking builds that use it.
5153 def fdiagnostics_show_location_EQ : Joined<["-"], "fdiagnostics-show-location=">, Group<clang_ignored_f_Group>;
5154
5155 defm check_new : BoolOption<"f", "check-new",
5156   LangOpts<"CheckNew">, DefaultFalse,
5157   PosFlag<SetTrue, [], "Do not assume C++ operator new may not return NULL">,
5158   NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
5159
5160 defm caller_saves : BooleanFFlag<"caller-saves">, Group<clang_ignored_gcc_optimization_f_Group>;
5161 defm reorder_blocks : BooleanFFlag<"reorder-blocks">, Group<clang_ignored_gcc_optimization_f_Group>;
5162 defm branch_count_reg : BooleanFFlag<"branch-count-reg">, Group<clang_ignored_gcc_optimization_f_Group>;
5163 defm default_inline : BooleanFFlag<"default-inline">, Group<clang_ignored_gcc_optimization_f_Group>;
5164 defm fat_lto_objects : BooleanFFlag<"fat-lto-objects">, Group<clang_ignored_gcc_optimization_f_Group>;
5165 defm float_store : BooleanFFlag<"float-store">, Group<clang_ignored_gcc_optimization_f_Group>;
5166 defm friend_injection : BooleanFFlag<"friend-injection">, Group<clang_ignored_f_Group>;
5167 defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group<clang_ignored_f_Group>;
5168 defm gcse : BooleanFFlag<"gcse">, Group<clang_ignored_gcc_optimization_f_Group>;
5169 defm gcse_after_reload: BooleanFFlag<"gcse-after-reload">, Group<clang_ignored_gcc_optimization_f_Group>;
5170 defm gcse_las: BooleanFFlag<"gcse-las">, Group<clang_ignored_gcc_optimization_f_Group>;
5171 defm gcse_sm: BooleanFFlag<"gcse-sm">, Group<clang_ignored_gcc_optimization_f_Group>;
5172 defm gnu : BooleanFFlag<"gnu">, Group<clang_ignored_f_Group>;
5173 defm implicit_templates : BooleanFFlag<"implicit-templates">, Group<clang_ignored_f_Group>;
5174 defm implement_inlines : BooleanFFlag<"implement-inlines">, Group<clang_ignored_f_Group>;
5175 defm merge_constants : BooleanFFlag<"merge-constants">, Group<clang_ignored_gcc_optimization_f_Group>;
5176 defm modulo_sched : BooleanFFlag<"modulo-sched">, Group<clang_ignored_gcc_optimization_f_Group>;
5177 defm modulo_sched_allow_regmoves : BooleanFFlag<"modulo-sched-allow-regmoves">,
5178     Group<clang_ignored_gcc_optimization_f_Group>;
5179 defm inline_functions_called_once : BooleanFFlag<"inline-functions-called-once">,
5180     Group<clang_ignored_gcc_optimization_f_Group>;
5181 def finline_limit_EQ : Joined<["-"], "finline-limit=">, Group<clang_ignored_gcc_optimization_f_Group>;
5182 defm finline_limit : BooleanFFlag<"inline-limit">, Group<clang_ignored_gcc_optimization_f_Group>;
5183 defm inline_small_functions : BooleanFFlag<"inline-small-functions">,
5184     Group<clang_ignored_gcc_optimization_f_Group>;
5185 defm ipa_cp : BooleanFFlag<"ipa-cp">,
5186     Group<clang_ignored_gcc_optimization_f_Group>;
5187 defm ivopts : BooleanFFlag<"ivopts">, Group<clang_ignored_gcc_optimization_f_Group>;
5188 defm semantic_interposition : BoolFOption<"semantic-interposition",
5189   LangOpts<"SemanticInterposition">, DefaultFalse,
5190   PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>,
5191   DocBrief<[{Enable semantic interposition. Semantic interposition allows for the
5192 interposition of a symbol by another at runtime, thus preventing a range of
5193 inter-procedural optimisation.}]>;
5194 defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">, Group<clang_ignored_f_Group>;
5195 defm peel_loops : BooleanFFlag<"peel-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
5196 defm permissive : BooleanFFlag<"permissive">, Group<clang_ignored_f_Group>;
5197 defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">, Group<clang_ignored_gcc_optimization_f_Group>;
5198 defm printf : BooleanFFlag<"printf">, Group<clang_ignored_f_Group>;
5199 defm profile : BooleanFFlag<"profile">, Group<clang_ignored_f_Group>;
5200 defm profile_correction : BooleanFFlag<"profile-correction">, Group<clang_ignored_gcc_optimization_f_Group>;
5201 defm profile_generate_sampling : BooleanFFlag<"profile-generate-sampling">, Group<clang_ignored_f_Group>;
5202 defm profile_reusedist : BooleanFFlag<"profile-reusedist">, Group<clang_ignored_f_Group>;
5203 defm profile_values : BooleanFFlag<"profile-values">, Group<clang_ignored_gcc_optimization_f_Group>;
5204 defm regs_graph : BooleanFFlag<"regs-graph">, Group<clang_ignored_f_Group>;
5205 defm rename_registers : BooleanFFlag<"rename-registers">, Group<clang_ignored_gcc_optimization_f_Group>;
5206 defm ripa : BooleanFFlag<"ripa">, Group<clang_ignored_f_Group>;
5207 defm schedule_insns : BooleanFFlag<"schedule-insns">, Group<clang_ignored_gcc_optimization_f_Group>;
5208 defm schedule_insns2 : BooleanFFlag<"schedule-insns2">, Group<clang_ignored_gcc_optimization_f_Group>;
5209 defm see : BooleanFFlag<"see">, Group<clang_ignored_f_Group>;
5210 defm signaling_nans : BooleanFFlag<"signaling-nans">, Group<clang_ignored_gcc_optimization_f_Group>;
5211 defm single_precision_constant : BooleanFFlag<"single-precision-constant">,
5212     Group<clang_ignored_gcc_optimization_f_Group>;
5213 defm spec_constr_count : BooleanFFlag<"spec-constr-count">, Group<clang_ignored_f_Group>;
5214 defm stack_check : BooleanFFlag<"stack-check">, Group<clang_ignored_f_Group>;
5215 defm strength_reduce :
5216     BooleanFFlag<"strength-reduce">, Group<clang_ignored_gcc_optimization_f_Group>;
5217 defm tls_model : BooleanFFlag<"tls-model">, Group<clang_ignored_f_Group>;
5218 defm tracer : BooleanFFlag<"tracer">, Group<clang_ignored_gcc_optimization_f_Group>;
5219 defm tree_dce : BooleanFFlag<"tree-dce">, Group<clang_ignored_gcc_optimization_f_Group>;
5220 defm tree_salias : BooleanFFlag<"tree-salias">, Group<clang_ignored_f_Group>;
5221 defm tree_ter : BooleanFFlag<"tree-ter">, Group<clang_ignored_gcc_optimization_f_Group>;
5222 defm tree_vectorizer_verbose : BooleanFFlag<"tree-vectorizer-verbose">, Group<clang_ignored_f_Group>;
5223 defm tree_vrp : BooleanFFlag<"tree-vrp">, Group<clang_ignored_gcc_optimization_f_Group>;
5224 defm : BooleanFFlag<"unit-at-a-time">, Group<clang_ignored_gcc_optimization_f_Group>;
5225 defm unroll_all_loops : BooleanFFlag<"unroll-all-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
5226 defm unsafe_loop_optimizations : BooleanFFlag<"unsafe-loop-optimizations">,
5227     Group<clang_ignored_gcc_optimization_f_Group>;
5228 defm unswitch_loops : BooleanFFlag<"unswitch-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
5229 defm use_linker_plugin : BooleanFFlag<"use-linker-plugin">, Group<clang_ignored_gcc_optimization_f_Group>;
5230 defm vect_cost_model : BooleanFFlag<"vect-cost-model">, Group<clang_ignored_gcc_optimization_f_Group>;
5231 defm variable_expansion_in_unroller : BooleanFFlag<"variable-expansion-in-unroller">,
5232     Group<clang_ignored_gcc_optimization_f_Group>;
5233 defm web : BooleanFFlag<"web">, Group<clang_ignored_gcc_optimization_f_Group>;
5234 defm whole_program : BooleanFFlag<"whole-program">, Group<clang_ignored_gcc_optimization_f_Group>;
5235 defm devirtualize : BooleanFFlag<"devirtualize">, Group<clang_ignored_gcc_optimization_f_Group>;
5236 defm devirtualize_speculatively : BooleanFFlag<"devirtualize-speculatively">,
5237     Group<clang_ignored_gcc_optimization_f_Group>;
5238
5239 // Generic gfortran options.
5240 def A_DASH : Joined<["-"], "A-">, Group<gfortran_Group>;
5241 def static_libgfortran : Flag<["-"], "static-libgfortran">, Group<gfortran_Group>;
5242
5243 // "f" options with values for gfortran.
5244 def fblas_matmul_limit_EQ : Joined<["-"], "fblas-matmul-limit=">, Group<gfortran_Group>;
5245 def fcheck_EQ : Joined<["-"], "fcheck=">, Group<gfortran_Group>;
5246 def fcoarray_EQ : Joined<["-"], "fcoarray=">, Group<gfortran_Group>;
5247 def ffpe_trap_EQ : Joined<["-"], "ffpe-trap=">, Group<gfortran_Group>;
5248 def ffree_line_length_VALUE : Joined<["-"], "ffree-line-length-">, Group<gfortran_Group>;
5249 def finit_character_EQ : Joined<["-"], "finit-character=">, Group<gfortran_Group>;
5250 def finit_integer_EQ : Joined<["-"], "finit-integer=">, Group<gfortran_Group>;
5251 def finit_logical_EQ : Joined<["-"], "finit-logical=">, Group<gfortran_Group>;
5252 def finit_real_EQ : Joined<["-"], "finit-real=">, Group<gfortran_Group>;
5253 def fmax_array_constructor_EQ : Joined<["-"], "fmax-array-constructor=">, Group<gfortran_Group>;
5254 def fmax_errors_EQ : Joined<["-"], "fmax-errors=">, Group<gfortran_Group>;
5255 def fmax_stack_var_size_EQ : Joined<["-"], "fmax-stack-var-size=">, Group<gfortran_Group>;
5256 def fmax_subrecord_length_EQ : Joined<["-"], "fmax-subrecord-length=">, Group<gfortran_Group>;
5257 def frecord_marker_EQ : Joined<["-"], "frecord-marker=">, Group<gfortran_Group>;
5258
5259 // "f" flags for gfortran.
5260 defm aggressive_function_elimination : BooleanFFlag<"aggressive-function-elimination">, Group<gfortran_Group>;
5261 defm align_commons : BooleanFFlag<"align-commons">, Group<gfortran_Group>;
5262 defm all_intrinsics : BooleanFFlag<"all-intrinsics">, Group<gfortran_Group>;
5263 def fautomatic : Flag<["-"], "fautomatic">; // -fno-automatic is significant
5264 defm backtrace : BooleanFFlag<"backtrace">, Group<gfortran_Group>;
5265 defm bounds_check : BooleanFFlag<"bounds-check">, Group<gfortran_Group>;
5266 defm check_array_temporaries : BooleanFFlag<"check-array-temporaries">, Group<gfortran_Group>;
5267 defm cray_pointer : BooleanFFlag<"cray-pointer">, Group<gfortran_Group>;
5268 defm d_lines_as_code : BooleanFFlag<"d-lines-as-code">, Group<gfortran_Group>;
5269 defm d_lines_as_comments : BooleanFFlag<"d-lines-as-comments">, Group<gfortran_Group>;
5270 defm dollar_ok : BooleanFFlag<"dollar-ok">, Group<gfortran_Group>;
5271 defm dump_fortran_optimized : BooleanFFlag<"dump-fortran-optimized">, Group<gfortran_Group>;
5272 defm dump_fortran_original : BooleanFFlag<"dump-fortran-original">, Group<gfortran_Group>;
5273 defm dump_parse_tree : BooleanFFlag<"dump-parse-tree">, Group<gfortran_Group>;
5274 defm external_blas : BooleanFFlag<"external-blas">, Group<gfortran_Group>;
5275 defm f2c : BooleanFFlag<"f2c">, Group<gfortran_Group>;
5276 defm frontend_optimize : BooleanFFlag<"frontend-optimize">, Group<gfortran_Group>;
5277 defm init_local_zero : BooleanFFlag<"init-local-zero">, Group<gfortran_Group>;
5278 defm integer_4_integer_8 : BooleanFFlag<"integer-4-integer-8">, Group<gfortran_Group>;
5279 defm max_identifier_length : BooleanFFlag<"max-identifier-length">, Group<gfortran_Group>;
5280 defm module_private : BooleanFFlag<"module-private">, Group<gfortran_Group>;
5281 defm pack_derived : BooleanFFlag<"pack-derived">, Group<gfortran_Group>;
5282 //defm protect_parens : BooleanFFlag<"protect-parens">, Group<gfortran_Group>;
5283 defm range_check : BooleanFFlag<"range-check">, Group<gfortran_Group>;
5284 defm real_4_real_10 : BooleanFFlag<"real-4-real-10">, Group<gfortran_Group>;
5285 defm real_4_real_16 : BooleanFFlag<"real-4-real-16">, Group<gfortran_Group>;
5286 defm real_4_real_8 : BooleanFFlag<"real-4-real-8">, Group<gfortran_Group>;
5287 defm real_8_real_10 : BooleanFFlag<"real-8-real-10">, Group<gfortran_Group>;
5288 defm real_8_real_16 : BooleanFFlag<"real-8-real-16">, Group<gfortran_Group>;
5289 defm real_8_real_4 : BooleanFFlag<"real-8-real-4">, Group<gfortran_Group>;
5290 defm realloc_lhs : BooleanFFlag<"realloc-lhs">, Group<gfortran_Group>;
5291 defm recursive : BooleanFFlag<"recursive">, Group<gfortran_Group>;
5292 defm repack_arrays : BooleanFFlag<"repack-arrays">, Group<gfortran_Group>;
5293 defm second_underscore : BooleanFFlag<"second-underscore">, Group<gfortran_Group>;
5294 defm sign_zero : BooleanFFlag<"sign-zero">, Group<gfortran_Group>;
5295 defm whole_file : BooleanFFlag<"whole-file">, Group<gfortran_Group>;
5296
5297 // -W <arg> options unsupported by the flang compiler
5298 // If any of these options are passed into flang's compiler driver,
5299 // a warning will be raised and the argument will be claimed
5300 defm : FlangIgnoredDiagOpt<"extra">;
5301 defm : FlangIgnoredDiagOpt<"aliasing">;
5302 defm : FlangIgnoredDiagOpt<"ampersand">;
5303 defm : FlangIgnoredDiagOpt<"array-bounds">;
5304 defm : FlangIgnoredDiagOpt<"c-binding-type">;
5305 defm : FlangIgnoredDiagOpt<"character-truncation">;
5306 defm : FlangIgnoredDiagOpt<"conversion">;
5307 defm : FlangIgnoredDiagOpt<"do-subscript">;
5308 defm : FlangIgnoredDiagOpt<"function-elimination">;
5309 defm : FlangIgnoredDiagOpt<"implicit-interface">;
5310 defm : FlangIgnoredDiagOpt<"implicit-procedure">;
5311 defm : FlangIgnoredDiagOpt<"intrinsic-shadow">;
5312 defm : FlangIgnoredDiagOpt<"use-without-only">;
5313 defm : FlangIgnoredDiagOpt<"intrinsics-std">;
5314 defm : FlangIgnoredDiagOpt<"line-truncation">;
5315 defm : FlangIgnoredDiagOpt<"no-align-commons">;
5316 defm : FlangIgnoredDiagOpt<"no-overwrite-recursive">;
5317 defm : FlangIgnoredDiagOpt<"no-tabs">;
5318 defm : FlangIgnoredDiagOpt<"real-q-constant">;
5319 defm : FlangIgnoredDiagOpt<"surprising">;
5320 defm : FlangIgnoredDiagOpt<"underflow">;
5321 defm : FlangIgnoredDiagOpt<"unused-parameter">;
5322 defm : FlangIgnoredDiagOpt<"realloc-lhs">;
5323 defm : FlangIgnoredDiagOpt<"realloc-lhs-all">;
5324 defm : FlangIgnoredDiagOpt<"frontend-loop-interchange">;
5325 defm : FlangIgnoredDiagOpt<"target-lifetime">;
5326
5327 // C++ SYCL options
5328 def fsycl : Flag<["-"], "fsycl">, Flags<[NoXarchOption, CoreOption]>,
5329   Group<sycl_Group>, HelpText<"Enables SYCL kernels compilation for device">;
5330 def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>,
5331   Group<sycl_Group>, HelpText<"Disables SYCL kernels compilation for device">;
5332
5333 //===----------------------------------------------------------------------===//
5334 // FLangOption + NoXarchOption
5335 //===----------------------------------------------------------------------===//
5336
5337 def flang_experimental_hlfir : Flag<["-"], "flang-experimental-hlfir">,
5338   Flags<[FlangOption, FC1Option, FlangOnlyOption, NoXarchOption, HelpHidden]>,
5339   HelpText<"Use HLFIR lowering (experimental)">;
5340
5341 def flang_experimental_polymorphism : Flag<["-"], "flang-experimental-polymorphism">,
5342   Flags<[FlangOption, FC1Option, FlangOnlyOption, NoXarchOption, HelpHidden]>,
5343   HelpText<"Enable Fortran 2003 polymorphism (experimental)">;
5344
5345
5346 //===----------------------------------------------------------------------===//
5347 // FLangOption + CoreOption + NoXarchOption
5348 //===----------------------------------------------------------------------===//
5349
5350 def Xflang : Separate<["-"], "Xflang">,
5351   HelpText<"Pass <arg> to the flang compiler">, MetaVarName<"<arg>">,
5352   Flags<[FlangOption, FlangOnlyOption, NoXarchOption, CoreOption]>,
5353   Group<CompileOnly_Group>;
5354
5355 //===----------------------------------------------------------------------===//
5356 // FlangOption and FC1 Options
5357 //===----------------------------------------------------------------------===//
5358
5359 let Flags = [FC1Option, FlangOption, FlangOnlyOption] in {
5360
5361 def cpp : Flag<["-"], "cpp">, Group<f_Group>,
5362   HelpText<"Enable predefined and command line preprocessor macros">;
5363 def nocpp : Flag<["-"], "nocpp">, Group<f_Group>,
5364   HelpText<"Disable predefined and command line preprocessor macros">;
5365 def module_dir : JoinedOrSeparate<["-"], "module-dir">, MetaVarName<"<dir>">,
5366   HelpText<"Put MODULE files in <dir>">,
5367   DocBrief<[{This option specifies where to put .mod files for compiled modules.
5368 It is also added to the list of directories to be searched by an USE statement.
5369 The default is the current directory.}]>;
5370
5371 def ffixed_form : Flag<["-"], "ffixed-form">, Group<f_Group>,
5372   HelpText<"Process source files in fixed form">;
5373 def ffree_form : Flag<["-"], "ffree-form">, Group<f_Group>,
5374   HelpText<"Process source files in free form">;
5375 def ffixed_line_length_EQ : Joined<["-"], "ffixed-line-length=">, Group<f_Group>,
5376   HelpText<"Use <value> as character line width in fixed mode">,
5377   DocBrief<[{Set column after which characters are ignored in typical fixed-form lines in the source
5378 file}]>;
5379 def ffixed_line_length_VALUE : Joined<["-"], "ffixed-line-length-">, Group<f_Group>, Alias<ffixed_line_length_EQ>;
5380 def fconvert_EQ : Joined<["-"], "fconvert=">, Group<f_Group>,
5381   HelpText<"Set endian conversion of data for unformatted files">;
5382 def fopenacc : Flag<["-"], "fopenacc">, Group<f_Group>,
5383   HelpText<"Enable OpenACC">;
5384 def fdefault_double_8 : Flag<["-"],"fdefault-double-8">, Group<f_Group>,
5385   HelpText<"Set the default double precision kind to an 8 byte wide type">;
5386 def fdefault_integer_8 : Flag<["-"],"fdefault-integer-8">, Group<f_Group>,
5387   HelpText<"Set the default integer and logical kind to an 8 byte wide type">;
5388 def fdefault_real_8 : Flag<["-"],"fdefault-real-8">, Group<f_Group>,
5389   HelpText<"Set the default real kind to an 8 byte wide type">;
5390 def flarge_sizes : Flag<["-"],"flarge-sizes">, Group<f_Group>,
5391   HelpText<"Use INTEGER(KIND=8) for the result type in size-related intrinsics">;
5392
5393 def falternative_parameter_statement : Flag<["-"], "falternative-parameter-statement">, Group<f_Group>,
5394   HelpText<"Enable the old style PARAMETER statement">;
5395 def fintrinsic_modules_path : Separate<["-"], "fintrinsic-modules-path">,  Group<f_Group>, MetaVarName<"<dir>">,
5396   HelpText<"Specify where to find the compiled intrinsic modules">,
5397   DocBrief<[{This option specifies the location of pre-compiled intrinsic modules,
5398   if they are not in the default location expected by the compiler.}]>;
5399
5400 defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string introduces an escape character">;
5401 defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">;
5402 defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">;
5403 defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">;
5404 defm underscoring : OptInFC1FFlag<"underscoring", "Appends one trailing underscore to external names">;
5405
5406 def fno_automatic : Flag<["-"], "fno-automatic">, Group<f_Group>,
5407   HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">;
5408
5409 defm stack_arrays : BoolOptionWithoutMarshalling<"f", "stack-arrays",
5410   PosFlag<SetTrue, [], "Attempt to allocate array temporaries on the stack, no matter their size">,
5411   NegFlag<SetFalse, [], "Allocate array temporaries on the heap (default)">>;
5412 defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stride",
5413   PosFlag<SetTrue, [], "Create unit-strided versions of loops">,
5414    NegFlag<SetFalse, [], "Do not create unit-strided loops (default)">>;
5415 } // let Flags = [FC1Option, FlangOption, FlangOnlyOption]
5416
5417 def J : JoinedOrSeparate<["-"], "J">,
5418   Flags<[RenderJoined, FlangOption, FC1Option, FlangOnlyOption]>,
5419   Group<gfortran_Group>,
5420   Alias<module_dir>;
5421
5422 //===----------------------------------------------------------------------===//
5423 // FC1 Options
5424 //===----------------------------------------------------------------------===//
5425
5426 let Flags = [FC1Option, FlangOnlyOption] in {
5427
5428 def fget_definition : MultiArg<["-"], "fget-definition", 3>,
5429   HelpText<"Get the symbol definition from <line> <start-column> <end-column>">,
5430   Group<Action_Group>;
5431 def test_io : Flag<["-"], "test-io">, Group<Action_Group>,
5432   HelpText<"Run the InputOuputTest action. Use for development and testing only.">;
5433 def fdebug_unparse_no_sema : Flag<["-"], "fdebug-unparse-no-sema">, Group<Action_Group>,
5434   HelpText<"Unparse and stop (skips the semantic checks)">,
5435   DocBrief<[{Only run the parser, then unparse the parse-tree and output the
5436 generated Fortran source file. Semantic checks are disabled.}]>;
5437 def fdebug_unparse : Flag<["-"], "fdebug-unparse">, Group<Action_Group>,
5438   HelpText<"Unparse and stop.">,
5439   DocBrief<[{Run the parser and the semantic checks. Then unparse the
5440 parse-tree and output the generated Fortran source file.}]>;
5441 def fdebug_unparse_with_symbols : Flag<["-"], "fdebug-unparse-with-symbols">, Group<Action_Group>,
5442   HelpText<"Unparse and stop.">;
5443 def fdebug_dump_symbols : Flag<["-"], "fdebug-dump-symbols">, Group<Action_Group>,
5444   HelpText<"Dump symbols after the semantic analysis">;
5445 def fdebug_dump_parse_tree : Flag<["-"], "fdebug-dump-parse-tree">, Group<Action_Group>,
5446   HelpText<"Dump the parse tree">,
5447   DocBrief<[{Run the Parser and the semantic checks, and then output the
5448 parse tree.}]>;
5449 def fdebug_dump_pft : Flag<["-"], "fdebug-dump-pft">, Group<Action_Group>,
5450   HelpText<"Dump the pre-fir parse tree">;
5451 def fdebug_dump_parse_tree_no_sema : Flag<["-"], "fdebug-dump-parse-tree-no-sema">, Group<Action_Group>,
5452   HelpText<"Dump the parse tree (skips the semantic checks)">,
5453   DocBrief<[{Run the Parser and then output the parse tree. Semantic
5454 checks are disabled.}]>;
5455 def fdebug_dump_all : Flag<["-"], "fdebug-dump-all">, Group<Action_Group>,
5456   HelpText<"Dump symbols and the parse tree after the semantic checks">;
5457 def fdebug_dump_provenance : Flag<["-"], "fdebug-dump-provenance">, Group<Action_Group>,
5458   HelpText<"Dump provenance">;
5459 def fdebug_dump_parsing_log : Flag<["-"], "fdebug-dump-parsing-log">, Group<Action_Group>,
5460   HelpText<"Run instrumented parse and dump the parsing log">;
5461 def fdebug_measure_parse_tree : Flag<["-"], "fdebug-measure-parse-tree">, Group<Action_Group>,
5462   HelpText<"Measure the parse tree">;
5463 def fdebug_pre_fir_tree : Flag<["-"], "fdebug-pre-fir-tree">, Group<Action_Group>,
5464   HelpText<"Dump the pre-FIR tree">;
5465 def fdebug_module_writer : Flag<["-"],"fdebug-module-writer">,
5466   HelpText<"Enable debug messages while writing module files">;
5467 def fget_symbols_sources : Flag<["-"], "fget-symbols-sources">, Group<Action_Group>,
5468   HelpText<"Dump symbols and their source code locations">;
5469
5470 def module_suffix : Separate<["-"], "module-suffix">,  Group<f_Group>, MetaVarName<"<suffix>">,
5471   HelpText<"Use <suffix> as the suffix for module files (the default value is `.mod`)">;
5472 def fno_reformat : Flag<["-"], "fno-reformat">, Group<Preprocessor_Group>,
5473   HelpText<"Dump the cooked character stream in -E mode">;
5474 defm analyzed_objects_for_unparse : OptOutFC1FFlag<"analyzed-objects-for-unparse", "", "Do not use the analyzed objects when unparsing">;
5475
5476 def emit_fir : Flag<["-"], "emit-fir">, Group<Action_Group>,
5477   HelpText<"Build the parse tree, then lower it to FIR">;
5478 def emit_mlir : Flag<["-"], "emit-mlir">, Alias<emit_fir>;
5479
5480 def emit_hlfir : Flag<["-"], "emit-hlfir">, Group<Action_Group>,
5481   HelpText<"Build the parse tree, then lower it to HLFIR">;
5482
5483 } // let Flags = [FC1Option, FlangOnlyOption]
5484
5485 //===----------------------------------------------------------------------===//
5486 // Target Options (cc1 + cc1as)
5487 //===----------------------------------------------------------------------===//
5488
5489 let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
5490
5491 def tune_cpu : Separate<["-"], "tune-cpu">,
5492   HelpText<"Tune for a specific cpu type">,
5493   MarshallingInfoString<TargetOpts<"TuneCPU">>;
5494 def target_abi : Separate<["-"], "target-abi">,
5495   HelpText<"Target a particular ABI type">,
5496   MarshallingInfoString<TargetOpts<"ABI">>;
5497 def target_sdk_version_EQ : Joined<["-"], "target-sdk-version=">,
5498   HelpText<"The version of target SDK used for compilation">;
5499 def darwin_target_variant_sdk_version_EQ : Joined<["-"],
5500   "darwin-target-variant-sdk-version=">,
5501   HelpText<"The version of darwin target variant SDK used for compilation">;
5502
5503 } // let Flags = [CC1Option, CC1AsOption, NoDriverOption]
5504
5505 let Flags = [CC1Option, CC1AsOption] in {
5506
5507 def darwin_target_variant_triple : Separate<["-"], "darwin-target-variant-triple">,
5508   HelpText<"Specify the darwin target variant triple">,
5509   MarshallingInfoString<TargetOpts<"DarwinTargetVariantTriple">>,
5510   Normalizer<"normalizeTriple">;
5511
5512 } // let Flags = [CC1Option, CC1AsOption]
5513
5514 //===----------------------------------------------------------------------===//
5515 // Target Options (cc1 + cc1as + fc1)
5516 //===----------------------------------------------------------------------===//
5517
5518 let Flags = [CC1Option, CC1AsOption, FC1Option, NoDriverOption] in {
5519
5520 def target_cpu : Separate<["-"], "target-cpu">,
5521   HelpText<"Target a specific cpu type">,
5522   MarshallingInfoString<TargetOpts<"CPU">>;
5523 def target_feature : Separate<["-"], "target-feature">,
5524   HelpText<"Target specific attributes">,
5525   MarshallingInfoStringVector<TargetOpts<"FeaturesAsWritten">>;
5526 def triple : Separate<["-"], "triple">,
5527   HelpText<"Specify target triple (e.g. i686-apple-darwin9)">,
5528   MarshallingInfoString<TargetOpts<"Triple">, "llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple())">,
5529   AlwaysEmit, Normalizer<"normalizeTriple">;
5530
5531 } // let Flags = [CC1Option, CC1ASOption, FC1Option, NoDriverOption]
5532
5533 //===----------------------------------------------------------------------===//
5534 // Target Options (other)
5535 //===----------------------------------------------------------------------===//
5536
5537 let Flags = [CC1Option, NoDriverOption] in {
5538
5539 def target_linker_version : Separate<["-"], "target-linker-version">,
5540   HelpText<"Target linker version">,
5541   MarshallingInfoString<TargetOpts<"LinkerVersion">>;
5542 def triple_EQ : Joined<["-"], "triple=">, Alias<triple>;
5543 def mfpmath : Separate<["-"], "mfpmath">,
5544   HelpText<"Which unit to use for fp math">,
5545   MarshallingInfoString<TargetOpts<"FPMath">>;
5546
5547 defm padding_on_unsigned_fixed_point : BoolOption<"f", "padding-on-unsigned-fixed-point",
5548   LangOpts<"PaddingOnUnsignedFixedPoint">, DefaultFalse,
5549   PosFlag<SetTrue, [], "Force each unsigned fixed point type to have an extra bit of padding to align their scales with those of signed fixed point types">,
5550   NegFlag<SetFalse>>,
5551   ShouldParseIf<ffixed_point.KeyPath>;
5552
5553 } // let Flags = [CC1Option, NoDriverOption]
5554
5555 //===----------------------------------------------------------------------===//
5556 // Analyzer Options
5557 //===----------------------------------------------------------------------===//
5558
5559 let Flags = [CC1Option, NoDriverOption] in {
5560
5561 def analysis_UnoptimizedCFG : Flag<["-"], "unoptimized-cfg">,
5562   HelpText<"Generate unoptimized CFGs for all analyses">,
5563   MarshallingInfoFlag<AnalyzerOpts<"UnoptimizedCFG">>;
5564 def analysis_CFGAddImplicitDtors : Flag<["-"], "cfg-add-implicit-dtors">,
5565   HelpText<"Add C++ implicit destructors to CFGs for all analyses">;
5566
5567 def analyzer_constraints : Separate<["-"], "analyzer-constraints">,
5568   HelpText<"Source Code Analysis - Symbolic Constraint Engines">;
5569 def analyzer_constraints_EQ : Joined<["-"], "analyzer-constraints=">,
5570   Alias<analyzer_constraints>;
5571
5572 def analyzer_output : Separate<["-"], "analyzer-output">,
5573   HelpText<"Source Code Analysis - Output Options">;
5574 def analyzer_output_EQ : Joined<["-"], "analyzer-output=">,
5575   Alias<analyzer_output>;
5576
5577 def analyzer_purge : Separate<["-"], "analyzer-purge">,
5578   HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">;
5579 def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias<analyzer_purge>;
5580
5581 def analyzer_opt_analyze_headers : Flag<["-"], "analyzer-opt-analyze-headers">,
5582   HelpText<"Force the static analyzer to analyze functions defined in header files">,
5583   MarshallingInfoFlag<AnalyzerOpts<"AnalyzeAll">>;
5584 def analyzer_display_progress : Flag<["-"], "analyzer-display-progress">,
5585   HelpText<"Emit verbose output about the analyzer's progress">,
5586   MarshallingInfoFlag<AnalyzerOpts<"AnalyzerDisplayProgress">>;
5587 def analyze_function : Separate<["-"], "analyze-function">,
5588   HelpText<"Run analysis on specific function (for C++ include parameters in name)">,
5589   MarshallingInfoString<AnalyzerOpts<"AnalyzeSpecificFunction">>;
5590 def analyze_function_EQ : Joined<["-"], "analyze-function=">, Alias<analyze_function>;
5591 def trim_egraph : Flag<["-"], "trim-egraph">,
5592   HelpText<"Only show error-related paths in the analysis graph">,
5593   MarshallingInfoFlag<AnalyzerOpts<"TrimGraph">>;
5594 def analyzer_viz_egraph_graphviz : Flag<["-"], "analyzer-viz-egraph-graphviz">,
5595   HelpText<"Display exploded graph using GraphViz">,
5596   MarshallingInfoFlag<AnalyzerOpts<"visualizeExplodedGraphWithGraphViz">>;
5597 def analyzer_dump_egraph : Separate<["-"], "analyzer-dump-egraph">,
5598   HelpText<"Dump exploded graph to the specified file">,
5599   MarshallingInfoString<AnalyzerOpts<"DumpExplodedGraphTo">>;
5600 def analyzer_dump_egraph_EQ : Joined<["-"], "analyzer-dump-egraph=">, Alias<analyzer_dump_egraph>;
5601
5602 def analyzer_inline_max_stack_depth : Separate<["-"], "analyzer-inline-max-stack-depth">,
5603   HelpText<"Bound on stack depth while inlining (4 by default)">,
5604   // Cap the stack depth at 4 calls (5 stack frames, base + 4 calls).
5605   MarshallingInfoInt<AnalyzerOpts<"InlineMaxStackDepth">, "5">;
5606 def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">,
5607   Alias<analyzer_inline_max_stack_depth>;
5608
5609 def analyzer_inlining_mode : Separate<["-"], "analyzer-inlining-mode">,
5610   HelpText<"Specify the function selection heuristic used during inlining">;
5611 def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>;
5612
5613 def analyzer_disable_retry_exhausted : Flag<["-"], "analyzer-disable-retry-exhausted">,
5614   HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">,
5615   MarshallingInfoFlag<AnalyzerOpts<"NoRetryExhausted">>;
5616
5617 def analyzer_max_loop : Separate<["-"], "analyzer-max-loop">,
5618   HelpText<"The maximum number of times the analyzer will go through a loop">,
5619   MarshallingInfoInt<AnalyzerOpts<"maxBlockVisitOnPath">, "4">;
5620 def analyzer_stats : Flag<["-"], "analyzer-stats">,
5621   HelpText<"Print internal analyzer statistics.">,
5622   MarshallingInfoFlag<AnalyzerOpts<"PrintStats">>;
5623
5624 def analyzer_checker : Separate<["-"], "analyzer-checker">,
5625   HelpText<"Choose analyzer checkers to enable">,
5626   ValuesCode<[{
5627     static constexpr const char VALUES_CODE [] =
5628     #define GET_CHECKERS
5629     #define CHECKER(FULLNAME, CLASS, HT, DOC_URI, IS_HIDDEN)  FULLNAME ","
5630     #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
5631     #undef GET_CHECKERS
5632     #define GET_PACKAGES
5633     #define PACKAGE(FULLNAME)  FULLNAME ","
5634     #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
5635     #undef GET_PACKAGES
5636     ;
5637   }]>;
5638 def analyzer_checker_EQ : Joined<["-"], "analyzer-checker=">,
5639   Alias<analyzer_checker>;
5640
5641 def analyzer_disable_checker : Separate<["-"], "analyzer-disable-checker">,
5642   HelpText<"Choose analyzer checkers to disable">;
5643 def analyzer_disable_checker_EQ : Joined<["-"], "analyzer-disable-checker=">,
5644   Alias<analyzer_disable_checker>;
5645
5646 def analyzer_disable_all_checks : Flag<["-"], "analyzer-disable-all-checks">,
5647   HelpText<"Disable all static analyzer checks">,
5648   MarshallingInfoFlag<AnalyzerOpts<"DisableAllCheckers">>;
5649
5650 def analyzer_checker_help : Flag<["-"], "analyzer-checker-help">,
5651   HelpText<"Display the list of analyzer checkers that are available">,
5652   MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelp">>;
5653
5654 def analyzer_checker_help_alpha : Flag<["-"], "analyzer-checker-help-alpha">,
5655   HelpText<"Display the list of in development analyzer checkers. These "
5656            "are NOT considered safe, they are unstable and will emit incorrect "
5657            "reports. Enable ONLY FOR DEVELOPMENT purposes">,
5658   MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelpAlpha">>;
5659
5660 def analyzer_checker_help_developer : Flag<["-"], "analyzer-checker-help-developer">,
5661   HelpText<"Display the list of developer-only checkers such as modeling "
5662            "and debug checkers">,
5663   MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelpDeveloper">>;
5664
5665 def analyzer_config_help : Flag<["-"], "analyzer-config-help">,
5666   HelpText<"Display the list of -analyzer-config options. These are meant for "
5667            "development purposes only!">,
5668   MarshallingInfoFlag<AnalyzerOpts<"ShowConfigOptionsList">>;
5669
5670 def analyzer_list_enabled_checkers : Flag<["-"], "analyzer-list-enabled-checkers">,
5671   HelpText<"Display the list of enabled analyzer checkers">,
5672   MarshallingInfoFlag<AnalyzerOpts<"ShowEnabledCheckerList">>;
5673
5674 def analyzer_config : Separate<["-"], "analyzer-config">,
5675   HelpText<"Choose analyzer options to enable">;
5676
5677 def analyzer_checker_option_help : Flag<["-"], "analyzer-checker-option-help">,
5678   HelpText<"Display the list of checker and package options">,
5679   MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionList">>;
5680
5681 def analyzer_checker_option_help_alpha : Flag<["-"], "analyzer-checker-option-help-alpha">,
5682   HelpText<"Display the list of in development checker and package options. "
5683            "These are NOT considered safe, they are unstable and will emit "
5684            "incorrect reports. Enable ONLY FOR DEVELOPMENT purposes">,
5685   MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionAlphaList">>;
5686
5687 def analyzer_checker_option_help_developer : Flag<["-"], "analyzer-checker-option-help-developer">,
5688   HelpText<"Display the list of checker and package options meant for "
5689            "development purposes only">,
5690   MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionDeveloperList">>;
5691
5692 def analyzer_config_compatibility_mode : Separate<["-"], "analyzer-config-compatibility-mode">,
5693   HelpText<"Don't emit errors on invalid analyzer-config inputs">,
5694   Values<"true,false">, NormalizedValues<[[{false}], [{true}]]>,
5695   MarshallingInfoEnum<AnalyzerOpts<"ShouldEmitErrorsOnInvalidConfigValue">, [{true}]>;
5696
5697 def analyzer_config_compatibility_mode_EQ : Joined<["-"], "analyzer-config-compatibility-mode=">,
5698   Alias<analyzer_config_compatibility_mode>;
5699
5700 def analyzer_werror : Flag<["-"], "analyzer-werror">,
5701   HelpText<"Emit analyzer results as errors rather than warnings">,
5702   MarshallingInfoFlag<AnalyzerOpts<"AnalyzerWerror">>;
5703
5704 } // let Flags = [CC1Option, NoDriverOption]
5705
5706 //===----------------------------------------------------------------------===//
5707 // Migrator Options
5708 //===----------------------------------------------------------------------===//
5709
5710 def migrator_no_nsalloc_error : Flag<["-"], "no-ns-alloc-error">,
5711   HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">,
5712   Flags<[CC1Option, NoDriverOption]>,
5713   MarshallingInfoFlag<MigratorOpts<"NoNSAllocReallocError">>;
5714
5715 def migrator_no_finalize_removal : Flag<["-"], "no-finalize-removal">,
5716   HelpText<"Do not remove finalize method in gc mode">,
5717   Flags<[CC1Option, NoDriverOption]>,
5718   MarshallingInfoFlag<MigratorOpts<"NoFinalizeRemoval">>;
5719
5720 //===----------------------------------------------------------------------===//
5721 // CodeGen Options
5722 //===----------------------------------------------------------------------===//
5723
5724 let Flags = [CC1Option, CC1AsOption, FC1Option, NoDriverOption] in {
5725
5726 def mrelocation_model : Separate<["-"], "mrelocation-model">,
5727   HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">,
5728   NormalizedValuesScope<"llvm::Reloc">,
5729   NormalizedValues<["Static", "PIC_", "ROPI", "RWPI", "ROPI_RWPI", "DynamicNoPIC"]>,
5730   MarshallingInfoEnum<CodeGenOpts<"RelocationModel">, "PIC_">;
5731 def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
5732
5733 } // let Flags = [CC1Option, CC1AsOption, FC1Option, NoDriverOption]
5734
5735 let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
5736
5737 def debug_info_macro : Flag<["-"], "debug-info-macro">,
5738   HelpText<"Emit macro debug information">,
5739   MarshallingInfoFlag<CodeGenOpts<"MacroDebugInfo">>;
5740 def default_function_attr : Separate<["-"], "default-function-attr">,
5741   HelpText<"Apply given attribute to all functions">,
5742   MarshallingInfoStringVector<CodeGenOpts<"DefaultFunctionAttrs">>;
5743 def dwarf_version_EQ : Joined<["-"], "dwarf-version=">,
5744   MarshallingInfoInt<CodeGenOpts<"DwarfVersion">>;
5745 def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">,
5746   Values<"gdb,lldb,sce,dbx">,
5747   NormalizedValuesScope<"llvm::DebuggerKind">, NormalizedValues<["GDB", "LLDB", "SCE", "DBX"]>,
5748   MarshallingInfoEnum<CodeGenOpts<"DebuggerTuning">, "Default">;
5749 def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
5750   HelpText<"The string to embed in the Dwarf debug flags record.">,
5751   MarshallingInfoString<CodeGenOpts<"DwarfDebugFlags">>;
5752 def record_command_line : Separate<["-"], "record-command-line">,
5753   HelpText<"The string to embed in the .LLVM.command.line section.">,
5754   MarshallingInfoString<CodeGenOpts<"RecordCommandLine">>;
5755 def compress_debug_sections_EQ : Joined<["-", "--"], "compress-debug-sections=">,
5756     HelpText<"DWARF debug sections compression type">, Values<"none,zlib,zstd">,
5757     NormalizedValuesScope<"llvm::DebugCompressionType">, NormalizedValues<["None", "Zlib", "Zstd"]>,
5758     MarshallingInfoEnum<CodeGenOpts<"CompressDebugSections">, "None">;
5759 def compress_debug_sections : Flag<["-", "--"], "compress-debug-sections">,
5760   Alias<compress_debug_sections_EQ>, AliasArgs<["zlib"]>;
5761 def mno_exec_stack : Flag<["-"], "mnoexecstack">,
5762   HelpText<"Mark the file as not needing an executable stack">,
5763   MarshallingInfoFlag<CodeGenOpts<"NoExecStack">>;
5764 def massembler_no_warn : Flag<["-"], "massembler-no-warn">,
5765   HelpText<"Make assembler not emit warnings">,
5766   MarshallingInfoFlag<CodeGenOpts<"NoWarn">>;
5767 def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
5768   HelpText<"Make assembler warnings fatal">,
5769   MarshallingInfoFlag<CodeGenOpts<"FatalWarnings">>;
5770 def mrelax_relocations_no : Flag<["-"], "mrelax-relocations=no">,
5771     HelpText<"Disable x86 relax relocations">,
5772     MarshallingInfoNegativeFlag<CodeGenOpts<"RelaxELFRelocations">>;
5773 def msave_temp_labels : Flag<["-"], "msave-temp-labels">,
5774   HelpText<"Save temporary labels in the symbol table. "
5775            "Note this may change .s semantics and shouldn't generally be used "
5776            "on compiler-generated code.">,
5777   MarshallingInfoFlag<CodeGenOpts<"SaveTempLabels">>;
5778 def mno_type_check : Flag<["-"], "mno-type-check">,
5779   HelpText<"Don't perform type checking of the assembly code (wasm only)">,
5780   MarshallingInfoFlag<CodeGenOpts<"NoTypeCheck">>;
5781 def fno_math_builtin : Flag<["-"], "fno-math-builtin">,
5782   HelpText<"Disable implicit builtin knowledge of math functions">,
5783   MarshallingInfoFlag<LangOpts<"NoMathBuiltin">>;
5784 def fno_use_ctor_homing: Flag<["-"], "fno-use-ctor-homing">,
5785     HelpText<"Don't use constructor homing for debug info">;
5786 def fuse_ctor_homing: Flag<["-"], "fuse-ctor-homing">,
5787     HelpText<"Use constructor homing if we are using limited debug info already">;
5788 def as_secure_log_file : Separate<["-"], "as-secure-log-file">,
5789   HelpText<"Emit .secure_log_unique directives to this filename.">,
5790   MarshallingInfoString<CodeGenOpts<"AsSecureLogFile">>;
5791
5792 } // let Flags = [CC1Option, CC1AsOption, NoDriverOption]
5793
5794 let Flags = [CC1Option, NoDriverOption] in {
5795
5796 def llvm_verify_each : Flag<["-"], "llvm-verify-each">,
5797   HelpText<"Run the LLVM verifier after every LLVM pass">,
5798   MarshallingInfoFlag<CodeGenOpts<"VerifyEach">>;
5799 def disable_llvm_verifier : Flag<["-"], "disable-llvm-verifier">,
5800   HelpText<"Don't run the LLVM IR verifier pass">,
5801   MarshallingInfoNegativeFlag<CodeGenOpts<"VerifyModule">>;
5802 def disable_llvm_passes : Flag<["-"], "disable-llvm-passes">,
5803   HelpText<"Use together with -emit-llvm to get pristine LLVM IR from the "
5804            "frontend by not running any LLVM passes at all">,
5805   MarshallingInfoFlag<CodeGenOpts<"DisableLLVMPasses">>;
5806 def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">,
5807   Alias<disable_llvm_passes>;
5808 def disable_lifetimemarkers : Flag<["-"], "disable-lifetime-markers">,
5809   HelpText<"Disable lifetime-markers emission even when optimizations are "
5810            "enabled">,
5811   MarshallingInfoFlag<CodeGenOpts<"DisableLifetimeMarkers">>;
5812 def disable_O0_optnone : Flag<["-"], "disable-O0-optnone">,
5813   HelpText<"Disable adding the optnone attribute to functions at O0">,
5814   MarshallingInfoFlag<CodeGenOpts<"DisableO0ImplyOptNone">>;
5815 def disable_red_zone : Flag<["-"], "disable-red-zone">,
5816   HelpText<"Do not emit code that uses the red zone.">,
5817   MarshallingInfoFlag<CodeGenOpts<"DisableRedZone">>;
5818 def dwarf_ext_refs : Flag<["-"], "dwarf-ext-refs">,
5819   HelpText<"Generate debug info with external references to clang modules"
5820            " or precompiled headers">,
5821   MarshallingInfoFlag<CodeGenOpts<"DebugTypeExtRefs">>;
5822 def dwarf_explicit_import : Flag<["-"], "dwarf-explicit-import">,
5823   HelpText<"Generate explicit import from anonymous namespace to containing"
5824            " scope">,
5825   MarshallingInfoFlag<CodeGenOpts<"DebugExplicitImport">>;
5826 def debug_forward_template_params : Flag<["-"], "debug-forward-template-params">,
5827   HelpText<"Emit complete descriptions of template parameters in forward"
5828            " declarations">,
5829   MarshallingInfoFlag<CodeGenOpts<"DebugFwdTemplateParams">>;
5830 def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">,
5831   HelpText<"Emit an error if a C++ static local initializer would need a guard variable">,
5832   MarshallingInfoFlag<CodeGenOpts<"ForbidGuardVariables">>;
5833 def no_implicit_float : Flag<["-"], "no-implicit-float">,
5834   HelpText<"Don't generate implicit floating point or vector instructions">,
5835   MarshallingInfoFlag<CodeGenOpts<"NoImplicitFloat">>;
5836 def fdump_vtable_layouts : Flag<["-"], "fdump-vtable-layouts">,
5837   HelpText<"Dump the layouts of all vtables that will be emitted in a translation unit">,
5838   MarshallingInfoFlag<LangOpts<"DumpVTableLayouts">>;
5839 def fmerge_functions : Flag<["-"], "fmerge-functions">,
5840   HelpText<"Permit merging of identical functions when optimizing.">,
5841   MarshallingInfoFlag<CodeGenOpts<"MergeFunctions">>;
5842 def coverage_data_file : Separate<["-"], "coverage-data-file">,
5843   HelpText<"Emit coverage data to this filename.">,
5844   MarshallingInfoString<CodeGenOpts<"CoverageDataFile">>;
5845 def coverage_data_file_EQ : Joined<["-"], "coverage-data-file=">,
5846   Alias<coverage_data_file>;
5847 def coverage_notes_file : Separate<["-"], "coverage-notes-file">,
5848   HelpText<"Emit coverage notes to this filename.">,
5849   MarshallingInfoString<CodeGenOpts<"CoverageNotesFile">>;
5850 def coverage_notes_file_EQ : Joined<["-"], "coverage-notes-file=">,
5851   Alias<coverage_notes_file>;
5852 def coverage_version_EQ : Joined<["-"], "coverage-version=">,
5853   HelpText<"Four-byte version string for gcov files.">;
5854 def dump_coverage_mapping : Flag<["-"], "dump-coverage-mapping">,
5855   HelpText<"Dump the coverage mapping records, for testing">,
5856   MarshallingInfoFlag<CodeGenOpts<"DumpCoverageMapping">>;
5857 def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">,
5858   HelpText<"Use register sized accesses to bit-fields, when possible.">,
5859   MarshallingInfoFlag<CodeGenOpts<"UseRegisterSizedBitfieldAccess">>;
5860 def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
5861   HelpText<"Turn off Type Based Alias Analysis">,
5862   MarshallingInfoFlag<CodeGenOpts<"RelaxedAliasing">>;
5863 def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">,
5864   HelpText<"Turn off struct-path aware Type Based Alias Analysis">,
5865   MarshallingInfoNegativeFlag<CodeGenOpts<"StructPathTBAA">>;
5866 def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">,
5867   HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">;
5868 def mdebug_pass : Separate<["-"], "mdebug-pass">,
5869   HelpText<"Enable additional debug output">,
5870   MarshallingInfoString<CodeGenOpts<"DebugPass">>;
5871 def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">,
5872   HelpText<"Specify which frame pointers to retain.">, Values<"all,non-leaf,none">,
5873   NormalizedValuesScope<"CodeGenOptions::FramePointerKind">, NormalizedValues<["All", "NonLeaf", "None"]>,
5874   MarshallingInfoEnum<CodeGenOpts<"FramePointer">, "None">;
5875 def mabi_EQ_ieeelongdouble : Flag<["-"], "mabi=ieeelongdouble">,
5876   HelpText<"Use IEEE 754 quadruple-precision for long double">,
5877   MarshallingInfoFlag<LangOpts<"PPCIEEELongDouble">>;
5878 def mabi_EQ_vec_extabi : Flag<["-"], "mabi=vec-extabi">,
5879   HelpText<"Enable the extended Altivec ABI on AIX. Use volatile and nonvolatile vector registers">,
5880   MarshallingInfoFlag<LangOpts<"EnableAIXExtendedAltivecABI">>;
5881 def mfloat_abi : Separate<["-"], "mfloat-abi">,
5882   HelpText<"The float ABI to use">,
5883   MarshallingInfoString<CodeGenOpts<"FloatABI">>;
5884 def mtp : Separate<["-"], "mtp">,
5885   HelpText<"Mode for reading thread pointer">;
5886 def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
5887   HelpText<"Limit float precision to the given value">,
5888   MarshallingInfoString<CodeGenOpts<"LimitFloatPrecision">>;
5889 def mregparm : Separate<["-"], "mregparm">,
5890   HelpText<"Limit the number of registers available for integer arguments">,
5891   MarshallingInfoInt<CodeGenOpts<"NumRegisterParameters">>;
5892 def msmall_data_limit : Separate<["-"], "msmall-data-limit">,
5893   HelpText<"Put global and static data smaller than the limit into a special section">,
5894   MarshallingInfoInt<CodeGenOpts<"SmallDataLimit">>;
5895 def funwind_tables_EQ : Joined<["-"], "funwind-tables=">,
5896   HelpText<"Generate unwinding tables for all functions">,
5897   MarshallingInfoInt<CodeGenOpts<"UnwindTables">>;
5898 defm constructor_aliases : BoolOption<"m", "constructor-aliases",
5899   CodeGenOpts<"CXXCtorDtorAliases">, DefaultFalse,
5900   PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
5901   BothFlags<[CC1Option], " emitting complete constructors and destructors as aliases when possible">>;
5902 def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">,
5903   HelpText<"Link the given bitcode file before performing optimizations.">;
5904 def mlink_builtin_bitcode : Separate<["-"], "mlink-builtin-bitcode">,
5905   HelpText<"Link and internalize needed symbols from the given bitcode file "
5906            "before performing optimizations.">;
5907 def vectorize_loops : Flag<["-"], "vectorize-loops">,
5908   HelpText<"Run the Loop vectorization passes">,
5909   MarshallingInfoFlag<CodeGenOpts<"VectorizeLoop">>;
5910 def vectorize_slp : Flag<["-"], "vectorize-slp">,
5911   HelpText<"Run the SLP vectorization passes">,
5912   MarshallingInfoFlag<CodeGenOpts<"VectorizeSLP">>;
5913 def dependent_lib : Joined<["--"], "dependent-lib=">,
5914   HelpText<"Add dependent library">,
5915   MarshallingInfoStringVector<CodeGenOpts<"DependentLibraries">>;
5916 def linker_option : Joined<["--"], "linker-option=">,
5917   HelpText<"Add linker option">,
5918   MarshallingInfoStringVector<CodeGenOpts<"LinkerOptions">>;
5919 def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
5920                               HelpText<"Sanitizer coverage type">,
5921                               MarshallingInfoInt<CodeGenOpts<"SanitizeCoverageType">>;
5922 def fsanitize_coverage_indirect_calls
5923     : Flag<["-"], "fsanitize-coverage-indirect-calls">,
5924       HelpText<"Enable sanitizer coverage for indirect calls">,
5925       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageIndirectCalls">>;
5926 def fsanitize_coverage_trace_bb
5927     : Flag<["-"], "fsanitize-coverage-trace-bb">,
5928       HelpText<"Enable basic block tracing in sanitizer coverage">,
5929       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceBB">>;
5930 def fsanitize_coverage_trace_cmp
5931     : Flag<["-"], "fsanitize-coverage-trace-cmp">,
5932       HelpText<"Enable cmp instruction tracing in sanitizer coverage">,
5933       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceCmp">>;
5934 def fsanitize_coverage_trace_div
5935     : Flag<["-"], "fsanitize-coverage-trace-div">,
5936       HelpText<"Enable div instruction tracing in sanitizer coverage">,
5937       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceDiv">>;
5938 def fsanitize_coverage_trace_gep
5939     : Flag<["-"], "fsanitize-coverage-trace-gep">,
5940       HelpText<"Enable gep instruction tracing in sanitizer coverage">,
5941       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceGep">>;
5942 def fsanitize_coverage_8bit_counters
5943     : Flag<["-"], "fsanitize-coverage-8bit-counters">,
5944       HelpText<"Enable frequency counters in sanitizer coverage">,
5945       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverage8bitCounters">>;
5946 def fsanitize_coverage_inline_8bit_counters
5947     : Flag<["-"], "fsanitize-coverage-inline-8bit-counters">,
5948       HelpText<"Enable inline 8-bit counters in sanitizer coverage">,
5949       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInline8bitCounters">>;
5950 def fsanitize_coverage_inline_bool_flag
5951     : Flag<["-"], "fsanitize-coverage-inline-bool-flag">,
5952       HelpText<"Enable inline bool flag in sanitizer coverage">,
5953       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInlineBoolFlag">>;
5954 def fsanitize_coverage_pc_table
5955     : Flag<["-"], "fsanitize-coverage-pc-table">,
5956       HelpText<"Create a table of coverage-instrumented PCs">,
5957       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoveragePCTable">>;
5958 def fsanitize_coverage_control_flow
5959     : Flag<["-"], "fsanitize-coverage-control-flow">,
5960       HelpText<"Collect control flow of function">,
5961       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageControlFlow">>;
5962 def fsanitize_coverage_trace_pc
5963     : Flag<["-"], "fsanitize-coverage-trace-pc">,
5964       HelpText<"Enable PC tracing in sanitizer coverage">,
5965       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePC">>;
5966 def fsanitize_coverage_trace_pc_guard
5967     : Flag<["-"], "fsanitize-coverage-trace-pc-guard">,
5968       HelpText<"Enable PC tracing with guard in sanitizer coverage">,
5969       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePCGuard">>;
5970 def fsanitize_coverage_no_prune
5971     : Flag<["-"], "fsanitize-coverage-no-prune">,
5972       HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">,
5973       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageNoPrune">>;
5974 def fsanitize_coverage_stack_depth
5975     : Flag<["-"], "fsanitize-coverage-stack-depth">,
5976       HelpText<"Enable max stack depth tracing">,
5977       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageStackDepth">>;
5978 def fsanitize_coverage_trace_loads
5979     : Flag<["-"], "fsanitize-coverage-trace-loads">,
5980       HelpText<"Enable tracing of loads">,
5981       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceLoads">>;
5982 def fsanitize_coverage_trace_stores
5983     : Flag<["-"], "fsanitize-coverage-trace-stores">,
5984       HelpText<"Enable tracing of stores">,
5985       MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceStores">>;
5986 def fexperimental_sanitize_metadata_EQ_covered
5987     : Flag<["-"], "fexperimental-sanitize-metadata=covered">,
5988       HelpText<"Emit PCs for code covered with binary analysis sanitizers">,
5989       MarshallingInfoFlag<CodeGenOpts<"SanitizeBinaryMetadataCovered">>;
5990 def fexperimental_sanitize_metadata_EQ_atomics
5991     : Flag<["-"], "fexperimental-sanitize-metadata=atomics">,
5992       HelpText<"Emit PCs for atomic operations used by binary analysis sanitizers">,
5993       MarshallingInfoFlag<CodeGenOpts<"SanitizeBinaryMetadataAtomics">>;
5994 def fexperimental_sanitize_metadata_EQ_uar
5995     : Flag<["-"], "fexperimental-sanitize-metadata=uar">,
5996       HelpText<"Emit PCs for start of functions that are subject for use-after-return checking.">,
5997       MarshallingInfoFlag<CodeGenOpts<"SanitizeBinaryMetadataUAR">>;
5998 def fpatchable_function_entry_offset_EQ
5999     : Joined<["-"], "fpatchable-function-entry-offset=">, MetaVarName<"<M>">,
6000       HelpText<"Generate M NOPs before function entry">,
6001       MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryOffset">>;
6002 def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
6003     HelpText<"Enable PGO instrumentation">, Values<"none,clang,llvm,csllvm">,
6004     NormalizedValuesScope<"CodeGenOptions">,
6005     NormalizedValues<["ProfileNone", "ProfileClangInstr", "ProfileIRInstr", "ProfileCSIRInstr"]>,
6006     MarshallingInfoEnum<CodeGenOpts<"ProfileInstr">, "ProfileNone">;
6007 def fprofile_instrument_path_EQ : Joined<["-"], "fprofile-instrument-path=">,
6008     HelpText<"Generate instrumented code to collect execution counts into "
6009              "<file> (overridden by LLVM_PROFILE_FILE env var)">,
6010     MarshallingInfoString<CodeGenOpts<"InstrProfileOutput">>;
6011 def fprofile_instrument_use_path_EQ :
6012     Joined<["-"], "fprofile-instrument-use-path=">,
6013     HelpText<"Specify the profile path in PGO use compilation">,
6014     MarshallingInfoString<CodeGenOpts<"ProfileInstrumentUsePath">>;
6015 def flto_visibility_public_std:
6016     Flag<["-"], "flto-visibility-public-std">,
6017     HelpText<"Use public LTO visibility for classes in std and stdext namespaces">,
6018     MarshallingInfoFlag<CodeGenOpts<"LTOVisibilityPublicStd">>;
6019 defm lto_unit : BoolOption<"f", "lto-unit",
6020   CodeGenOpts<"LTOUnit">, DefaultFalse,
6021   PosFlag<SetTrue, [CC1Option], "Emit IR to support LTO unit features (CFI, whole program vtable opt)">,
6022   NegFlag<SetFalse>>;
6023 def fverify_debuginfo_preserve
6024     : Flag<["-"], "fverify-debuginfo-preserve">,
6025       HelpText<"Enable Debug Info Metadata preservation testing in "
6026                "optimizations.">,
6027       MarshallingInfoFlag<CodeGenOpts<"EnableDIPreservationVerify">>;
6028 def fverify_debuginfo_preserve_export
6029     : Joined<["-"], "fverify-debuginfo-preserve-export=">,
6030       MetaVarName<"<file>">,
6031       HelpText<"Export debug info (by testing original Debug Info) failures "
6032                "into specified (JSON) file (should be abs path as we use "
6033                "append mode to insert new JSON objects).">,
6034       MarshallingInfoString<CodeGenOpts<"DIBugsReportFilePath">>;
6035 def fwarn_stack_size_EQ
6036     : Joined<["-"], "fwarn-stack-size=">,
6037       MarshallingInfoInt<CodeGenOpts<"WarnStackSize">, "UINT_MAX">;
6038 // The driver option takes the key as a parameter to the -msign-return-address=
6039 // and -mbranch-protection= options, but CC1 has a separate option so we
6040 // don't have to parse the parameter twice.
6041 def msign_return_address_key_EQ : Joined<["-"], "msign-return-address-key=">,
6042     Values<"a_key,b_key">;
6043 def mbranch_target_enforce : Flag<["-"], "mbranch-target-enforce">,
6044   MarshallingInfoFlag<LangOpts<"BranchTargetEnforcement">>;
6045 def fno_dllexport_inlines : Flag<["-"], "fno-dllexport-inlines">,
6046   MarshallingInfoNegativeFlag<LangOpts<"DllExportInlines">>;
6047 def cfguard_no_checks : Flag<["-"], "cfguard-no-checks">,
6048     HelpText<"Emit Windows Control Flow Guard tables only (no checks)">,
6049     MarshallingInfoFlag<CodeGenOpts<"ControlFlowGuardNoChecks">>;
6050 def cfguard : Flag<["-"], "cfguard">,
6051     HelpText<"Emit Windows Control Flow Guard tables and checks">,
6052     MarshallingInfoFlag<CodeGenOpts<"ControlFlowGuard">>;
6053 def ehcontguard : Flag<["-"], "ehcontguard">,
6054     HelpText<"Emit Windows EH Continuation Guard tables">,
6055     MarshallingInfoFlag<CodeGenOpts<"EHContGuard">>;
6056
6057 def fdenormal_fp_math_f32_EQ : Joined<["-"], "fdenormal-fp-math-f32=">,
6058    Group<f_Group>;
6059
6060 def fctor_dtor_return_this : Flag<["-"], "fctor-dtor-return-this">,
6061   HelpText<"Change the C++ ABI to returning `this` pointer from constructors "
6062            "and non-deleting destructors. (No effect on Microsoft ABI)">,
6063   MarshallingInfoFlag<CodeGenOpts<"CtorDtorReturnThis">>;
6064
6065 def fexperimental_assignment_tracking_EQ : Joined<["-"], "fexperimental-assignment-tracking=">,
6066   Group<f_Group>, CodeGenOpts<"EnableAssignmentTracking">,
6067   NormalizedValuesScope<"CodeGenOptions::AssignmentTrackingOpts">,
6068   Values<"disabled,enabled,forced">, NormalizedValues<["Disabled","Enabled","Forced"]>,
6069   MarshallingInfoEnum<CodeGenOpts<"AssignmentTrackingMode">, "Enabled">;
6070
6071 } // let Flags = [CC1Option, NoDriverOption]
6072
6073 //===----------------------------------------------------------------------===//
6074 // Dependency Output Options
6075 //===----------------------------------------------------------------------===//
6076
6077 let Flags = [CC1Option, NoDriverOption] in {
6078
6079 def sys_header_deps : Flag<["-"], "sys-header-deps">,
6080   HelpText<"Include system headers in dependency output">,
6081   MarshallingInfoFlag<DependencyOutputOpts<"IncludeSystemHeaders">>;
6082 def module_file_deps : Flag<["-"], "module-file-deps">,
6083   HelpText<"Include module files in dependency output">,
6084   MarshallingInfoFlag<DependencyOutputOpts<"IncludeModuleFiles">>;
6085 def header_include_file : Separate<["-"], "header-include-file">,
6086   HelpText<"Filename (or -) to write header include output to">,
6087   MarshallingInfoString<DependencyOutputOpts<"HeaderIncludeOutputFile">>;
6088 def header_include_format_EQ : Joined<["-"], "header-include-format=">,
6089   HelpText<"set format in which header info is emitted">,
6090   Values<"textual,json">, NormalizedValues<["HIFMT_Textual", "HIFMT_JSON"]>,
6091   MarshallingInfoEnum<DependencyOutputOpts<"HeaderIncludeFormat">, "HIFMT_Textual">;
6092 def header_include_filtering_EQ : Joined<["-"], "header-include-filtering=">,
6093   HelpText<"set the flag that enables filtering header information">,
6094   Values<"none,only-direct-system">, NormalizedValues<["HIFIL_None", "HIFIL_Only_Direct_System"]>,
6095   MarshallingInfoEnum<DependencyOutputOpts<"HeaderIncludeFiltering">, "HIFIL_None">;
6096 def show_includes : Flag<["--"], "show-includes">,
6097   HelpText<"Print cl.exe style /showIncludes to stdout">;
6098
6099 } // let Flags = [CC1Option, NoDriverOption]
6100
6101 //===----------------------------------------------------------------------===//
6102 // Diagnostic Options
6103 //===----------------------------------------------------------------------===//
6104
6105 let Flags = [CC1Option, NoDriverOption] in {
6106
6107 def diagnostic_log_file : Separate<["-"], "diagnostic-log-file">,
6108   HelpText<"Filename (or -) to log diagnostics to">,
6109   MarshallingInfoString<DiagnosticOpts<"DiagnosticLogFile">>;
6110 def diagnostic_serialized_file : Separate<["-"], "serialize-diagnostic-file">,
6111   MetaVarName<"<filename>">,
6112   HelpText<"File for serializing diagnostics in a binary format">;
6113
6114 def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">,
6115   HelpText<"Change diagnostic formatting to match IDE and command line tools">,
6116   Values<"clang,msvc,vi,sarif,SARIF">,
6117   NormalizedValuesScope<"DiagnosticOptions">, NormalizedValues<["Clang", "MSVC", "Vi", "SARIF", "SARIF"]>,
6118   MarshallingInfoEnum<DiagnosticOpts<"Format">, "Clang">;
6119 def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">,
6120   HelpText<"Print diagnostic category">,
6121   Values<"none,id,name">,
6122   NormalizedValues<["0", "1", "2"]>,
6123   MarshallingInfoEnum<DiagnosticOpts<"ShowCategories">, "0">;
6124 def fno_diagnostics_use_presumed_location : Flag<["-"], "fno-diagnostics-use-presumed-location">,
6125   HelpText<"Ignore #line directives when displaying diagnostic locations">,
6126   MarshallingInfoNegativeFlag<DiagnosticOpts<"ShowPresumedLoc">>;
6127 def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">,
6128   HelpText<"Set the tab stop distance.">,
6129   MarshallingInfoInt<DiagnosticOpts<"TabStop">, "DiagnosticOptions::DefaultTabStop">;
6130 def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"<N>">,
6131   HelpText<"Set the maximum number of errors to emit before stopping (0 = no limit).">,
6132   MarshallingInfoInt<DiagnosticOpts<"ErrorLimit">>;
6133 def verify_EQ : CommaJoined<["-"], "verify=">,
6134   MetaVarName<"<prefixes>">,
6135   HelpText<"Verify diagnostic output using comment directives that start with"
6136            " prefixes in the comma-separated sequence <prefixes>">;
6137 def verify : Flag<["-"], "verify">,
6138   HelpText<"Equivalent to -verify=expected">;
6139 def verify_ignore_unexpected : Flag<["-"], "verify-ignore-unexpected">,
6140   HelpText<"Ignore unexpected diagnostic messages">;
6141 def verify_ignore_unexpected_EQ : CommaJoined<["-"], "verify-ignore-unexpected=">,
6142   HelpText<"Ignore unexpected diagnostic messages">;
6143 def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">,
6144   HelpText<"Silence ObjC rewriting warnings">,
6145   MarshallingInfoFlag<DiagnosticOpts<"NoRewriteMacros">>;
6146
6147 } // let Flags = [CC1Option, NoDriverOption]
6148
6149 //===----------------------------------------------------------------------===//
6150 // Frontend Options
6151 //===----------------------------------------------------------------------===//
6152
6153 let Flags = [CC1Option, NoDriverOption] in {
6154
6155 // This isn't normally used, it is just here so we can parse a
6156 // CompilerInvocation out of a driver-derived argument vector.
6157 def cc1 : Flag<["-"], "cc1">;
6158 def cc1as : Flag<["-"], "cc1as">;
6159
6160 def ast_merge : Separate<["-"], "ast-merge">,
6161   MetaVarName<"<ast file>">,
6162   HelpText<"Merge the given AST file into the translation unit being compiled.">,
6163   MarshallingInfoStringVector<FrontendOpts<"ASTMergeFiles">>;
6164 def aux_target_cpu : Separate<["-"], "aux-target-cpu">,
6165   HelpText<"Target a specific auxiliary cpu type">;
6166 def aux_target_feature : Separate<["-"], "aux-target-feature">,
6167   HelpText<"Target specific auxiliary attributes">;
6168 def aux_triple : Separate<["-"], "aux-triple">,
6169   HelpText<"Auxiliary target triple.">,
6170   MarshallingInfoString<FrontendOpts<"AuxTriple">>;
6171 def code_completion_at : Separate<["-"], "code-completion-at">,
6172   MetaVarName<"<file>:<line>:<column>">,
6173   HelpText<"Dump code-completion information at a location">;
6174 def remap_file : Separate<["-"], "remap-file">,
6175   MetaVarName<"<from>;<to>">,
6176   HelpText<"Replace the contents of the <from> file with the contents of the <to> file">;
6177 def code_completion_at_EQ : Joined<["-"], "code-completion-at=">,
6178   Alias<code_completion_at>;
6179 def code_completion_macros : Flag<["-"], "code-completion-macros">,
6180   HelpText<"Include macros in code-completion results">,
6181   MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeMacros">>;
6182 def code_completion_patterns : Flag<["-"], "code-completion-patterns">,
6183   HelpText<"Include code patterns in code-completion results">,
6184   MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeCodePatterns">>;
6185 def no_code_completion_globals : Flag<["-"], "no-code-completion-globals">,
6186   HelpText<"Do not include global declarations in code-completion results.">,
6187   MarshallingInfoNegativeFlag<FrontendOpts<"CodeCompleteOpts.IncludeGlobals">>;
6188 def no_code_completion_ns_level_decls : Flag<["-"], "no-code-completion-ns-level-decls">,
6189   HelpText<"Do not include declarations inside namespaces (incl. global namespace) in the code-completion results.">,
6190   MarshallingInfoNegativeFlag<FrontendOpts<"CodeCompleteOpts.IncludeNamespaceLevelDecls">>;
6191 def code_completion_brief_comments : Flag<["-"], "code-completion-brief-comments">,
6192   HelpText<"Include brief documentation comments in code-completion results.">,
6193   MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeBriefComments">>;
6194 def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">,
6195   HelpText<"Include code completion results which require small fix-its.">,
6196   MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeFixIts">>;
6197 def disable_free : Flag<["-"], "disable-free">,
6198   HelpText<"Disable freeing of memory on exit">,
6199   MarshallingInfoFlag<FrontendOpts<"DisableFree">>;
6200 defm clear_ast_before_backend : BoolOption<"",
6201   "clear-ast-before-backend",
6202   CodeGenOpts<"ClearASTBeforeBackend">,
6203   DefaultFalse,
6204   PosFlag<SetTrue, [], "Clear">,
6205   NegFlag<SetFalse, [], "Don't clear">,
6206   BothFlags<[], " the Clang AST before running backend code generation">>;
6207 defm enable_noundef_analysis : BoolOption<"",
6208   "enable-noundef-analysis",
6209   CodeGenOpts<"EnableNoundefAttrs">,
6210   DefaultTrue,
6211   PosFlag<SetTrue, [], "Enable">,
6212   NegFlag<SetFalse, [], "Disable">,
6213   BothFlags<[], " analyzing function argument and return types for mandatory definedness">>;
6214 def discard_value_names : Flag<["-"], "discard-value-names">,
6215   HelpText<"Discard value names in LLVM IR">,
6216   MarshallingInfoFlag<CodeGenOpts<"DiscardValueNames">>;
6217 def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">,
6218     MetaVarName<"<name> <arg>">,
6219     HelpText<"Pass <arg> to plugin <name>">;
6220 def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"<name>">,
6221   HelpText<"Use the named plugin action in addition to the default action">,
6222   MarshallingInfoStringVector<FrontendOpts<"AddPluginActions">>;
6223 def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
6224   MetaVarName<"<dump_filter>">,
6225   HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
6226            " nodes having a certain substring in a qualified name. Use"
6227            " -ast-list to list all filterable declaration node names.">,
6228   MarshallingInfoString<FrontendOpts<"ASTDumpFilter">>;
6229 def ast_dump_filter_EQ : Joined<["-"], "ast-dump-filter=">,
6230   Alias<ast_dump_filter>;
6231 def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
6232   HelpText<"Do not automatically generate or update the global module index">,
6233   MarshallingInfoNegativeFlag<FrontendOpts<"UseGlobalModuleIndex">>;
6234 def fno_modules_error_recovery : Flag<["-"], "fno-modules-error-recovery">,
6235   HelpText<"Do not automatically import modules for error recovery">,
6236   MarshallingInfoNegativeFlag<LangOpts<"ModulesErrorRecovery">>;
6237 def fmodule_map_file_home_is_cwd : Flag<["-"], "fmodule-map-file-home-is-cwd">,
6238   HelpText<"Use the current working directory as the home directory of "
6239            "module maps specified by -fmodule-map-file=<FILE>">,
6240   MarshallingInfoFlag<HeaderSearchOpts<"ModuleMapFileHomeIsCwd">>;
6241 def fmodule_file_home_is_cwd : Flag<["-"], "fmodule-file-home-is-cwd">,
6242   HelpText<"Use the current working directory as the base directory of "
6243            "compiled module files.">,
6244   MarshallingInfoFlag<HeaderSearchOpts<"ModuleFileHomeIsCwd">>;
6245 def fmodule_feature : Separate<["-"], "fmodule-feature">,
6246   MetaVarName<"<feature>">,
6247   HelpText<"Enable <feature> in module map requires declarations">,
6248   MarshallingInfoStringVector<LangOpts<"ModuleFeatures">>;
6249 def fmodules_embed_file_EQ : Joined<["-"], "fmodules-embed-file=">,
6250   MetaVarName<"<file>">,
6251   HelpText<"Embed the contents of the specified file into the module file "
6252            "being compiled.">,
6253   MarshallingInfoStringVector<FrontendOpts<"ModulesEmbedFiles">>;
6254 def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">,
6255   HelpText<"Embed the contents of all files read by this compilation into "
6256            "the produced module file.">,
6257   MarshallingInfoFlag<FrontendOpts<"ModulesEmbedAllFiles">>;
6258 defm fimplicit_modules_use_lock : BoolOption<"f", "implicit-modules-use-lock",
6259   FrontendOpts<"BuildingImplicitModuleUsesLock">, DefaultTrue,
6260   NegFlag<SetFalse>,
6261   PosFlag<SetTrue, [],
6262           "Use filesystem locks for implicit modules builds to avoid "
6263           "duplicating work in competing clang invocations.">>;
6264 // FIXME: We only need this in C++ modules if we might textually
6265 // enter a different module (eg, when building a header unit).
6266 def fmodules_local_submodule_visibility :
6267   Flag<["-"], "fmodules-local-submodule-visibility">,
6268   HelpText<"Enforce name visibility rules across submodules of the same "
6269            "top-level module.">,
6270   MarshallingInfoFlag<LangOpts<"ModulesLocalVisibility">>,
6271   ImpliedByAnyOf<[fcxx_modules.KeyPath]>;
6272 def fmodules_codegen :
6273   Flag<["-"], "fmodules-codegen">,
6274   HelpText<"Generate code for uses of this module that assumes an explicit "
6275            "object file will be built for the module">,
6276   MarshallingInfoFlag<LangOpts<"ModulesCodegen">>;
6277 def fmodules_debuginfo :
6278   Flag<["-"], "fmodules-debuginfo">,
6279   HelpText<"Generate debug info for types in an object file built from this "
6280            "module and do not generate them elsewhere">,
6281   MarshallingInfoFlag<LangOpts<"ModulesDebugInfo">>;
6282 def fmodule_format_EQ : Joined<["-"], "fmodule-format=">,
6283   HelpText<"Select the container format for clang modules and PCH. "
6284            "Supported options are 'raw' and 'obj'.">,
6285   MarshallingInfoString<HeaderSearchOpts<"ModuleFormat">, [{"raw"}]>;
6286 def ftest_module_file_extension_EQ :
6287   Joined<["-"], "ftest-module-file-extension=">,
6288   HelpText<"introduce a module file extension for testing purposes. "
6289            "The argument is parsed as blockname:major:minor:hashed:user info">;
6290
6291 defm recovery_ast : BoolOption<"f", "recovery-ast",
6292   LangOpts<"RecoveryAST">, DefaultTrue,
6293   NegFlag<SetFalse>, PosFlag<SetTrue, [], "Preserve expressions in AST rather "
6294                               "than dropping them when encountering semantic errors">>;
6295 defm recovery_ast_type : BoolOption<"f", "recovery-ast-type",
6296   LangOpts<"RecoveryASTType">, DefaultTrue,
6297   NegFlag<SetFalse>, PosFlag<SetTrue, [], "Preserve the type for recovery "
6298                               "expressions when possible">>;
6299
6300 let Group = Action_Group in {
6301
6302 def Eonly : Flag<["-"], "Eonly">,
6303   HelpText<"Just run preprocessor, no output (for timings)">;
6304 def dump_raw_tokens : Flag<["-"], "dump-raw-tokens">,
6305   HelpText<"Lex file in raw mode and dump raw tokens">;
6306 def analyze : Flag<["-"], "analyze">,
6307   HelpText<"Run static analysis engine">;
6308 def dump_tokens : Flag<["-"], "dump-tokens">,
6309   HelpText<"Run preprocessor, dump internal rep of tokens">;
6310 def fixit : Flag<["-"], "fixit">,
6311   HelpText<"Apply fix-it advice to the input source">;
6312 def fixit_EQ : Joined<["-"], "fixit=">,
6313   HelpText<"Apply fix-it advice creating a file with the given suffix">;
6314 def print_preamble : Flag<["-"], "print-preamble">,
6315   HelpText<"Print the \"preamble\" of a file, which is a candidate for implicit"
6316            " precompiled headers.">;
6317 def emit_html : Flag<["-"], "emit-html">,
6318   HelpText<"Output input source as HTML">;
6319 def ast_print : Flag<["-"], "ast-print">,
6320   HelpText<"Build ASTs and then pretty-print them">;
6321 def ast_list : Flag<["-"], "ast-list">,
6322   HelpText<"Build ASTs and print the list of declaration node qualified names">;
6323 def ast_dump : Flag<["-"], "ast-dump">,
6324   HelpText<"Build ASTs and then debug dump them">;
6325 def ast_dump_EQ : Joined<["-"], "ast-dump=">,
6326   HelpText<"Build ASTs and then debug dump them in the specified format. "
6327            "Supported formats include: default, json">;
6328 def ast_dump_all : Flag<["-"], "ast-dump-all">,
6329   HelpText<"Build ASTs and then debug dump them, forcing deserialization">;
6330 def ast_dump_all_EQ : Joined<["-"], "ast-dump-all=">,
6331   HelpText<"Build ASTs and then debug dump them in the specified format, "
6332            "forcing deserialization. Supported formats include: default, json">;
6333 def ast_dump_decl_types : Flag<["-"], "ast-dump-decl-types">,
6334   HelpText<"Include declaration types in AST dumps">,
6335   MarshallingInfoFlag<FrontendOpts<"ASTDumpDeclTypes">>;
6336 def templight_dump : Flag<["-"], "templight-dump">,
6337   HelpText<"Dump templight information to stdout">;
6338 def ast_dump_lookups : Flag<["-"], "ast-dump-lookups">,
6339   HelpText<"Build ASTs and then debug dump their name lookup tables">,
6340   MarshallingInfoFlag<FrontendOpts<"ASTDumpLookups">>;
6341 def ast_view : Flag<["-"], "ast-view">,
6342   HelpText<"Build ASTs and view them with GraphViz">;
6343 def emit_module : Flag<["-"], "emit-module">,
6344   HelpText<"Generate pre-compiled module file from a module map">;
6345 def emit_module_interface : Flag<["-"], "emit-module-interface">,
6346   HelpText<"Generate pre-compiled module file from a C++ module interface">;
6347 def emit_header_unit : Flag<["-"], "emit-header-unit">,
6348   HelpText<"Generate C++20 header units from header files">;
6349 def emit_pch : Flag<["-"], "emit-pch">,
6350   HelpText<"Generate pre-compiled header file">;
6351 def emit_llvm_only : Flag<["-"], "emit-llvm-only">,
6352   HelpText<"Build ASTs and convert to LLVM, discarding output">;
6353 def emit_codegen_only : Flag<["-"], "emit-codegen-only">,
6354   HelpText<"Generate machine code, but discard output">;
6355 def rewrite_test : Flag<["-"], "rewrite-test">,
6356   HelpText<"Rewriter playground">;
6357 def rewrite_macros : Flag<["-"], "rewrite-macros">,
6358   HelpText<"Expand macros without full preprocessing">;
6359 def migrate : Flag<["-"], "migrate">,
6360   HelpText<"Migrate source code">;
6361 def compiler_options_dump : Flag<["-"], "compiler-options-dump">,
6362   HelpText<"Dump the compiler configuration options">;
6363 def print_dependency_directives_minimized_source : Flag<["-"],
6364   "print-dependency-directives-minimized-source">,
6365   HelpText<"Print the output of the dependency directives source minimizer">;
6366 }
6367
6368 defm emit_llvm_uselists : BoolOption<"", "emit-llvm-uselists",
6369   CodeGenOpts<"EmitLLVMUseLists">, DefaultFalse,
6370   PosFlag<SetTrue, [], "Preserve">,
6371   NegFlag<SetFalse, [], "Don't preserve">,
6372   BothFlags<[], " order of LLVM use-lists when serializing">>;
6373
6374 def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">,
6375   HelpText<"Directory for temporary files produced during ARC or ObjC migration">,
6376   MarshallingInfoString<FrontendOpts<"MTMigrateDir">>;
6377
6378 def arcmt_action_EQ : Joined<["-"], "arcmt-action=">, Flags<[CC1Option, NoDriverOption]>,
6379   HelpText<"The ARC migration action to take">,
6380   Values<"check,modify,migrate">,
6381   NormalizedValuesScope<"FrontendOptions">,
6382   NormalizedValues<["ARCMT_Check", "ARCMT_Modify", "ARCMT_Migrate"]>,
6383   MarshallingInfoEnum<FrontendOpts<"ARCMTAction">, "ARCMT_None">;
6384
6385 def opt_record_file : Separate<["-"], "opt-record-file">,
6386   HelpText<"File name to use for YAML optimization record output">,
6387   MarshallingInfoString<CodeGenOpts<"OptRecordFile">>;
6388 def opt_record_passes : Separate<["-"], "opt-record-passes">,
6389   HelpText<"Only record remark information for passes whose names match the given regular expression">;
6390 def opt_record_format : Separate<["-"], "opt-record-format">,
6391   HelpText<"The format used for serializing remarks (default: YAML)">;
6392
6393 def print_stats : Flag<["-"], "print-stats">,
6394   HelpText<"Print performance metrics and statistics">,
6395   MarshallingInfoFlag<FrontendOpts<"ShowStats">>;
6396 def stats_file : Joined<["-"], "stats-file=">,
6397   HelpText<"Filename to write statistics to">,
6398   MarshallingInfoString<FrontendOpts<"StatsFile">>;
6399 def stats_file_append : Flag<["-"], "stats-file-append">,
6400   HelpText<"If stats should be appended to stats-file instead of overwriting it">,
6401   MarshallingInfoFlag<FrontendOpts<"AppendStats">>;
6402 def fdump_record_layouts_simple : Flag<["-"], "fdump-record-layouts-simple">,
6403   HelpText<"Dump record layout information in a simple form used for testing">,
6404   MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsSimple">>;
6405 def fdump_record_layouts_canonical : Flag<["-"], "fdump-record-layouts-canonical">,
6406   HelpText<"Dump record layout information with canonical field types">,
6407   MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsCanonical">>;
6408 def fdump_record_layouts_complete : Flag<["-"], "fdump-record-layouts-complete">,
6409   HelpText<"Dump record layout information for all complete types">,
6410   MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsComplete">>;
6411 def fdump_record_layouts : Flag<["-"], "fdump-record-layouts">,
6412   HelpText<"Dump record layout information">,
6413   MarshallingInfoFlag<LangOpts<"DumpRecordLayouts">>,
6414   ImpliedByAnyOf<[fdump_record_layouts_simple.KeyPath, fdump_record_layouts_complete.KeyPath, fdump_record_layouts_canonical.KeyPath]>;
6415 def fix_what_you_can : Flag<["-"], "fix-what-you-can">,
6416   HelpText<"Apply fix-it advice even in the presence of unfixable errors">,
6417   MarshallingInfoFlag<FrontendOpts<"FixWhatYouCan">>;
6418 def fix_only_warnings : Flag<["-"], "fix-only-warnings">,
6419   HelpText<"Apply fix-it advice only for warnings, not errors">,
6420   MarshallingInfoFlag<FrontendOpts<"FixOnlyWarnings">>;
6421 def fixit_recompile : Flag<["-"], "fixit-recompile">,
6422   HelpText<"Apply fix-it changes and recompile">,
6423   MarshallingInfoFlag<FrontendOpts<"FixAndRecompile">>;
6424 def fixit_to_temp : Flag<["-"], "fixit-to-temporary">,
6425   HelpText<"Apply fix-it changes to temporary files">,
6426   MarshallingInfoFlag<FrontendOpts<"FixToTemporaries">>;
6427
6428 def foverride_record_layout_EQ : Joined<["-"], "foverride-record-layout=">,
6429   HelpText<"Override record layouts with those in the given file">,
6430   MarshallingInfoString<FrontendOpts<"OverrideRecordLayoutsFile">>;
6431 def pch_through_header_EQ : Joined<["-"], "pch-through-header=">,
6432   HelpText<"Stop PCH generation after including this file.  When using a PCH, "
6433            "skip tokens until after this file is included.">,
6434   MarshallingInfoString<PreprocessorOpts<"PCHThroughHeader">>;
6435 def pch_through_hdrstop_create : Flag<["-"], "pch-through-hdrstop-create">,
6436   HelpText<"When creating a PCH, stop PCH generation after #pragma hdrstop.">,
6437   MarshallingInfoFlag<PreprocessorOpts<"PCHWithHdrStopCreate">>;
6438 def pch_through_hdrstop_use : Flag<["-"], "pch-through-hdrstop-use">,
6439   HelpText<"When using a PCH, skip tokens until after a #pragma hdrstop.">;
6440 def fno_pch_timestamp : Flag<["-"], "fno-pch-timestamp">,
6441   HelpText<"Disable inclusion of timestamp in precompiled headers">,
6442   MarshallingInfoNegativeFlag<FrontendOpts<"IncludeTimestamps">>;
6443 def building_pch_with_obj : Flag<["-"], "building-pch-with-obj">,
6444   HelpText<"This compilation is part of building a PCH with corresponding object file.">,
6445   MarshallingInfoFlag<LangOpts<"BuildingPCHWithObjectFile">>;
6446
6447 def aligned_alloc_unavailable : Flag<["-"], "faligned-alloc-unavailable">,
6448   HelpText<"Aligned allocation/deallocation functions are unavailable">,
6449   MarshallingInfoFlag<LangOpts<"AlignedAllocationUnavailable">>,
6450   ShouldParseIf<faligned_allocation.KeyPath>;
6451
6452 } // let Flags = [CC1Option, NoDriverOption]
6453
6454 //===----------------------------------------------------------------------===//
6455 // Language Options
6456 //===----------------------------------------------------------------------===//
6457
6458 def version : Flag<["-"], "version">,
6459   HelpText<"Print the compiler version">,
6460   Flags<[CC1Option, CC1AsOption, FC1Option, NoDriverOption]>,
6461   MarshallingInfoFlag<FrontendOpts<"ShowVersion">>;
6462
6463 def main_file_name : Separate<["-"], "main-file-name">,
6464   HelpText<"Main file name to use for debug info and source if missing">,
6465   Flags<[CC1Option, CC1AsOption, NoDriverOption]>,
6466   MarshallingInfoString<CodeGenOpts<"MainFileName">>;
6467 def split_dwarf_output : Separate<["-"], "split-dwarf-output">,
6468   HelpText<"File name to use for split dwarf debug info output">,
6469   Flags<[CC1Option, CC1AsOption, NoDriverOption]>,
6470   MarshallingInfoString<CodeGenOpts<"SplitDwarfOutput">>;
6471
6472 let Flags = [CC1Option, FC1Option, NoDriverOption] in {
6473
6474 def mreassociate : Flag<["-"], "mreassociate">,
6475   HelpText<"Allow reassociation transformations for floating-point instructions">,
6476   MarshallingInfoFlag<LangOpts<"AllowFPReassoc">>, ImpliedByAnyOf<[funsafe_math_optimizations.KeyPath]>;
6477 def menable_no_nans : Flag<["-"], "menable-no-nans">,
6478   HelpText<"Allow optimization to assume there are no NaNs.">,
6479   MarshallingInfoFlag<LangOpts<"NoHonorNaNs">>, ImpliedByAnyOf<[ffinite_math_only.KeyPath]>;
6480 def menable_no_infinities : Flag<["-"], "menable-no-infs">,
6481   HelpText<"Allow optimization to assume there are no infinities.">,
6482   MarshallingInfoFlag<LangOpts<"NoHonorInfs">>, ImpliedByAnyOf<[ffinite_math_only.KeyPath]>;
6483
6484 def pic_level : Separate<["-"], "pic-level">,
6485   HelpText<"Value for __PIC__">,
6486   MarshallingInfoInt<LangOpts<"PICLevel">>;
6487 def pic_is_pie : Flag<["-"], "pic-is-pie">,
6488   HelpText<"File is for a position independent executable">,
6489   MarshallingInfoFlag<LangOpts<"PIE">>;
6490
6491 } // let Flags = [CC1Option, FC1Option, NoDriverOption]
6492
6493 let Flags = [CC1Option, NoDriverOption] in {
6494
6495 def fblocks_runtime_optional : Flag<["-"], "fblocks-runtime-optional">,
6496   HelpText<"Weakly link in the blocks runtime">,
6497   MarshallingInfoFlag<LangOpts<"BlocksRuntimeOptional">>;
6498 def fexternc_nounwind : Flag<["-"], "fexternc-nounwind">,
6499   HelpText<"Assume all functions with C linkage do not unwind">,
6500   MarshallingInfoFlag<LangOpts<"ExternCNoUnwind">>;
6501 def split_dwarf_file : Separate<["-"], "split-dwarf-file">,
6502   HelpText<"Name of the split dwarf debug info file to encode in the object file">,
6503   MarshallingInfoString<CodeGenOpts<"SplitDwarfFile">>;
6504 def fno_wchar : Flag<["-"], "fno-wchar">,
6505   HelpText<"Disable C++ builtin type wchar_t">,
6506   MarshallingInfoNegativeFlag<LangOpts<"WChar">, cplusplus.KeyPath>,
6507   ShouldParseIf<cplusplus.KeyPath>;
6508 def fconstant_string_class : Separate<["-"], "fconstant-string-class">,
6509   MetaVarName<"<class name>">,
6510   HelpText<"Specify the class to use for constant Objective-C string objects.">,
6511   MarshallingInfoString<LangOpts<"ObjCConstantStringClass">>;
6512 def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">,
6513   HelpText<"Objective-C++ Automatic Reference Counting standard library kind">,
6514   Values<"libc++,libstdc++,none">,
6515   NormalizedValues<["ARCXX_libcxx", "ARCXX_libstdcxx", "ARCXX_nolib"]>,
6516   MarshallingInfoEnum<PreprocessorOpts<"ObjCXXARCStandardLibrary">, "ARCXX_nolib">;
6517 def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">,
6518   HelpText<"The target Objective-C runtime supports ARC weak operations">;
6519 def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">,
6520   HelpText<"Objective-C dispatch method to use">,
6521   Values<"legacy,non-legacy,mixed">,
6522   NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["Legacy", "NonLegacy", "Mixed"]>,
6523   MarshallingInfoEnum<CodeGenOpts<"ObjCDispatchMethod">, "Legacy">;
6524 def disable_objc_default_synthesize_properties : Flag<["-"], "disable-objc-default-synthesize-properties">,
6525   HelpText<"disable the default synthesis of Objective-C properties">,
6526   MarshallingInfoNegativeFlag<LangOpts<"ObjCDefaultSynthProperties">>;
6527 def fencode_extended_block_signature : Flag<["-"], "fencode-extended-block-signature">,
6528   HelpText<"enable extended encoding of block type signature">,
6529   MarshallingInfoFlag<LangOpts<"EncodeExtendedBlockSig">>;
6530 def function_alignment : Separate<["-"], "function-alignment">,
6531     HelpText<"default alignment for functions">,
6532     MarshallingInfoInt<LangOpts<"FunctionAlignment">>;
6533 def fhalf_no_semantic_interposition : Flag<["-"], "fhalf-no-semantic-interposition">,
6534   HelpText<"Like -fno-semantic-interposition but don't use local aliases">,
6535   MarshallingInfoFlag<LangOpts<"HalfNoSemanticInterposition">>;
6536 def fno_validate_pch : Flag<["-"], "fno-validate-pch">,
6537   HelpText<"Disable validation of precompiled headers">,
6538   MarshallingInfoFlag<PreprocessorOpts<"DisablePCHOrModuleValidation">, "DisableValidationForModuleKind::None">,
6539   Normalizer<"makeFlagToValueNormalizer(DisableValidationForModuleKind::All)">;
6540 def fallow_pcm_with_errors : Flag<["-"], "fallow-pcm-with-compiler-errors">,
6541   HelpText<"Accept a PCM file that was created with compiler errors">,
6542   MarshallingInfoFlag<FrontendOpts<"AllowPCMWithCompilerErrors">>;
6543 def fallow_pch_with_errors : Flag<["-"], "fallow-pch-with-compiler-errors">,
6544   HelpText<"Accept a PCH file that was created with compiler errors">,
6545   MarshallingInfoFlag<PreprocessorOpts<"AllowPCHWithCompilerErrors">>,
6546   ImpliedByAnyOf<[fallow_pcm_with_errors.KeyPath]>;
6547 def fallow_pch_with_different_modules_cache_path :
6548   Flag<["-"], "fallow-pch-with-different-modules-cache-path">,
6549   HelpText<"Accept a PCH file that was created with a different modules cache path">,
6550   MarshallingInfoFlag<PreprocessorOpts<"AllowPCHWithDifferentModulesCachePath">>;
6551 def fno_modules_share_filemanager : Flag<["-"], "fno-modules-share-filemanager">,
6552   HelpText<"Disable sharing the FileManager when building a module implicitly">,
6553   MarshallingInfoNegativeFlag<FrontendOpts<"ModulesShareFileManager">>;
6554 def dump_deserialized_pch_decls : Flag<["-"], "dump-deserialized-decls">,
6555   HelpText<"Dump declarations that are deserialized from PCH, for testing">,
6556   MarshallingInfoFlag<PreprocessorOpts<"DumpDeserializedPCHDecls">>;
6557 def error_on_deserialized_pch_decl : Separate<["-"], "error-on-deserialized-decl">,
6558   HelpText<"Emit error if a specific declaration is deserialized from PCH, for testing">;
6559 def error_on_deserialized_pch_decl_EQ : Joined<["-"], "error-on-deserialized-decl=">,
6560   Alias<error_on_deserialized_pch_decl>;
6561 def static_define : Flag<["-"], "static-define">,
6562   HelpText<"Should __STATIC__ be defined">,
6563   MarshallingInfoFlag<LangOpts<"Static">>;
6564 def stack_protector : Separate<["-"], "stack-protector">,
6565   HelpText<"Enable stack protectors">,
6566   Values<"0,1,2,3">,
6567   NormalizedValuesScope<"LangOptions">,
6568   NormalizedValues<["SSPOff", "SSPOn", "SSPStrong", "SSPReq"]>,
6569   MarshallingInfoEnum<LangOpts<"StackProtector">, "SSPOff">;
6570 def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
6571   HelpText<"Lower bound for a buffer to be considered for stack protection">,
6572   MarshallingInfoInt<CodeGenOpts<"SSPBufferSize">, "8">;
6573 def ftype_visibility : Joined<["-"], "ftype-visibility=">,
6574   HelpText<"Default type visibility">,
6575   MarshallingInfoVisibility<LangOpts<"TypeVisibilityMode">, fvisibility_EQ.KeyPath>;
6576 def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-to-externs">,
6577   HelpText<"Apply global symbol visibility to external declarations without an explicit visibility">,
6578   MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
6579 def fbracket_depth : Separate<["-"], "fbracket-depth">,
6580   HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
6581   MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
6582 defm const_strings : BoolOption<"f", "const-strings",
6583   LangOpts<"ConstStrings">, DefaultFalse,
6584   PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
6585   BothFlags<[], " a const qualified type for string literals in C and ObjC">>;
6586 def fno_bitfield_type_align : Flag<["-"], "fno-bitfield-type-align">,
6587   HelpText<"Ignore bit-field types when aligning structures">,
6588   MarshallingInfoFlag<LangOpts<"NoBitFieldTypeAlign">>;
6589 def ffake_address_space_map : Flag<["-"], "ffake-address-space-map">,
6590   HelpText<"Use a fake address space map; OpenCL testing purposes only">,
6591   MarshallingInfoFlag<LangOpts<"FakeAddressSpaceMap">>;
6592 def faddress_space_map_mangling_EQ : Joined<["-"], "faddress-space-map-mangling=">,
6593   HelpText<"Set the mode for address space map based mangling; OpenCL testing purposes only">,
6594   Values<"target,no,yes">,
6595   NormalizedValuesScope<"LangOptions">,
6596   NormalizedValues<["ASMM_Target", "ASMM_Off", "ASMM_On"]>,
6597   MarshallingInfoEnum<LangOpts<"AddressSpaceMapMangling">, "ASMM_Target">;
6598 def funknown_anytype : Flag<["-"], "funknown-anytype">,
6599   HelpText<"Enable parser support for the __unknown_anytype type; for testing purposes only">,
6600   MarshallingInfoFlag<LangOpts<"ParseUnknownAnytype">>;
6601 def fdebugger_support : Flag<["-"], "fdebugger-support">,
6602   HelpText<"Enable special debugger support behavior">,
6603   MarshallingInfoFlag<LangOpts<"DebuggerSupport">>;
6604 def fdebugger_cast_result_to_id : Flag<["-"], "fdebugger-cast-result-to-id">,
6605   HelpText<"Enable casting unknown expression results to id">,
6606   MarshallingInfoFlag<LangOpts<"DebuggerCastResultToId">>;
6607 def fdebugger_objc_literal : Flag<["-"], "fdebugger-objc-literal">,
6608   HelpText<"Enable special debugger support for Objective-C subscripting and literals">,
6609   MarshallingInfoFlag<LangOpts<"DebuggerObjCLiteral">>;
6610 defm deprecated_macro : BoolOption<"f", "deprecated-macro",
6611   LangOpts<"Deprecated">, DefaultFalse,
6612   PosFlag<SetTrue, [], "Defines">, NegFlag<SetFalse, [], "Undefines">,
6613   BothFlags<[], " the __DEPRECATED macro">>;
6614 def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">,
6615   HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">;
6616 // TODO: Enforce values valid for MSVtorDispMode.
6617 def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
6618   HelpText<"Control vtordisp placement on win32 targets">,
6619   MarshallingInfoInt<LangOpts<"VtorDispMode">, "1">;
6620 def fnative_half_type: Flag<["-"], "fnative-half-type">,
6621   HelpText<"Use the native half type for __fp16 instead of promoting to float">,
6622   MarshallingInfoFlag<LangOpts<"NativeHalfType">>,
6623   ImpliedByAnyOf<[open_cl.KeyPath, render_script.KeyPath]>;
6624 def fnative_half_arguments_and_returns : Flag<["-"], "fnative-half-arguments-and-returns">,
6625   HelpText<"Use the native __fp16 type for arguments and returns (and skip ABI-specific lowering)">,
6626   MarshallingInfoFlag<LangOpts<"NativeHalfArgsAndReturns">>,
6627   ImpliedByAnyOf<[open_cl.KeyPath, render_script.KeyPath, hlsl.KeyPath]>;
6628 def fdefault_calling_conv_EQ : Joined<["-"], "fdefault-calling-conv=">,
6629   HelpText<"Set default calling convention">,
6630   Values<"cdecl,fastcall,stdcall,vectorcall,regcall">,
6631   NormalizedValuesScope<"LangOptions">,
6632   NormalizedValues<["DCC_CDecl", "DCC_FastCall", "DCC_StdCall", "DCC_VectorCall", "DCC_RegCall"]>,
6633   MarshallingInfoEnum<LangOpts<"DefaultCallingConv">, "DCC_None">;
6634
6635 // These options cannot be marshalled, because they are used to set up the LangOptions defaults.
6636 def finclude_default_header : Flag<["-"], "finclude-default-header">,
6637   HelpText<"Include default header file for OpenCL and HLSL">;
6638 def fdeclare_opencl_builtins : Flag<["-"], "fdeclare-opencl-builtins">,
6639   HelpText<"Add OpenCL builtin function declarations (experimental)">;
6640
6641 def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">,
6642   HelpText<"Preserve 3-component vector type">,
6643   MarshallingInfoFlag<CodeGenOpts<"PreserveVec3Type">>,
6644   ImpliedByAnyOf<[hlsl.KeyPath]>;
6645 def fwchar_type_EQ : Joined<["-"], "fwchar-type=">,
6646   HelpText<"Select underlying type for wchar_t">,
6647   Values<"char,short,int">,
6648   NormalizedValues<["1", "2", "4"]>,
6649   MarshallingInfoEnum<LangOpts<"WCharSize">, "0">;
6650 defm signed_wchar : BoolOption<"f", "signed-wchar",
6651   LangOpts<"WCharIsSigned">, DefaultTrue,
6652   NegFlag<SetFalse, [CC1Option], "Use an unsigned">, PosFlag<SetTrue, [], "Use a signed">,
6653   BothFlags<[], " type for wchar_t">>;
6654 def fcompatibility_qualified_id_block_param_type_checking : Flag<["-"], "fcompatibility-qualified-id-block-type-checking">,
6655   HelpText<"Allow using blocks with parameters of more specific type than "
6656            "the type system guarantees when a parameter is qualified id">,
6657   MarshallingInfoFlag<LangOpts<"CompatibilityQualifiedIdBlockParamTypeChecking">>;
6658 def fpass_by_value_is_noalias: Flag<["-"], "fpass-by-value-is-noalias">,
6659   HelpText<"Allows assuming by-value parameters do not alias any other value. "
6660            "Has no effect on non-trivially-copyable classes in C++.">, Group<f_Group>,
6661   MarshallingInfoFlag<CodeGenOpts<"PassByValueIsNoAlias">>;
6662
6663 // FIXME: Remove these entirely once functionality/tests have been excised.
6664 def fobjc_gc_only : Flag<["-"], "fobjc-gc-only">, Group<f_Group>,
6665   HelpText<"Use GC exclusively for Objective-C related memory management">;
6666 def fobjc_gc : Flag<["-"], "fobjc-gc">, Group<f_Group>,
6667   HelpText<"Enable Objective-C garbage collection">;
6668
6669 def fexperimental_max_bitint_width_EQ:
6670   Joined<["-"], "fexperimental-max-bitint-width=">, Group<f_Group>,
6671   MetaVarName<"<N>">,
6672   HelpText<"Set the maximum bitwidth for _BitInt (this option is expected to be removed in the future)">,
6673   MarshallingInfoInt<LangOpts<"MaxBitIntWidth">>;
6674
6675 } // let Flags = [CC1Option, NoDriverOption]
6676
6677 //===----------------------------------------------------------------------===//
6678 // Header Search Options
6679 //===----------------------------------------------------------------------===//
6680
6681 let Flags = [CC1Option, NoDriverOption] in {
6682
6683 def nostdsysteminc : Flag<["-"], "nostdsysteminc">,
6684   HelpText<"Disable standard system #include directories">,
6685   MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardSystemIncludes">>;
6686 def fdisable_module_hash : Flag<["-"], "fdisable-module-hash">,
6687   HelpText<"Disable the module hash">,
6688   MarshallingInfoFlag<HeaderSearchOpts<"DisableModuleHash">>;
6689 def fmodules_hash_content : Flag<["-"], "fmodules-hash-content">,
6690   HelpText<"Enable hashing the content of a module file">,
6691   MarshallingInfoFlag<HeaderSearchOpts<"ModulesHashContent">>;
6692 def fmodules_strict_context_hash : Flag<["-"], "fmodules-strict-context-hash">,
6693   HelpText<"Enable hashing of all compiler options that could impact the "
6694            "semantics of a module in an implicit build">,
6695   MarshallingInfoFlag<HeaderSearchOpts<"ModulesStrictContextHash">>;
6696 def c_isystem : Separate<["-"], "c-isystem">, MetaVarName<"<directory>">,
6697   HelpText<"Add directory to the C SYSTEM include search path">;
6698 def objc_isystem : Separate<["-"], "objc-isystem">,
6699   MetaVarName<"<directory>">,
6700   HelpText<"Add directory to the ObjC SYSTEM include search path">;
6701 def objcxx_isystem : Separate<["-"], "objcxx-isystem">,
6702   MetaVarName<"<directory>">,
6703   HelpText<"Add directory to the ObjC++ SYSTEM include search path">;
6704 def internal_isystem : Separate<["-"], "internal-isystem">,
6705   MetaVarName<"<directory>">,
6706   HelpText<"Add directory to the internal system include search path; these "
6707            "are assumed to not be user-provided and are used to model system "
6708            "and standard headers' paths.">;
6709 def internal_externc_isystem : Separate<["-"], "internal-externc-isystem">,
6710   MetaVarName<"<directory>">,
6711   HelpText<"Add directory to the internal system include search path with "
6712            "implicit extern \"C\" semantics; these are assumed to not be "
6713            "user-provided and are used to model system and standard headers' "
6714            "paths.">;
6715
6716 } // let Flags = [CC1Option, NoDriverOption]
6717
6718 //===----------------------------------------------------------------------===//
6719 // Preprocessor Options
6720 //===----------------------------------------------------------------------===//
6721
6722 let Flags = [CC1Option, NoDriverOption] in {
6723
6724 def chain_include : Separate<["-"], "chain-include">, MetaVarName<"<file>">,
6725   HelpText<"Include and chain a header file after turning it into PCH">;
6726 def preamble_bytes_EQ : Joined<["-"], "preamble-bytes=">,
6727   HelpText<"Assume that the precompiled header is a precompiled preamble "
6728            "covering the first N bytes of the main file">;
6729 def detailed_preprocessing_record : Flag<["-"], "detailed-preprocessing-record">,
6730   HelpText<"include a detailed record of preprocessing actions">,
6731   MarshallingInfoFlag<PreprocessorOpts<"DetailedRecord">>;
6732 def setup_static_analyzer : Flag<["-"], "setup-static-analyzer">,
6733   HelpText<"Set up preprocessor for static analyzer (done automatically when static analyzer is run).">,
6734   MarshallingInfoFlag<PreprocessorOpts<"SetUpStaticAnalyzer">>;
6735 def disable_pragma_debug_crash : Flag<["-"], "disable-pragma-debug-crash">,
6736   HelpText<"Disable any #pragma clang __debug that can lead to crashing behavior. This is meant for testing.">,
6737   MarshallingInfoFlag<PreprocessorOpts<"DisablePragmaDebugCrash">>;
6738 def source_date_epoch : Separate<["-"], "source-date-epoch">,
6739   MetaVarName<"<time since Epoch in seconds>">,
6740   HelpText<"Time to be used in __DATE__, __TIME__, and __TIMESTAMP__ macros">;
6741
6742 } // let Flags = [CC1Option, NoDriverOption]
6743
6744 //===----------------------------------------------------------------------===//
6745 // CUDA Options
6746 //===----------------------------------------------------------------------===//
6747
6748 let Flags = [CC1Option, NoDriverOption] in {
6749
6750 def fcuda_is_device : Flag<["-"], "fcuda-is-device">,
6751   HelpText<"Generate code for CUDA device">,
6752   MarshallingInfoFlag<LangOpts<"CUDAIsDevice">>;
6753 def fcuda_include_gpubinary : Separate<["-"], "fcuda-include-gpubinary">,
6754   HelpText<"Incorporate CUDA device-side binary into host object file.">,
6755   MarshallingInfoString<CodeGenOpts<"CudaGpuBinaryFileName">>;
6756 def fcuda_allow_variadic_functions : Flag<["-"], "fcuda-allow-variadic-functions">,
6757   HelpText<"Allow variadic functions in CUDA device code.">,
6758   MarshallingInfoFlag<LangOpts<"CUDAAllowVariadicFunctions">>;
6759 def fno_cuda_host_device_constexpr : Flag<["-"], "fno-cuda-host-device-constexpr">,
6760   HelpText<"Don't treat unattributed constexpr functions as __host__ __device__.">,
6761   MarshallingInfoNegativeFlag<LangOpts<"CUDAHostDeviceConstexpr">>;
6762
6763 } // let Flags = [CC1Option, NoDriverOption]
6764
6765 //===----------------------------------------------------------------------===//
6766 // OpenMP Options
6767 //===----------------------------------------------------------------------===//
6768
6769 let Flags = [CC1Option, FC1Option, NoDriverOption] in {
6770
6771 def fopenmp_is_target_device : Flag<["-"], "fopenmp-is-target-device">,
6772   HelpText<"Generate code only for an OpenMP target device.">;
6773 def : Flag<["-"], "fopenmp-is-device">, Alias<fopenmp_is_target_device>;
6774 def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
6775   HelpText<"Path to the IR file produced by the frontend for the host.">;
6776
6777 } // let Flags = [CC1Option, FC1Option, NoDriverOption]
6778
6779 //===----------------------------------------------------------------------===//
6780 // SYCL Options
6781 //===----------------------------------------------------------------------===//
6782
6783 def fsycl_is_device : Flag<["-"], "fsycl-is-device">,
6784   HelpText<"Generate code for SYCL device.">,
6785   Flags<[CC1Option, NoDriverOption]>,
6786   MarshallingInfoFlag<LangOpts<"SYCLIsDevice">>;
6787 def fsycl_is_host : Flag<["-"], "fsycl-is-host">,
6788   HelpText<"SYCL host compilation">,
6789   Flags<[CC1Option, NoDriverOption]>,
6790   MarshallingInfoFlag<LangOpts<"SYCLIsHost">>;
6791
6792 def sycl_std_EQ : Joined<["-"], "sycl-std=">, Group<sycl_Group>,
6793   Flags<[CC1Option, NoArgumentUnused, CoreOption]>,
6794   HelpText<"SYCL language standard to compile for.">,
6795   Values<"2020,2017,121,1.2.1,sycl-1.2.1">,
6796   NormalizedValues<["SYCL_2020", "SYCL_2017", "SYCL_2017", "SYCL_2017", "SYCL_2017"]>,
6797   NormalizedValuesScope<"LangOptions">,
6798   MarshallingInfoEnum<LangOpts<"SYCLVersion">, "SYCL_None">,
6799   ShouldParseIf<!strconcat(fsycl_is_device.KeyPath, "||", fsycl_is_host.KeyPath)>;
6800
6801 defm cuda_approx_transcendentals : BoolFOption<"cuda-approx-transcendentals",
6802   LangOpts<"CUDADeviceApproxTranscendentals">, DefaultFalse,
6803   PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
6804   BothFlags<[], " approximate transcendental functions">>,
6805   ShouldParseIf<fcuda_is_device.KeyPath>;
6806
6807 //===----------------------------------------------------------------------===//
6808 // Frontend Options - cc1 + fc1
6809 //===----------------------------------------------------------------------===//
6810
6811 let Flags = [CC1Option, FC1Option, NoDriverOption] in {
6812 let Group = Action_Group in {
6813
6814 def emit_obj : Flag<["-"], "emit-obj">,
6815   HelpText<"Emit native object files">;
6816 def init_only : Flag<["-"], "init-only">,
6817   HelpText<"Only execute frontend initialization">;
6818 def emit_llvm_bc : Flag<["-"], "emit-llvm-bc">,
6819   HelpText<"Build ASTs then convert to LLVM, emit .bc file">;
6820
6821 } // let Group = Action_Group
6822
6823 def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">,
6824   HelpText<"Load the named plugin (dynamic shared object)">;
6825 def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">,
6826   HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">;
6827 defm debug_pass_manager : BoolOption<"f", "debug-pass-manager",
6828   CodeGenOpts<"DebugPassManager">, DefaultFalse,
6829   PosFlag<SetTrue, [], "Prints debug information for the new pass manager">,
6830   NegFlag<SetFalse, [], "Disables debug printing for the new pass manager">>;
6831
6832 } // let Flags = [CC1Option, FC1Option, NoDriverOption]
6833
6834 //===----------------------------------------------------------------------===//
6835 // cc1as-only Options
6836 //===----------------------------------------------------------------------===//
6837
6838 let Flags = [CC1AsOption, NoDriverOption] in {
6839
6840 // Language Options
6841 def n : Flag<["-"], "n">,
6842   HelpText<"Don't automatically start assembly file with a text section">;
6843
6844 // Frontend Options
6845 def filetype : Separate<["-"], "filetype">,
6846     HelpText<"Specify the output file type ('asm', 'null', or 'obj')">;
6847
6848 // Transliterate Options
6849 def output_asm_variant : Separate<["-"], "output-asm-variant">,
6850     HelpText<"Select the asm variant index to use for output">;
6851 def show_encoding : Flag<["-"], "show-encoding">,
6852     HelpText<"Show instruction encoding information in transliterate mode">;
6853 def show_inst : Flag<["-"], "show-inst">,
6854     HelpText<"Show internal instruction representation in transliterate mode">;
6855
6856 // Assemble Options
6857 def dwarf_debug_producer : Separate<["-"], "dwarf-debug-producer">,
6858   HelpText<"The string to embed in the Dwarf debug AT_producer record.">;
6859
6860 def defsym : Separate<["-"], "defsym">,
6861   HelpText<"Define a value for a symbol">;
6862
6863 } // let Flags = [CC1AsOption]
6864
6865 //===----------------------------------------------------------------------===//
6866 // clang-cl Options
6867 //===----------------------------------------------------------------------===//
6868
6869 def cl_Group : OptionGroup<"<clang-cl options>">, Flags<[CLDXCOption]>,
6870   HelpText<"CL.EXE COMPATIBILITY OPTIONS">;
6871
6872 def cl_compile_Group : OptionGroup<"<clang-cl compile-only options>">,
6873   Group<cl_Group>;
6874
6875 def cl_ignored_Group : OptionGroup<"<clang-cl ignored options>">,
6876   Group<cl_Group>;
6877
6878 class CLFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
6879   Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
6880
6881 class CLDXCFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
6882   Group<cl_Group>, Flags<[CLDXCOption, NoXarchOption]>;
6883
6884 class CLCompileFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
6885   Group<cl_compile_Group>, Flags<[CLOption, NoXarchOption]>;
6886
6887 class CLIgnoredFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
6888   Group<cl_ignored_Group>, Flags<[CLOption, NoXarchOption]>;
6889
6890 class CLJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
6891   Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
6892
6893 class CLDXCJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
6894   Group<cl_Group>, Flags<[CLDXCOption, NoXarchOption]>;
6895
6896 class CLCompileJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
6897   Group<cl_compile_Group>, Flags<[CLOption, NoXarchOption]>;
6898
6899 class CLIgnoredJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
6900   Group<cl_ignored_Group>, Flags<[CLOption, NoXarchOption, HelpHidden]>;
6901
6902 class CLJoinedOrSeparate<string name> : Option<["/", "-"], name,
6903   KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
6904
6905 class CLDXCJoinedOrSeparate<string name> : Option<["/", "-"], name,
6906   KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[CLDXCOption, NoXarchOption]>;
6907
6908 class CLCompileJoinedOrSeparate<string name> : Option<["/", "-"], name,
6909   KIND_JOINED_OR_SEPARATE>, Group<cl_compile_Group>,
6910   Flags<[CLOption, NoXarchOption]>;
6911
6912 class CLRemainingArgsJoined<string name> : Option<["/", "-"], name,
6913   KIND_REMAINING_ARGS_JOINED>, Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
6914
6915 // Aliases:
6916 // (We don't put any of these in cl_compile_Group as the options they alias are
6917 // already in the right group.)
6918
6919 def _SLASH_Brepro : CLFlag<"Brepro">,
6920   HelpText<"Do not write current time into COFF output (breaks link.exe /incremental)">,
6921   Alias<mno_incremental_linker_compatible>;
6922 def _SLASH_Brepro_ : CLFlag<"Brepro-">,
6923   HelpText<"Write current time into COFF output (default)">,
6924   Alias<mincremental_linker_compatible>;
6925 def _SLASH_C : CLFlag<"C">,
6926   HelpText<"Do not discard comments when preprocessing">, Alias<C>;
6927 def _SLASH_c : CLFlag<"c">, HelpText<"Compile only">, Alias<c>;
6928 def _SLASH_d1PP : CLFlag<"d1PP">,
6929   HelpText<"Retain macro definitions in /E mode">, Alias<dD>;
6930 def _SLASH_d1reportAllClassLayout : CLFlag<"d1reportAllClassLayout">,
6931   HelpText<"Dump record layout information">,
6932   Alias<Xclang>, AliasArgs<["-fdump-record-layouts"]>;
6933 def _SLASH_diagnostics_caret : CLFlag<"diagnostics:caret">,
6934   HelpText<"Enable caret and column diagnostics (default)">;
6935 def _SLASH_diagnostics_column : CLFlag<"diagnostics:column">,
6936   HelpText<"Disable caret diagnostics but keep column info">;
6937 def _SLASH_diagnostics_classic : CLFlag<"diagnostics:classic">,
6938   HelpText<"Disable column and caret diagnostics">;
6939 def _SLASH_D : CLJoinedOrSeparate<"D">, HelpText<"Define macro">,
6940   MetaVarName<"<macro[=value]>">, Alias<D>;
6941 def _SLASH_E : CLFlag<"E">, HelpText<"Preprocess to stdout">, Alias<E>;
6942 def _SLASH_external_COLON_I : CLJoinedOrSeparate<"external:I">, Alias<isystem>,
6943   HelpText<"Add directory to include search path with warnings suppressed">,
6944   MetaVarName<"<dir>">;
6945 def _SLASH_fp_contract : CLFlag<"fp:contract">, HelpText<"">, Alias<ffp_contract>, AliasArgs<["on"]>;
6946 def _SLASH_fp_except : CLFlag<"fp:except">, HelpText<"">, Alias<ffp_exception_behavior_EQ>, AliasArgs<["strict"]>;
6947 def _SLASH_fp_except_ : CLFlag<"fp:except-">, HelpText<"">, Alias<ffp_exception_behavior_EQ>, AliasArgs<["ignore"]>;
6948 def _SLASH_fp_fast : CLFlag<"fp:fast">, HelpText<"">, Alias<ffast_math>;
6949 def _SLASH_fp_precise : CLFlag<"fp:precise">, HelpText<"">, Alias<ffp_model_EQ>, AliasArgs<["precise"]>;
6950 def _SLASH_fp_strict : CLFlag<"fp:strict">, HelpText<"">, Alias<ffp_model_EQ>, AliasArgs<["strict"]>;
6951 def _SLASH_fsanitize_EQ_address : CLFlag<"fsanitize=address">,
6952   HelpText<"Enable AddressSanitizer">,
6953   Alias<fsanitize_EQ>, AliasArgs<["address"]>;
6954 def _SLASH_GA : CLFlag<"GA">, Alias<ftlsmodel_EQ>, AliasArgs<["local-exec"]>,
6955   HelpText<"Assume thread-local variables are defined in the executable">;
6956 def _SLASH_GR : CLFlag<"GR">, HelpText<"Emit RTTI data (default)">;
6957 def _SLASH_GR_ : CLFlag<"GR-">, HelpText<"Do not emit RTTI data">;
6958 def _SLASH_GF : CLIgnoredFlag<"GF">,
6959   HelpText<"Enable string pooling (default)">;
6960 def _SLASH_GF_ : CLFlag<"GF-">, HelpText<"Disable string pooling">,
6961   Alias<fwritable_strings>;
6962 def _SLASH_GS : CLFlag<"GS">,
6963   HelpText<"Enable buffer security check (default)">;
6964 def _SLASH_GS_ : CLFlag<"GS-">, HelpText<"Disable buffer security check">;
6965 def : CLFlag<"Gs">, HelpText<"Use stack probes (default)">,
6966   Alias<mstack_probe_size>, AliasArgs<["4096"]>;
6967 def _SLASH_Gs : CLJoined<"Gs">,
6968   HelpText<"Set stack probe size (default 4096)">, Alias<mstack_probe_size>;
6969 def _SLASH_Gy : CLFlag<"Gy">, HelpText<"Put each function in its own section">,
6970   Alias<ffunction_sections>;
6971 def _SLASH_Gy_ : CLFlag<"Gy-">,
6972   HelpText<"Do not put each function in its own section (default)">,
6973   Alias<fno_function_sections>;
6974 def _SLASH_Gw : CLFlag<"Gw">, HelpText<"Put each data item in its own section">,
6975   Alias<fdata_sections>;
6976 def _SLASH_Gw_ : CLFlag<"Gw-">,
6977   HelpText<"Do not put each data item in its own section (default)">,
6978   Alias<fno_data_sections>;
6979 def _SLASH_help : CLFlag<"help">, Alias<help>,
6980   HelpText<"Display available options">;
6981 def _SLASH_HELP : CLFlag<"HELP">, Alias<help>;
6982 def _SLASH_hotpatch : CLFlag<"hotpatch">, Alias<fms_hotpatch>,
6983   HelpText<"Create hotpatchable image">;
6984 def _SLASH_I : CLDXCJoinedOrSeparate<"I">,
6985   HelpText<"Add directory to include search path">, MetaVarName<"<dir>">,
6986   Alias<I>;
6987 def _SLASH_J : CLFlag<"J">, HelpText<"Make char type unsigned">,
6988   Alias<funsigned_char>;
6989
6990 // The _SLASH_O option handles all the /O flags, but we also provide separate
6991 // aliased options to provide separate help messages.
6992 def _SLASH_O : CLDXCJoined<"O">,
6993   HelpText<"Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-'">,
6994   MetaVarName<"<flags>">;
6995 def : CLFlag<"O1">, Alias<_SLASH_O>, AliasArgs<["1"]>,
6996   HelpText<"Optimize for size  (like /Og     /Os /Oy /Ob2 /GF /Gy)">;
6997 def : CLFlag<"O2">, Alias<_SLASH_O>, AliasArgs<["2"]>,
6998   HelpText<"Optimize for speed (like /Og /Oi /Ot /Oy /Ob2 /GF /Gy)">;
6999 def : CLFlag<"Ob0">, Alias<_SLASH_O>, AliasArgs<["b0"]>,
7000   HelpText<"Disable function inlining">;
7001 def : CLFlag<"Ob1">, Alias<_SLASH_O>, AliasArgs<["b1"]>,
7002   HelpText<"Only inline functions explicitly or implicitly marked inline">;
7003 def : CLFlag<"Ob2">, Alias<_SLASH_O>, AliasArgs<["b2"]>,
7004   HelpText<"Inline functions as deemed beneficial by the compiler">;
7005 def : CLDXCFlag<"Od">, Alias<_SLASH_O>, AliasArgs<["d"]>,
7006   HelpText<"Disable optimization">;
7007 def : CLFlag<"Og">, Alias<_SLASH_O>, AliasArgs<["g"]>,
7008   HelpText<"No effect">;
7009 def : CLFlag<"Oi">, Alias<_SLASH_O>, AliasArgs<["i"]>,
7010   HelpText<"Enable use of builtin functions">;
7011 def : CLFlag<"Oi-">, Alias<_SLASH_O>, AliasArgs<["i-"]>,
7012   HelpText<"Disable use of builtin functions">;
7013 def : CLFlag<"Os">, Alias<_SLASH_O>, AliasArgs<["s"]>,
7014   HelpText<"Optimize for size">;
7015 def : CLFlag<"Ot">, Alias<_SLASH_O>, AliasArgs<["t"]>,
7016   HelpText<"Optimize for speed">;
7017 def : CLFlag<"Ox">, Alias<_SLASH_O>, AliasArgs<["x"]>,
7018   HelpText<"Deprecated (like /Og /Oi /Ot /Oy /Ob2); use /O2">;
7019 def : CLFlag<"Oy">, Alias<_SLASH_O>, AliasArgs<["y"]>,
7020   HelpText<"Enable frame pointer omission (x86 only)">;
7021 def : CLFlag<"Oy-">, Alias<_SLASH_O>, AliasArgs<["y-"]>,
7022   HelpText<"Disable frame pointer omission (x86 only, default)">;
7023
7024 def _SLASH_QUESTION : CLFlag<"?">, Alias<help>,
7025   HelpText<"Display available options">;
7026 def _SLASH_Qvec : CLFlag<"Qvec">,
7027   HelpText<"Enable the loop vectorization passes">, Alias<fvectorize>;
7028 def _SLASH_Qvec_ : CLFlag<"Qvec-">,
7029   HelpText<"Disable the loop vectorization passes">, Alias<fno_vectorize>;
7030 def _SLASH_showIncludes : CLFlag<"showIncludes">,
7031   HelpText<"Print info about included files to stderr">;
7032 def _SLASH_showIncludes_user : CLFlag<"showIncludes:user">,
7033   HelpText<"Like /showIncludes but omit system headers">;
7034 def _SLASH_showFilenames : CLFlag<"showFilenames">,
7035   HelpText<"Print the name of each compiled file">;
7036 def _SLASH_showFilenames_ : CLFlag<"showFilenames-">,
7037   HelpText<"Do not print the name of each compiled file (default)">;
7038 def _SLASH_source_charset : CLCompileJoined<"source-charset:">,
7039   HelpText<"Set source encoding, supports only UTF-8">,
7040   Alias<finput_charset_EQ>;
7041 def _SLASH_execution_charset : CLCompileJoined<"execution-charset:">,
7042   HelpText<"Set runtime encoding, supports only UTF-8">,
7043   Alias<fexec_charset_EQ>;
7044 def _SLASH_std : CLCompileJoined<"std:">,
7045   HelpText<"Set language version (c++14,c++17,c++20,c++latest,c11,c17)">;
7046 def _SLASH_U : CLJoinedOrSeparate<"U">, HelpText<"Undefine macro">,
7047   MetaVarName<"<macro>">, Alias<U>;
7048 def _SLASH_validate_charset : CLFlag<"validate-charset">,
7049   Alias<W_Joined>, AliasArgs<["invalid-source-encoding"]>;
7050 def _SLASH_validate_charset_ : CLFlag<"validate-charset-">,
7051   Alias<W_Joined>, AliasArgs<["no-invalid-source-encoding"]>;
7052 def _SLASH_external_W0 : CLFlag<"external:W0">, HelpText<"Ignore warnings from system headers (default)">, Alias<Wno_system_headers>;
7053 def _SLASH_external_W1 : CLFlag<"external:W1">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
7054 def _SLASH_external_W2 : CLFlag<"external:W2">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
7055 def _SLASH_external_W3 : CLFlag<"external:W3">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
7056 def _SLASH_external_W4 : CLFlag<"external:W4">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
7057 def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">, Alias<w>;
7058 def _SLASH_W1 : CLFlag<"W1">, HelpText<"Enable -Wall">, Alias<Wall>;
7059 def _SLASH_W2 : CLFlag<"W2">, HelpText<"Enable -Wall">, Alias<Wall>;
7060 def _SLASH_W3 : CLFlag<"W3">, HelpText<"Enable -Wall">, Alias<Wall>;
7061 def _SLASH_W4 : CLFlag<"W4">, HelpText<"Enable -Wall and -Wextra">, Alias<WCL4>;
7062 def _SLASH_Wall : CLFlag<"Wall">, HelpText<"Enable -Weverything">,
7063   Alias<W_Joined>, AliasArgs<["everything"]>;
7064 def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">,
7065   Alias<W_Joined>, AliasArgs<["error"]>;
7066 def _SLASH_WX_ : CLFlag<"WX-">,
7067   HelpText<"Do not treat warnings as errors (default)">,
7068   Alias<W_Joined>, AliasArgs<["no-error"]>;
7069 def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias<w>;
7070 def _SLASH_wd : CLCompileJoined<"wd">;
7071 def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
7072   Alias<vtordisp_mode_EQ>;
7073 def _SLASH_X : CLFlag<"X">,
7074   HelpText<"Do not add %INCLUDE% to include search path">, Alias<nostdlibinc>;
7075 def _SLASH_Zc_sizedDealloc : CLFlag<"Zc:sizedDealloc">,
7076   HelpText<"Enable C++14 sized global deallocation functions">,
7077   Alias<fsized_deallocation>;
7078 def _SLASH_Zc_sizedDealloc_ : CLFlag<"Zc:sizedDealloc-">,
7079   HelpText<"Disable C++14 sized global deallocation functions">,
7080   Alias<fno_sized_deallocation>;
7081 def _SLASH_Zc_alignedNew : CLFlag<"Zc:alignedNew">,
7082   HelpText<"Enable C++17 aligned allocation functions">,
7083   Alias<faligned_allocation>;
7084 def _SLASH_Zc_alignedNew_ : CLFlag<"Zc:alignedNew-">,
7085   HelpText<"Disable C++17 aligned allocation functions">,
7086   Alias<fno_aligned_allocation>;
7087 def _SLASH_Zc_char8_t : CLFlag<"Zc:char8_t">,
7088   HelpText<"Enable char8_t from C++2a">,
7089   Alias<fchar8__t>;
7090 def _SLASH_Zc_char8_t_ : CLFlag<"Zc:char8_t-">,
7091   HelpText<"Disable char8_t from c++2a">,
7092   Alias<fno_char8__t>;
7093 def _SLASH_Zc_strictStrings : CLFlag<"Zc:strictStrings">,
7094   HelpText<"Treat string literals as const">, Alias<W_Joined>,
7095   AliasArgs<["error=c++11-compat-deprecated-writable-strings"]>;
7096 def _SLASH_Zc_threadSafeInit : CLFlag<"Zc:threadSafeInit">,
7097   HelpText<"Enable thread-safe initialization of static variables">,
7098   Alias<fthreadsafe_statics>;
7099 def _SLASH_Zc_threadSafeInit_ : CLFlag<"Zc:threadSafeInit-">,
7100   HelpText<"Disable thread-safe initialization of static variables">,
7101   Alias<fno_threadsafe_statics>;
7102 def _SLASH_Zc_trigraphs : CLFlag<"Zc:trigraphs">,
7103   HelpText<"Enable trigraphs">, Alias<ftrigraphs>;
7104 def _SLASH_Zc_trigraphs_off : CLFlag<"Zc:trigraphs-">,
7105   HelpText<"Disable trigraphs (default)">, Alias<fno_trigraphs>;
7106 def _SLASH_Zc_twoPhase : CLFlag<"Zc:twoPhase">,
7107   HelpText<"Enable two-phase name lookup in templates">,
7108   Alias<fno_delayed_template_parsing>;
7109 def _SLASH_Zc_twoPhase_ : CLFlag<"Zc:twoPhase-">,
7110   HelpText<"Disable two-phase name lookup in templates (default)">,
7111   Alias<fdelayed_template_parsing>;
7112 def _SLASH_Zc_wchar_t : CLFlag<"Zc:wchar_t">,
7113   HelpText<"Enable C++ builtin type wchar_t (default)">;
7114 def _SLASH_Zc_wchar_t_ : CLFlag<"Zc:wchar_t-">,
7115   HelpText<"Disable C++ builtin type wchar_t">;
7116 def _SLASH_Z7 : CLFlag<"Z7">,
7117   HelpText<"Enable CodeView debug information in object files">;
7118 def _SLASH_ZH_MD5 : CLFlag<"ZH:MD5">,
7119   HelpText<"Use MD5 for file checksums in debug info (default)">,
7120   Alias<gsrc_hash_EQ>, AliasArgs<["md5"]>;
7121 def _SLASH_ZH_SHA1 : CLFlag<"ZH:SHA1">,
7122   HelpText<"Use SHA1 for file checksums in debug info">,
7123   Alias<gsrc_hash_EQ>, AliasArgs<["sha1"]>;
7124 def _SLASH_ZH_SHA_256 : CLFlag<"ZH:SHA_256">,
7125   HelpText<"Use SHA256 for file checksums in debug info">,
7126   Alias<gsrc_hash_EQ>, AliasArgs<["sha256"]>;
7127 def _SLASH_Zi : CLFlag<"Zi">, Alias<_SLASH_Z7>,
7128   HelpText<"Like /Z7">;
7129 def _SLASH_Zp : CLJoined<"Zp">,
7130   HelpText<"Set default maximum struct packing alignment">,
7131   Alias<fpack_struct_EQ>;
7132 def _SLASH_Zp_flag : CLFlag<"Zp">,
7133   HelpText<"Set default maximum struct packing alignment to 1">,
7134   Alias<fpack_struct_EQ>, AliasArgs<["1"]>;
7135 def _SLASH_Zs : CLFlag<"Zs">, HelpText<"Run the preprocessor, parser and semantic analysis stages">,
7136   Alias<fsyntax_only>;
7137 def _SLASH_openmp_ : CLFlag<"openmp-">,
7138   HelpText<"Disable OpenMP support">, Alias<fno_openmp>;
7139 def _SLASH_openmp : CLFlag<"openmp">, HelpText<"Enable OpenMP support">,
7140   Alias<fopenmp>;
7141 def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">,
7142   HelpText<"Enable OpenMP support with experimental SIMD support">,
7143   Alias<fopenmp>;
7144 def _SLASH_tune : CLCompileJoined<"tune:">,
7145   HelpText<"Set CPU for optimization without affecting instruction set">,
7146   Alias<mtune_EQ>;
7147 def _SLASH_QIntel_jcc_erratum : CLFlag<"QIntel-jcc-erratum">,
7148   HelpText<"Align branches within 32-byte boundaries to mitigate the performance impact of the Intel JCC erratum.">,
7149   Alias<mbranches_within_32B_boundaries>;
7150 def _SLASH_arm64EC : CLFlag<"arm64EC">,
7151   HelpText<"Set build target to arm64ec">;
7152 def : CLFlag<"Qgather-">, Alias<mno_gather>,
7153       HelpText<"Disable generation of gather instructions in auto-vectorization(x86 only)">;
7154 def : CLFlag<"Qscatter-">, Alias<mno_scatter>,
7155       HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;
7156
7157 // Non-aliases:
7158
7159 def _SLASH_arch : CLCompileJoined<"arch:">,
7160   HelpText<"Set architecture for code generation">;
7161
7162 def _SLASH_M_Group : OptionGroup<"</M group>">, Group<cl_compile_Group>;
7163 def _SLASH_volatile_Group : OptionGroup<"</volatile group>">,
7164   Group<cl_compile_Group>;
7165
7166 def _SLASH_EH : CLJoined<"EH">, HelpText<"Set exception handling model">;
7167 def _SLASH_EP : CLFlag<"EP">,
7168   HelpText<"Disable linemarker output and preprocess to stdout">;
7169 def _SLASH_external_env : CLJoined<"external:env:">,
7170   HelpText<"Add dirs in env var <var> to include search path with warnings suppressed">,
7171   MetaVarName<"<var>">;
7172 def _SLASH_FA : CLJoined<"FA">,
7173   HelpText<"Output assembly code file during compilation">;
7174 def _SLASH_Fa : CLJoined<"Fa">,
7175   HelpText<"Set assembly output file name (with /FA)">,
7176   MetaVarName<"<file or dir/>">;
7177 def _SLASH_FI : CLJoinedOrSeparate<"FI">,
7178   HelpText<"Include file before parsing">, Alias<include_>;
7179 def _SLASH_Fe : CLJoined<"Fe">,
7180   HelpText<"Set output executable file name">,
7181   MetaVarName<"<file or dir/>">;
7182 def _SLASH_Fe_COLON : CLJoined<"Fe:">, Alias<_SLASH_Fe>;
7183 def _SLASH_Fi : CLCompileJoined<"Fi">,
7184   HelpText<"Set preprocess output file name (with /P)">,
7185   MetaVarName<"<file>">;
7186 def _SLASH_Fo : CLCompileJoined<"Fo">,
7187   HelpText<"Set output object file (with /c)">,
7188   MetaVarName<"<file or dir/>">;
7189 def _SLASH_guard : CLJoined<"guard:">,
7190   HelpText<"Enable Control Flow Guard with /guard:cf, or only the table with /guard:cf,nochecks. "
7191            "Enable EH Continuation Guard with /guard:ehcont">;
7192 def _SLASH_GX : CLFlag<"GX">,
7193   HelpText<"Deprecated; use /EHsc">;
7194 def _SLASH_GX_ : CLFlag<"GX-">,
7195   HelpText<"Deprecated (like not passing /EH)">;
7196 def _SLASH_imsvc : CLJoinedOrSeparate<"imsvc">,
7197   HelpText<"Add <dir> to system include search path, as if in %INCLUDE%">,
7198   MetaVarName<"<dir>">;
7199 def _SLASH_JMC : CLFlag<"JMC">,
7200   HelpText<"Enable just-my-code debugging">;
7201 def _SLASH_JMC_ : CLFlag<"JMC-">,
7202   HelpText<"Disable just-my-code debugging (default)">;
7203 def _SLASH_LD : CLFlag<"LD">, HelpText<"Create DLL">;
7204 def _SLASH_LDd : CLFlag<"LDd">, HelpText<"Create debug DLL">;
7205 def _SLASH_link : CLRemainingArgsJoined<"link">,
7206   HelpText<"Forward options to the linker">, MetaVarName<"<options>">;
7207 def _SLASH_MD : Option<["/", "-"], "MD", KIND_FLAG>, Group<_SLASH_M_Group>,
7208   Flags<[CLOption, NoXarchOption]>, HelpText<"Use DLL run-time">;
7209 def _SLASH_MDd : Option<["/", "-"], "MDd", KIND_FLAG>, Group<_SLASH_M_Group>,
7210   Flags<[CLOption, NoXarchOption]>, HelpText<"Use DLL debug run-time">;
7211 def _SLASH_MT : Option<["/", "-"], "MT", KIND_FLAG>, Group<_SLASH_M_Group>,
7212   Flags<[CLOption, NoXarchOption]>, HelpText<"Use static run-time">;
7213 def _SLASH_MTd : Option<["/", "-"], "MTd", KIND_FLAG>, Group<_SLASH_M_Group>,
7214   Flags<[CLOption, NoXarchOption]>, HelpText<"Use static debug run-time">;
7215 def _SLASH_o : CLJoinedOrSeparate<"o">,
7216   HelpText<"Deprecated (set output file name); use /Fe or /Fe">,
7217   MetaVarName<"<file or dir/>">;
7218 def _SLASH_P : CLFlag<"P">, HelpText<"Preprocess to file">;
7219 def _SLASH_permissive : CLFlag<"permissive">,
7220   HelpText<"Enable some non conforming code to compile">;
7221 def _SLASH_permissive_ : CLFlag<"permissive-">,
7222   HelpText<"Disable non conforming code from compiling (default)">;
7223 def _SLASH_Tc : CLCompileJoinedOrSeparate<"Tc">,
7224   HelpText<"Treat <file> as C source file">, MetaVarName<"<file>">;
7225 def _SLASH_TC : CLCompileFlag<"TC">, HelpText<"Treat all source files as C">;
7226 def _SLASH_Tp : CLCompileJoinedOrSeparate<"Tp">,
7227   HelpText<"Treat <file> as C++ source file">, MetaVarName<"<file>">;
7228 def _SLASH_TP : CLCompileFlag<"TP">, HelpText<"Treat all source files as C++">;
7229 def _SLASH_diasdkdir : CLJoinedOrSeparate<"diasdkdir">,
7230   HelpText<"Path to the DIA SDK">, MetaVarName<"<dir>">;
7231 def _SLASH_vctoolsdir : CLJoinedOrSeparate<"vctoolsdir">,
7232   HelpText<"Path to the VCToolChain">, MetaVarName<"<dir>">;
7233 def _SLASH_vctoolsversion : CLJoinedOrSeparate<"vctoolsversion">,
7234   HelpText<"For use with /winsysroot, defaults to newest found">;
7235 def _SLASH_winsdkdir : CLJoinedOrSeparate<"winsdkdir">,
7236   HelpText<"Path to the Windows SDK">, MetaVarName<"<dir>">;
7237 def _SLASH_winsdkversion : CLJoinedOrSeparate<"winsdkversion">,
7238   HelpText<"Full version of the Windows SDK, defaults to newest found">;
7239 def _SLASH_winsysroot : CLJoinedOrSeparate<"winsysroot">,
7240   HelpText<"Same as \"/diasdkdir <dir>/DIA SDK\" /vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsversion> \"/winsdkdir <dir>/Windows Kits/10\"">,
7241   MetaVarName<"<dir>">;
7242 def _SLASH_volatile_iso : Option<["/", "-"], "volatile:iso", KIND_FLAG>,
7243   Group<_SLASH_volatile_Group>, Flags<[CLOption, NoXarchOption]>,
7244   HelpText<"Volatile loads and stores have standard semantics">;
7245 def _SLASH_vmb : CLFlag<"vmb">,
7246   HelpText<"Use a best-case representation method for member pointers">;
7247 def _SLASH_vmg : CLFlag<"vmg">,
7248   HelpText<"Use a most-general representation for member pointers">;
7249 def _SLASH_vms : CLFlag<"vms">,
7250   HelpText<"Set the default most-general representation to single inheritance">;
7251 def _SLASH_vmm : CLFlag<"vmm">,
7252   HelpText<"Set the default most-general representation to "
7253            "multiple inheritance">;
7254 def _SLASH_vmv : CLFlag<"vmv">,
7255   HelpText<"Set the default most-general representation to "
7256            "virtual inheritance">;
7257 def _SLASH_volatile_ms  : Option<["/", "-"], "volatile:ms", KIND_FLAG>,
7258   Group<_SLASH_volatile_Group>, Flags<[CLOption, NoXarchOption]>,
7259   HelpText<"Volatile loads and stores have acquire and release semantics">;
7260 def _SLASH_clang : CLJoined<"clang:">,
7261   HelpText<"Pass <arg> to the clang driver">, MetaVarName<"<arg>">;
7262 def _SLASH_Zl : CLFlag<"Zl">, Alias<fms_omit_default_lib>,
7263   HelpText<"Do not let object file auto-link default libraries">;
7264
7265 def _SLASH_Yc : CLJoined<"Yc">,
7266   HelpText<"Generate a pch file for all code up to and including <filename>">,
7267   MetaVarName<"<filename>">;
7268 def _SLASH_Yu : CLJoined<"Yu">,
7269   HelpText<"Load a pch file and use it instead of all code up to "
7270            "and including <filename>">,
7271   MetaVarName<"<filename>">;
7272 def _SLASH_Y_ : CLFlag<"Y-">,
7273   HelpText<"Disable precompiled headers, overrides /Yc and /Yu">;
7274 def _SLASH_Zc_dllexportInlines : CLFlag<"Zc:dllexportInlines">,
7275   HelpText<"dllexport/dllimport inline member functions of dllexport/import classes (default)">;
7276 def _SLASH_Zc_dllexportInlines_ : CLFlag<"Zc:dllexportInlines-">,
7277   HelpText<"Do not dllexport/dllimport inline member functions of dllexport/import classes">;
7278 def _SLASH_Fp : CLJoined<"Fp">,
7279   HelpText<"Set pch file name (with /Yc and /Yu)">, MetaVarName<"<file>">;
7280
7281 def _SLASH_Gd : CLFlag<"Gd">,
7282   HelpText<"Set __cdecl as a default calling convention">;
7283 def _SLASH_Gr : CLFlag<"Gr">,
7284   HelpText<"Set __fastcall as a default calling convention">;
7285 def _SLASH_Gz : CLFlag<"Gz">,
7286   HelpText<"Set __stdcall as a default calling convention">;
7287 def _SLASH_Gv : CLFlag<"Gv">,
7288   HelpText<"Set __vectorcall as a default calling convention">;
7289 def _SLASH_Gregcall : CLFlag<"Gregcall">,
7290   HelpText<"Set __regcall as a default calling convention">;
7291
7292 // GNU Driver aliases
7293
7294 def : Separate<["-"], "Xmicrosoft-visualc-tools-root">, Alias<_SLASH_vctoolsdir>;
7295 def : Separate<["-"], "Xmicrosoft-visualc-tools-version">,
7296     Alias<_SLASH_vctoolsversion>;
7297 def : Separate<["-"], "Xmicrosoft-windows-sdk-root">,
7298     Alias<_SLASH_winsdkdir>;
7299 def : Separate<["-"], "Xmicrosoft-windows-sdk-version">,
7300     Alias<_SLASH_winsdkversion>;
7301
7302 // Ignored:
7303
7304 def _SLASH_analyze_ : CLIgnoredFlag<"analyze-">;
7305 def _SLASH_bigobj : CLIgnoredFlag<"bigobj">;
7306 def _SLASH_cgthreads : CLIgnoredJoined<"cgthreads">;
7307 def _SLASH_d2FastFail : CLIgnoredFlag<"d2FastFail">;
7308 def _SLASH_d2Zi_PLUS : CLIgnoredFlag<"d2Zi+">;
7309 def _SLASH_errorReport : CLIgnoredJoined<"errorReport">;
7310 def _SLASH_FC : CLIgnoredFlag<"FC">;
7311 def _SLASH_Fd : CLIgnoredJoined<"Fd">;
7312 def _SLASH_FS : CLIgnoredFlag<"FS">;
7313 def _SLASH_kernel_ : CLIgnoredFlag<"kernel-">;
7314 def _SLASH_nologo : CLIgnoredFlag<"nologo">;
7315 def _SLASH_RTC : CLIgnoredJoined<"RTC">;
7316 def _SLASH_sdl : CLIgnoredFlag<"sdl">;
7317 def _SLASH_sdl_ : CLIgnoredFlag<"sdl-">;
7318 def _SLASH_utf8 : CLIgnoredFlag<"utf-8">,
7319   HelpText<"Set source and runtime encoding to UTF-8 (default)">;
7320 def _SLASH_w : CLIgnoredJoined<"w">;
7321 def _SLASH_Wv_ : CLIgnoredJoined<"Wv">;
7322 def _SLASH_Zc___cplusplus : CLIgnoredFlag<"Zc:__cplusplus">;
7323 def _SLASH_Zc_auto : CLIgnoredFlag<"Zc:auto">;
7324 def _SLASH_Zc_forScope : CLIgnoredFlag<"Zc:forScope">;
7325 def _SLASH_Zc_inline : CLIgnoredFlag<"Zc:inline">;
7326 def _SLASH_Zc_rvalueCast : CLIgnoredFlag<"Zc:rvalueCast">;
7327 def _SLASH_Zc_ternary : CLIgnoredFlag<"Zc:ternary">;
7328 def _SLASH_Zm : CLIgnoredJoined<"Zm">;
7329 def _SLASH_Zo : CLIgnoredFlag<"Zo">;
7330 def _SLASH_Zo_ : CLIgnoredFlag<"Zo-">;
7331
7332
7333 // Unsupported:
7334
7335 def _SLASH_await : CLFlag<"await">;
7336 def _SLASH_await_COLON : CLJoined<"await:">;
7337 def _SLASH_constexpr : CLJoined<"constexpr:">;
7338 def _SLASH_AI : CLJoinedOrSeparate<"AI">;
7339 def _SLASH_Bt : CLFlag<"Bt">;
7340 def _SLASH_Bt_plus : CLFlag<"Bt+">;
7341 def _SLASH_clr : CLJoined<"clr">;
7342 def _SLASH_d1 : CLJoined<"d1">;
7343 def _SLASH_d2 : CLJoined<"d2">;
7344 def _SLASH_doc : CLJoined<"doc">;
7345 def _SLASH_experimental : CLJoined<"experimental:">;
7346 def _SLASH_exportHeader : CLFlag<"exportHeader">;
7347 def _SLASH_external : CLJoined<"external:">;
7348 def _SLASH_favor : CLJoined<"favor">;
7349 def _SLASH_fsanitize_address_use_after_return : CLJoined<"fsanitize-address-use-after-return">;
7350 def _SLASH_fno_sanitize_address_vcasan_lib : CLJoined<"fno-sanitize-address-vcasan-lib">;
7351 def _SLASH_F : CLJoinedOrSeparate<"F">;
7352 def _SLASH_Fm : CLJoined<"Fm">;
7353 def _SLASH_Fr : CLJoined<"Fr">;
7354 def _SLASH_FR : CLJoined<"FR">;
7355 def _SLASH_FU : CLJoinedOrSeparate<"FU">;
7356 def _SLASH_Fx : CLFlag<"Fx">;
7357 def _SLASH_G1 : CLFlag<"G1">;
7358 def _SLASH_G2 : CLFlag<"G2">;
7359 def _SLASH_Ge : CLFlag<"Ge">;
7360 def _SLASH_Gh : CLFlag<"Gh">;
7361 def _SLASH_GH : CLFlag<"GH">;
7362 def _SLASH_GL : CLFlag<"GL">;
7363 def _SLASH_GL_ : CLFlag<"GL-">;
7364 def _SLASH_Gm : CLFlag<"Gm">;
7365 def _SLASH_Gm_ : CLFlag<"Gm-">;
7366 def _SLASH_GT : CLFlag<"GT">;
7367 def _SLASH_GZ : CLFlag<"GZ">;
7368 def _SLASH_H : CLFlag<"H">;
7369 def _SLASH_headername : CLJoined<"headerName:">;
7370 def _SLASH_headerUnit : CLJoinedOrSeparate<"headerUnit">;
7371 def _SLASH_headerUnitAngle : CLJoinedOrSeparate<"headerUnit:angle">;
7372 def _SLASH_headerUnitQuote : CLJoinedOrSeparate<"headerUnit:quote">;
7373 def _SLASH_homeparams : CLFlag<"homeparams">;
7374 def _SLASH_kernel : CLFlag<"kernel">;
7375 def _SLASH_LN : CLFlag<"LN">;
7376 def _SLASH_MP : CLJoined<"MP">;
7377 def _SLASH_Qfast_transcendentals : CLFlag<"Qfast_transcendentals">;
7378 def _SLASH_QIfist : CLFlag<"QIfist">;
7379 def _SLASH_Qimprecise_fwaits : CLFlag<"Qimprecise_fwaits">;
7380 def _SLASH_Qpar : CLFlag<"Qpar">;
7381 def _SLASH_Qpar_report : CLJoined<"Qpar-report">;
7382 def _SLASH_Qsafe_fp_loads : CLFlag<"Qsafe_fp_loads">;
7383 def _SLASH_Qspectre : CLFlag<"Qspectre">;
7384 def _SLASH_Qspectre_load : CLFlag<"Qspectre-load">;
7385 def _SLASH_Qspectre_load_cf : CLFlag<"Qspectre-load-cf">;
7386 def _SLASH_Qvec_report : CLJoined<"Qvec-report">;
7387 def _SLASH_reference : CLJoinedOrSeparate<"reference">;
7388 def _SLASH_sourceDependencies : CLJoinedOrSeparate<"sourceDependencies">;
7389 def _SLASH_sourceDependenciesDirectives : CLJoinedOrSeparate<"sourceDependencies:directives">;
7390 def _SLASH_translateInclude : CLFlag<"translateInclude">;
7391 def _SLASH_u : CLFlag<"u">;
7392 def _SLASH_V : CLFlag<"V">;
7393 def _SLASH_WL : CLFlag<"WL">;
7394 def _SLASH_Wp64 : CLFlag<"Wp64">;
7395 def _SLASH_Yd : CLFlag<"Yd">;
7396 def _SLASH_Yl : CLJoined<"Yl">;
7397 def _SLASH_Za : CLFlag<"Za">;
7398 def _SLASH_Zc : CLJoined<"Zc:">;
7399 def _SLASH_Ze : CLFlag<"Ze">;
7400 def _SLASH_Zg : CLFlag<"Zg">;
7401 def _SLASH_ZI : CLFlag<"ZI">;
7402 def _SLASH_ZW : CLJoined<"ZW">;
7403
7404 //===----------------------------------------------------------------------===//
7405 // clang-dxc Options
7406 //===----------------------------------------------------------------------===//
7407
7408 def dxc_Group : OptionGroup<"<clang-dxc options>">, Flags<[DXCOption]>,
7409   HelpText<"dxc compatibility options">;
7410 class DXCFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
7411   Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>;
7412 class DXCJoinedOrSeparate<string name> : Option<["/", "-"], name,
7413   KIND_JOINED_OR_SEPARATE>, Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>;
7414
7415 def dxc_help : Option<["/", "-", "--"], "help", KIND_JOINED>,
7416   Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>, Alias<help>,
7417   HelpText<"Display available options">;
7418 def dxc_no_stdinc : DXCFlag<"hlsl-no-stdinc">,
7419   HelpText<"HLSL only. Disables all standard includes containing non-native compiler types and functions.">;
7420 def Fo : DXCJoinedOrSeparate<"Fo">, Alias<o>,
7421   HelpText<"Output object file">;
7422 def dxil_validator_version : Option<["/", "-"], "validator-version", KIND_SEPARATE>,
7423   Group<dxc_Group>, Flags<[DXCOption, NoXarchOption, CC1Option, HelpHidden]>,
7424   HelpText<"Override validator version for module. Format: <major.minor>;"
7425            "Default: DXIL.dll version or current internal version">,
7426   MarshallingInfoString<TargetOpts<"DxilValidatorVersion">>;
7427 def target_profile : DXCJoinedOrSeparate<"T">, MetaVarName<"<profile>">,
7428   HelpText<"Set target profile">,
7429   Values<"ps_6_0, ps_6_1, ps_6_2, ps_6_3, ps_6_4, ps_6_5, ps_6_6, ps_6_7,"
7430          "vs_6_0, vs_6_1, vs_6_2, vs_6_3, vs_6_4, vs_6_5, vs_6_6, vs_6_7,"
7431          "gs_6_0, gs_6_1, gs_6_2, gs_6_3, gs_6_4, gs_6_5, gs_6_6, gs_6_7,"
7432          "hs_6_0, hs_6_1, hs_6_2, hs_6_3, hs_6_4, hs_6_5, hs_6_6, hs_6_7,"
7433          "ds_6_0, ds_6_1, ds_6_2, ds_6_3, ds_6_4, ds_6_5, ds_6_6, ds_6_7,"
7434          "cs_6_0, cs_6_1, cs_6_2, cs_6_3, cs_6_4, cs_6_5, cs_6_6, cs_6_7,"
7435          "lib_6_3, lib_6_4, lib_6_5, lib_6_6, lib_6_7, lib_6_x,"
7436          "ms_6_5, ms_6_6, ms_6_7,"
7437          "as_6_5, as_6_6, as_6_7">;
7438 def dxc_D : Option<["--", "/", "-"], "D", KIND_JOINED_OR_SEPARATE>,
7439   Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>, Alias<D>;
7440 def emit_pristine_llvm : DXCFlag<"emit-pristine-llvm">,
7441   HelpText<"Emit pristine LLVM IR from the frontend by not running any LLVM passes at all."
7442            "Same as -S + -emit-llvm + -disable-llvm-passes.">;
7443 def fcgl : DXCFlag<"fcgl">, Alias<emit_pristine_llvm>;
7444 def enable_16bit_types : DXCFlag<"enable-16bit-types">, Alias<fnative_half_type>,
7445   HelpText<"Enable 16-bit types and disable min precision types."
7446            "Available in HLSL 2018 and shader model 6.2.">;
7447 def hlsl_entrypoint : Option<["-"], "hlsl-entry", KIND_SEPARATE>,
7448                       Group<dxc_Group>,
7449                       Flags<[CC1Option]>,
7450                       MarshallingInfoString<TargetOpts<"HLSLEntry">, "\"main\"">,
7451                       HelpText<"Entry point name for hlsl">;
7452 def dxc_entrypoint : Option<["--", "/", "-"], "E", KIND_JOINED_OR_SEPARATE>,
7453                      Group<dxc_Group>,
7454                      Flags<[DXCOption, NoXarchOption]>,
7455                      HelpText<"Entry point name">;
7456 def dxc_validator_path_EQ : Joined<["--"], "dxv-path=">, Group<dxc_Group>,
7457   HelpText<"DXIL validator installation path">;
7458 def dxc_disable_validation : DXCFlag<"Vd">,
7459   HelpText<"Disable validation">;