xref: /llvm-project/clang/include/clang/Driver/Options.td (revision 8a334af417ff2ef49e0bc74f9421b4f3aa479805)
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.
14include "llvm/Option/OptParser.td"
15
16// When generating documentation, we expect there to be a GlobalDocumentation
17// def containing the program name that we are generating documentation for.
18// This object should only be used by things that are used in documentation,
19// such as the group descriptions.
20#ifndef GENERATING_DOCS
21// So that this file can still be parsed without such a def, define one if there
22// isn't one provided.
23def GlobalDocumentation {
24  // Sensible default in case of mistakes.
25  string Program = "Clang";
26}
27#endif
28
29// Use this to generate program specific documentation, for example:
30// StringForProgram<"Control how %Program behaves.">.str
31class StringForProgram<string _str> {
32  string str = !subst("%Program", GlobalDocumentation.Program, _str);
33}
34
35/////////
36// Flags
37
38// The option is a "driver"-only option, and should not be forwarded to other
39// tools via `-Xarch` options.
40def NoXarchOption : OptionFlag;
41
42// LinkerInput - The option is a linker input.
43def LinkerInput : OptionFlag;
44
45// NoArgumentUnused - Don't report argument unused warnings for this option; this
46// is useful for options like -static or -dynamic which a user may always end up
47// passing, even if the platform defaults to (or only supports) that option.
48def NoArgumentUnused : OptionFlag;
49
50// Unsupported - The option is unsupported, and the driver will reject command
51// lines that use it.
52def Unsupported : OptionFlag;
53
54// Ignored - The option is unsupported, and the driver will silently ignore it.
55def Ignored : OptionFlag;
56
57// If an option affects linking, but has a primary group (so Link_Group cannot
58// be used), add this flag.
59def LinkOption : OptionFlag;
60
61// This is a target-specific option for compilation. Using it on an unsupported
62// target will lead to an err_drv_unsupported_opt_for_target error.
63def TargetSpecific : OptionFlag;
64
65// Indicates that this warning is ignored, but accepted with a warning for
66// GCC compatibility.
67class IgnoredGCCCompat : Flags<[HelpHidden]> {}
68
69class TargetSpecific : Flags<[TargetSpecific]> {}
70
71/////////
72// Visibility
73
74// We prefer the name "ClangOption" here rather than "Default" to make
75// it clear that these options will be visible in the clang driver (as
76// opposed to clang -cc1, the CL driver, or the flang driver).
77defvar ClangOption = DefaultVis;
78
79// CLOption - This is a cl.exe compatibility option. Options with this flag
80// are made available when the driver is running in CL compatibility mode.
81def CLOption : OptionVisibility;
82
83// CC1Option - This option should be accepted by clang -cc1.
84def CC1Option : OptionVisibility;
85
86// CC1AsOption - This option should be accepted by clang -cc1as.
87def CC1AsOption : OptionVisibility;
88
89// FlangOption - This is considered a "core" Flang option, available in
90// flang mode.
91def FlangOption : OptionVisibility;
92
93// FC1Option - This option should be accepted by flang -fc1.
94def FC1Option : OptionVisibility;
95
96// DXCOption - This is a dxc.exe compatibility option. Options with this flag
97// are made available when the driver is running in DXC compatibility mode.
98def DXCOption : OptionVisibility;
99
100/////////
101// Docs
102
103// A short name to show in documentation. The name will be interpreted as rST.
104class DocName<string name> { string DocName = name; }
105
106// A brief description to show in documentation, interpreted as rST.
107class DocBrief<code descr> { code DocBrief = descr; }
108
109// Indicates that this group should be flattened into its parent when generating
110// documentation.
111class DocFlatten { bit DocFlatten = 1; }
112
113/////////
114// Groups
115
116def Action_Group : OptionGroup<"<action group>">, DocName<"Actions">,
117                   DocBrief<[{The action to perform on the input.}]>;
118
119// Meta-group for options which are only used for compilation,
120// and not linking etc.
121def CompileOnly_Group : OptionGroup<"<CompileOnly group>">,
122                        DocName<"Compilation options">,
123                        DocBrief<StringForProgram<[{
124Flags controlling the behavior of %Program during compilation. These flags have
125no effect during actions that do not perform compilation.}]>.str>;
126
127def Preprocessor_Group : OptionGroup<"<Preprocessor group>">,
128                         Group<CompileOnly_Group>,
129                         DocName<"Preprocessor options">,
130                         DocBrief<StringForProgram<[{
131Flags controlling the behavior of the %Program preprocessor.}]>.str>;
132
133def IncludePath_Group : OptionGroup<"<I/i group>">, Group<Preprocessor_Group>,
134                        DocName<"Include path management">,
135                        DocBrief<[{
136Flags controlling how ``#include``\s are resolved to files.}]>;
137
138def I_Group : OptionGroup<"<I group>">, Group<IncludePath_Group>, DocFlatten;
139def i_Group : OptionGroup<"<i group>">, Group<IncludePath_Group>, DocFlatten;
140def clang_i_Group : OptionGroup<"<clang i group>">, Group<i_Group>, DocFlatten;
141
142def M_Group : OptionGroup<"<M group>">, Group<Preprocessor_Group>,
143              DocName<"Dependency file generation">, DocBrief<[{
144Flags controlling generation of a dependency file for ``make``-like build
145systems.}]>;
146
147def d_Group : OptionGroup<"<d group>">, Group<Preprocessor_Group>,
148              DocName<"Dumping preprocessor state">, DocBrief<[{
149Flags allowing the state of the preprocessor to be dumped in various ways.}]>;
150
151def Diag_Group : OptionGroup<"<W/R group>">, Group<CompileOnly_Group>,
152                 DocName<"Diagnostic options">,
153                 DocBrief<!strconcat(StringForProgram<
154"Flags controlling which warnings, errors, and remarks %Program will generate. ">.str,
155                  // When in clang link directly to the page.
156                  !cond(!eq(GlobalDocumentation.Program, "Clang"):
157"See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.",
158                  // When elsewhere the link will not work.
159                  true:
160"See Clang's Diagnostic Reference for a full list of warning and remark flags."))>;
161
162def R_Group : OptionGroup<"<R group>">, Group<Diag_Group>, DocFlatten;
163def R_value_Group : OptionGroup<"<R (with value) group>">, Group<R_Group>,
164                    DocFlatten;
165def W_Group : OptionGroup<"<W group>">, Group<Diag_Group>, DocFlatten;
166def W_value_Group : OptionGroup<"<W (with value) group>">, Group<W_Group>,
167                    DocFlatten;
168
169def f_Group : OptionGroup<"<f group>">, Group<CompileOnly_Group>,
170              DocName<"Target-independent compilation options">;
171
172def f_clang_Group : OptionGroup<"<f (clang-only) group>">,
173                    Group<CompileOnly_Group>, DocFlatten;
174def pedantic_Group : OptionGroup<"<pedantic group>">, Group<f_Group>,
175                     DocFlatten;
176
177def offload_Group : OptionGroup<"<offload group>">, Group<f_Group>,
178                   DocName<"Common Offloading options">,
179                   Visibility<[ClangOption, CLOption]>;
180
181def opencl_Group : OptionGroup<"<opencl group>">, Group<f_Group>,
182                   DocName<"OpenCL options">;
183
184def sycl_Group : OptionGroup<"<SYCL group>">, Group<f_Group>,
185                 DocName<"SYCL options">,
186                 Visibility<[ClangOption, CLOption]>;
187
188def cuda_Group : OptionGroup<"<CUDA group>">, Group<f_Group>,
189                   DocName<"CUDA options">,
190                   Visibility<[ClangOption, CLOption]>;
191
192def hip_Group : OptionGroup<"<HIP group>">, Group<f_Group>,
193                   DocName<"HIP options">,
194                   Visibility<[ClangOption, CLOption]>;
195
196def m_Group : OptionGroup<"<m group>">, Group<CompileOnly_Group>,
197              DocName<"Target-dependent compilation options">,
198              Visibility<[ClangOption, CLOption]>;
199
200def hlsl_Group : OptionGroup<"<HLSL group>">, Group<f_Group>,
201                   DocName<"HLSL options">,
202                   Visibility<[ClangOption]>;
203
204// Feature groups - these take command line options that correspond directly to
205// target specific features and can be translated directly from command line
206// options.
207def m_aarch64_Features_Group : OptionGroup<"<aarch64 features group>">,
208                               Group<m_Group>, DocName<"AARCH64">;
209def m_amdgpu_Features_Group : OptionGroup<"<amdgpu features group>">,
210                              Group<m_Group>, DocName<"AMDGPU">;
211def m_arm_Features_Group : OptionGroup<"<arm features group>">,
212                           Group<m_Group>, DocName<"ARM">;
213def m_hexagon_Features_Group : OptionGroup<"<hexagon features group>">,
214                               Group<m_Group>, DocName<"Hexagon">;
215def m_sparc_Features_Group : OptionGroup<"<sparc features group>">,
216                               Group<m_Group>, DocName<"SPARC">;
217// The features added by this group will not be added to target features.
218// These are explicitly handled.
219def m_hexagon_Features_HVX_Group : OptionGroup<"<hexagon features group>">,
220                                   Group<m_Group>, DocName<"Hexagon">;
221def m_m68k_Features_Group: OptionGroup<"<m68k features group>">,
222                           Group<m_Group>, DocName<"M68k">;
223def m_mips_Features_Group : OptionGroup<"<mips features group>">,
224                            Group<m_Group>, DocName<"MIPS">;
225def m_ppc_Features_Group : OptionGroup<"<ppc features group>">,
226                           Group<m_Group>, DocName<"PowerPC">;
227def m_wasm_Features_Group : OptionGroup<"<wasm features group>">,
228                            Group<m_Group>, DocName<"WebAssembly">;
229// The features added by this group will not be added to target features.
230// These are explicitly handled.
231def m_wasm_Features_Driver_Group : OptionGroup<"<wasm driver features group>">,
232                                   Group<m_Group>, DocName<"WebAssembly Driver">;
233def m_x86_Features_Group : OptionGroup<"<x86 features group>">,
234                           Group<m_Group>, Visibility<[ClangOption, CLOption]>,
235                           DocName<"X86">;
236def m_x86_AVX10_Features_Group : OptionGroup<"<x86 AVX10 features group>">,
237                                 Group<m_Group>, Visibility<[ClangOption, CLOption]>,
238                                 DocName<"X86 AVX10">;
239def m_riscv_Features_Group : OptionGroup<"<riscv features group>">,
240                             Group<m_Group>, DocName<"RISC-V">;
241def m_ve_Features_Group : OptionGroup<"<ve features group>">,
242                          Group<m_Group>, DocName<"VE">;
243def m_loongarch_Features_Group : OptionGroup<"<loongarch features group>">,
244                                 Group<m_Group>, DocName<"LoongArch">,
245                                 Visibility<[ClangOption, CLOption, FlangOption]>;
246
247def m_libc_Group : OptionGroup<"<m libc group>">, Group<m_mips_Features_Group>,
248                   Flags<[HelpHidden]>;
249
250def O_Group : OptionGroup<"<O group>">, Group<CompileOnly_Group>,
251              DocName<"Optimization level">, DocBrief<[{
252Flags controlling how much optimization should be performed.}]>;
253
254def DebugInfo_Group : OptionGroup<"<g group>">, Group<CompileOnly_Group>,
255                      DocName<"Debug information generation">, DocBrief<[{
256Flags controlling how much and what kind of debug information should be
257generated.}]>;
258
259def g_Group : OptionGroup<"<g group>">, Group<DebugInfo_Group>,
260              DocName<"Kind and level of debug information">;
261def gN_Group : OptionGroup<"<gN group>">, Group<g_Group>,
262               DocName<"Debug level">;
263def ggdbN_Group : OptionGroup<"<ggdbN group>">, Group<gN_Group>, DocFlatten;
264def gTune_Group : OptionGroup<"<gTune group>">, Group<g_Group>,
265                  DocName<"Debugger to tune debug information for">;
266def g_flags_Group : OptionGroup<"<g flags group>">, Group<DebugInfo_Group>,
267                    DocName<"Debug information options">;
268
269def StaticAnalyzer_Group : OptionGroup<"<Static analyzer group>">,
270                           DocName<"Static analyzer options">, DocBrief<[{
271Flags controlling the behavior of the Clang Static Analyzer.}]>;
272
273// gfortran options that we recognize in the driver and pass along when
274// invoking GCC to compile Fortran code.
275def gfortran_Group : OptionGroup<"<gfortran group>">,
276                     DocName<"Fortran compilation options">, DocBrief<[{
277Flags that will be passed onto the ``gfortran`` compiler when Clang is given
278a Fortran input.}]>;
279
280def Link_Group : OptionGroup<"<T/e/s/t/u group>">, DocName<"Linker options">,
281                 DocBrief<[{Flags that are passed on to the linker}]>;
282def T_Group : OptionGroup<"<T group>">, Group<Link_Group>, DocFlatten;
283def u_Group : OptionGroup<"<u group>">, Group<Link_Group>, DocFlatten;
284
285def reserved_lib_Group : OptionGroup<"<reserved libs group>">,
286                         Flags<[Unsupported]>;
287
288// Temporary groups for clang options which we know we don't support,
289// but don't want to verbosely warn the user about.
290def clang_ignored_f_Group : OptionGroup<"<clang ignored f group>">,
291  Group<f_Group>, Flags<[Ignored]>;
292def clang_ignored_m_Group : OptionGroup<"<clang ignored m group>">,
293  Group<m_Group>, Flags<[Ignored]>;
294
295// Unsupported flang groups
296def flang_ignored_w_Group : OptionGroup<"<flang ignored W group>">,
297  Group<W_Group>, Flags<[Ignored]>, Visibility<[FlangOption]>;
298
299// Group for clang options in the process of deprecation.
300// Please include the version that deprecated the flag as comment to allow
301// easier garbage collection.
302def clang_ignored_legacy_options_Group : OptionGroup<"<clang legacy flags>">,
303  Group<f_Group>, Flags<[Ignored]>;
304
305def LongDouble_Group : OptionGroup<"<LongDouble group>">, Group<m_Group>,
306  DocName<"Long double options">,
307  DocBrief<[{Selects the long double implementation}]>;
308
309// Retired with clang-5.0
310def : Flag<["-"], "fslp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;
311def : Flag<["-"], "fno-slp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;
312
313// Retired with clang-10.0. Previously controlled X86 MPX ISA.
314def mmpx : Flag<["-"], "mmpx">, Group<clang_ignored_legacy_options_Group>;
315def mno_mpx : Flag<["-"], "mno-mpx">, Group<clang_ignored_legacy_options_Group>;
316
317// Group that ignores all gcc optimizations that won't be implemented
318def clang_ignored_gcc_optimization_f_Group : OptionGroup<
319  "<clang_ignored_gcc_optimization_f_Group>">, Group<f_Group>, Flags<[Ignored]>;
320
321class DiagnosticOpts<string base>
322  : KeyPathAndMacro<"DiagnosticOpts->", base, "DIAG_"> {}
323class LangOpts<string base>
324  : KeyPathAndMacro<"LangOpts->", base, "LANG_"> {}
325class TargetOpts<string base>
326  : KeyPathAndMacro<"TargetOpts->", base, "TARGET_"> {}
327class FrontendOpts<string base>
328  : KeyPathAndMacro<"FrontendOpts.", base, "FRONTEND_"> {}
329class PreprocessorOutputOpts<string base>
330  : KeyPathAndMacro<"PreprocessorOutputOpts.", base, "PREPROCESSOR_OUTPUT_"> {}
331class DependencyOutputOpts<string base>
332  : KeyPathAndMacro<"DependencyOutputOpts.", base, "DEPENDENCY_OUTPUT_"> {}
333class CodeGenOpts<string base>
334  : KeyPathAndMacro<"CodeGenOpts.", base, "CODEGEN_"> {}
335class HeaderSearchOpts<string base>
336  : KeyPathAndMacro<"HeaderSearchOpts->", base, "HEADER_SEARCH_"> {}
337class PreprocessorOpts<string base>
338  : KeyPathAndMacro<"PreprocessorOpts->", base, "PREPROCESSOR_"> {}
339class FileSystemOpts<string base>
340  : KeyPathAndMacro<"FileSystemOpts.", base, "FILE_SYSTEM_"> {}
341class AnalyzerOpts<string base>
342  : KeyPathAndMacro<"AnalyzerOpts->", base, "ANALYZER_"> {}
343class MigratorOpts<string base>
344  : KeyPathAndMacro<"MigratorOpts.", base, "MIGRATOR_"> {}
345
346// A boolean option which is opt-in in CC1. The positive option exists in CC1 and
347// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
348// This is useful if the option is usually disabled.
349// Use this only when the option cannot be declared via BoolFOption.
350multiclass OptInCC1FFlag<string name, string pos_prefix, string neg_prefix="",
351                         string help="",
352                         list<OptionVisibility> vis=[ClangOption]> {
353  def f#NAME : Flag<["-"], "f"#name>, Visibility<[CC1Option] # vis>,
354               Group<f_Group>, HelpText<pos_prefix # help>;
355  def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<vis>,
356                  Group<f_Group>, HelpText<neg_prefix # help>;
357}
358
359// A boolean option which is opt-out in CC1. The negative option exists in CC1 and
360// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
361// Use this only when the option cannot be declared via BoolFOption.
362multiclass OptOutCC1FFlag<string name, string pos_prefix, string neg_prefix,
363                          string help="",
364                          list<OptionVisibility> vis=[ClangOption]> {
365  def f#NAME : Flag<["-"], "f"#name>, Visibility<vis>,
366               Group<f_Group>, HelpText<pos_prefix # help>;
367  def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<[CC1Option] # vis>,
368                  Group<f_Group>, HelpText<neg_prefix # help>;
369}
370
371// A boolean option which is opt-in in FC1. The positive option exists in FC1 and
372// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
373// This is useful if the option is usually disabled.
374multiclass OptInFC1FFlag<string name, string pos_prefix, string neg_prefix="",
375                         string help="",
376                         list<OptionVisibility> vis=[ClangOption]> {
377  def f#NAME : Flag<["-"], "f"#name>, Visibility<[FC1Option] # vis>,
378               Group<f_Group>, HelpText<pos_prefix # help>;
379  def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<vis>,
380                  Group<f_Group>, HelpText<neg_prefix # help>;
381}
382
383// A boolean option which is opt-out in FC1. The negative option exists in FC1 and
384// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
385multiclass OptOutFC1FFlag<string name, string pos_prefix, string neg_prefix,
386                          string help="",
387                          list<OptionVisibility> vis=[ClangOption]> {
388  def f#NAME : Flag<["-"], "f"#name>, Visibility<vis>,
389               Group<f_Group>, HelpText<pos_prefix # help>;
390  def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<[FC1Option] # vis>,
391                  Group<f_Group>, HelpText<neg_prefix # help>;
392}
393
394// Creates a positive and negative flags where both of them are prefixed with
395// "m", have help text specified for positive and negative option, and a Group
396// optionally specified by the opt_group argument, otherwise Group<m_Group>.
397multiclass SimpleMFlag<string name, string pos_prefix, string neg_prefix,
398                       string help, OptionGroup opt_group = m_Group> {
399  def m#NAME : Flag<["-"], "m"#name>, Group<opt_group>,
400    HelpText<pos_prefix # help>;
401  def mno_#NAME : Flag<["-"], "mno-"#name>, Group<opt_group>,
402    HelpText<neg_prefix # help>;
403}
404
405//===----------------------------------------------------------------------===//
406// BoolOption
407//===----------------------------------------------------------------------===//
408
409// The default value of a marshalled key path.
410class Default<code value> { code Value = value; }
411
412// Convenience variables for boolean defaults.
413def DefaultTrue : Default<"true"> {}
414def DefaultFalse : Default<"false"> {}
415
416// The value set to the key path when the flag is present on the command line.
417class Set<bit value> { bit Value = value; }
418def SetTrue : Set<true> {}
419def SetFalse : Set<false> {}
420
421// Definition of single command line flag. This is an implementation detail, use
422// SetTrueBy or SetFalseBy instead.
423class FlagDef<bit polarity, bit value,
424              list<OptionFlag> option_flags, list<OptionVisibility> option_vis,
425              string help, list<code> implied_by_expressions = []> {
426  // The polarity. Besides spelling, this also decides whether the TableGen
427  // record will be prefixed with "no_".
428  bit Polarity = polarity;
429
430  // The value assigned to key path when the flag is present on command line.
431  bit Value = value;
432
433  // OptionFlags in different tools.
434  list<OptionFlag> OptionFlags = option_flags;
435
436  // OptionVisibility flags for different tools.
437  list<OptionVisibility> OptionVisibility = option_vis;
438
439  // The help text associated with the flag.
440  string Help = help;
441
442  // List of expressions that, when true, imply this flag.
443  list<code> ImpliedBy = implied_by_expressions;
444}
445
446// Additional information to be appended to both positive and negative flag.
447class BothFlags<list<OptionFlag> option_flags,
448                list<OptionVisibility> option_vis = [ClangOption],
449                string help = ""> {
450  list<OptionFlag> OptionFlags = option_flags;
451  list<OptionVisibility> OptionVisibility = option_vis;
452  string Help = help;
453}
454
455// Functor that appends the suffix to the base flag definition.
456class ApplySuffix<FlagDef flag, BothFlags suffix> {
457  FlagDef Result
458    = FlagDef<flag.Polarity, flag.Value,
459              flag.OptionFlags # suffix.OptionFlags,
460              flag.OptionVisibility # suffix.OptionVisibility,
461              flag.Help # suffix.Help, flag.ImpliedBy>;
462}
463
464// Definition of the command line flag with positive spelling, e.g. "-ffoo".
465class PosFlag<Set value,
466              list<OptionFlag> flags = [], list<OptionVisibility> vis = [],
467              string help = "", list<code> implied_by_expressions = []>
468  : FlagDef<true, value.Value, flags, vis, help, implied_by_expressions> {}
469
470// Definition of the command line flag with negative spelling, e.g. "-fno-foo".
471class NegFlag<Set value,
472              list<OptionFlag> flags = [], list<OptionVisibility> vis = [],
473              string help = "", list<code> implied_by_expressions = []>
474  : FlagDef<false, value.Value, flags, vis, help, implied_by_expressions> {}
475
476// Expanded FlagDef that's convenient for creation of TableGen records.
477class FlagDefExpanded<FlagDef flag, string prefix, string name, string spelling>
478  : FlagDef<flag.Polarity, flag.Value, flag.OptionFlags, flag.OptionVisibility,
479            flag.Help, flag.ImpliedBy> {
480  // Name of the TableGen record.
481  string RecordName = prefix # !if(flag.Polarity, "", "no_") # name;
482
483  // Spelling of the flag.
484  string Spelling = prefix # !if(flag.Polarity, "", "no-") # spelling;
485
486  // Can the flag be implied by another flag?
487  bit CanBeImplied = !not(!empty(flag.ImpliedBy));
488
489  // C++ code that will be assigned to the keypath when the flag is present.
490  code ValueAsCode = !if(flag.Value, "true", "false");
491}
492
493// TableGen record for a single marshalled flag.
494class MarshalledFlagRec<FlagDefExpanded flag, FlagDefExpanded other,
495                        FlagDefExpanded implied, KeyPathAndMacro kpm,
496                        Default default>
497  : Flag<["-"], flag.Spelling>, Flags<flag.OptionFlags>,
498    Visibility<flag.OptionVisibility>, HelpText<flag.Help>,
499    MarshallingInfoBooleanFlag<kpm, default.Value, flag.ValueAsCode,
500                               other.ValueAsCode, other.RecordName>,
501    ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode> {}
502
503// Generates TableGen records for two command line flags that control the same
504// key path via the marshalling infrastructure.
505// Names of the records consist of the specified prefix, "no_" for the negative
506// flag, and NAME.
507// Used for -cc1 frontend options. Driver-only options do not map to
508// CompilerInvocation.
509multiclass BoolOption<string prefix = "", string spelling_base,
510                      KeyPathAndMacro kpm, Default default,
511                      FlagDef flag1_base, FlagDef flag2_base,
512                      BothFlags suffix = BothFlags<[]>> {
513  defvar flag1 = FlagDefExpanded<ApplySuffix<flag1_base, suffix>.Result, prefix,
514                                 NAME, spelling_base>;
515
516  defvar flag2 = FlagDefExpanded<ApplySuffix<flag2_base, suffix>.Result, prefix,
517                                 NAME, spelling_base>;
518
519  // The flags must have different polarity, different values, and only
520  // one can be implied.
521  assert !xor(flag1.Polarity, flag2.Polarity),
522         "the flags must have different polarity: flag1: " #
523             flag1.Polarity # ", flag2: " # flag2.Polarity;
524  assert !ne(flag1.Value, flag2.Value),
525         "the flags must have different values: flag1: " #
526             flag1.Value # ", flag2: " # flag2.Value;
527  assert !not(!and(flag1.CanBeImplied, flag2.CanBeImplied)),
528         "only one of the flags can be implied: flag1: " #
529             flag1.CanBeImplied # ", flag2: " # flag2.CanBeImplied;
530
531  defvar implied = !if(flag1.CanBeImplied, flag1, flag2);
532
533  def flag1.RecordName : MarshalledFlagRec<flag1, flag2, implied, kpm, default>;
534  def flag2.RecordName : MarshalledFlagRec<flag2, flag1, implied, kpm, default>;
535}
536
537/// Creates a BoolOption where both of the flags are prefixed with "f", are in
538/// the Group<f_Group>.
539/// Used for -cc1 frontend options. Driver-only options do not map to
540/// CompilerInvocation.
541multiclass BoolFOption<string flag_base, KeyPathAndMacro kpm,
542                       Default default, FlagDef flag1, FlagDef flag2,
543                       BothFlags both = BothFlags<[]>> {
544  defm NAME : BoolOption<"f", flag_base, kpm, default, flag1, flag2, both>,
545              Group<f_Group>;
546}
547
548// Creates a BoolOption where both of the flags are prefixed with "g" and have
549// the Group<g_Group>.
550// Used for -cc1 frontend options. Driver-only options do not map to
551// CompilerInvocation.
552multiclass BoolGOption<string flag_base, KeyPathAndMacro kpm,
553                       Default default, FlagDef flag1, FlagDef flag2,
554                       BothFlags both = BothFlags<[]>> {
555  defm NAME : BoolOption<"g", flag_base, kpm, default, flag1, flag2, both>,
556              Group<g_Group>;
557}
558
559multiclass BoolMOption<string flag_base, KeyPathAndMacro kpm,
560                       Default default, FlagDef flag1, FlagDef flag2,
561                       BothFlags both = BothFlags<[]>> {
562  defm NAME : BoolOption<"m", flag_base, kpm, default, flag1, flag2, both>,
563              Group<m_Group>;
564}
565
566/// Creates a BoolOption where both of the flags are prefixed with "W", are in
567/// the Group<W_Group>.
568/// Used for -cc1 frontend options. Driver-only options do not map to
569/// CompilerInvocation.
570multiclass BoolWOption<string flag_base, KeyPathAndMacro kpm,
571                       Default default, FlagDef flag1, FlagDef flag2,
572                       BothFlags both = BothFlags<[]>> {
573  defm NAME : BoolOption<"W", flag_base, kpm, default, flag1, flag2, both>,
574              Group<W_Group>;
575}
576
577// Works like BoolOption except without marshalling
578multiclass BoolOptionWithoutMarshalling<string prefix = "", string spelling_base,
579                                        FlagDef flag1_base, FlagDef flag2_base,
580                                        BothFlags suffix = BothFlags<[]>> {
581  defvar flag1 = FlagDefExpanded<ApplySuffix<flag1_base, suffix>.Result, prefix,
582                                 NAME, spelling_base>;
583
584  defvar flag2 = FlagDefExpanded<ApplySuffix<flag2_base, suffix>.Result, prefix,
585                                 NAME, spelling_base>;
586
587  // The flags must have different polarity, different values, and only
588  // one can be implied.
589  assert !xor(flag1.Polarity, flag2.Polarity),
590         "the flags must have different polarity: flag1: " #
591             flag1.Polarity # ", flag2: " # flag2.Polarity;
592  assert !ne(flag1.Value, flag2.Value),
593         "the flags must have different values: flag1: " #
594             flag1.Value # ", flag2: " # flag2.Value;
595  assert !not(!and(flag1.CanBeImplied, flag2.CanBeImplied)),
596         "only one of the flags can be implied: flag1: " #
597             flag1.CanBeImplied # ", flag2: " # flag2.CanBeImplied;
598
599  defvar implied = !if(flag1.CanBeImplied, flag1, flag2);
600
601  def flag1.RecordName : Flag<["-"], flag1.Spelling>, Flags<flag1.OptionFlags>,
602                         Visibility<flag1.OptionVisibility>,
603                         HelpText<flag1.Help>,
604                         ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode>
605                         {}
606  def flag2.RecordName : Flag<["-"], flag2.Spelling>, Flags<flag2.OptionFlags>,
607                         Visibility<flag2.OptionVisibility>,
608                         HelpText<flag2.Help>,
609                         ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode>
610                         {}
611}
612
613// FIXME: Diagnose if target does not support protected visibility.
614class MarshallingInfoVisibility<KeyPathAndMacro kpm, code default>
615  : MarshallingInfoEnum<kpm, default>,
616    Values<"default,hidden,internal,protected">,
617    NormalizedValues<["DefaultVisibility", "HiddenVisibility",
618                      "HiddenVisibility", "ProtectedVisibility"]> {}
619
620// Key paths that are constant during parsing of options with the same key path prefix.
621defvar cplusplus = LangOpts<"CPlusPlus">;
622defvar cpp11 = LangOpts<"CPlusPlus11">;
623defvar cpp14 = LangOpts<"CPlusPlus14">;
624defvar cpp17 = LangOpts<"CPlusPlus17">;
625defvar cpp20 = LangOpts<"CPlusPlus20">;
626defvar cpp23 = LangOpts<"CPlusPlus23">;
627defvar c99 = LangOpts<"C99">;
628defvar c23 = LangOpts<"C23">;
629defvar lang_std = LangOpts<"LangStd">;
630defvar open_cl = LangOpts<"OpenCL">;
631defvar cuda = LangOpts<"CUDA">;
632defvar hip = LangOpts<"HIP">;
633defvar gnu_mode = LangOpts<"GNUMode">;
634defvar asm_preprocessor = LangOpts<"AsmPreprocessor">;
635defvar hlsl = LangOpts<"HLSL">;
636
637defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")");
638
639/////////
640// Options
641
642// The internal option ID must be a valid C++ identifier and results in a
643// clang::driver::options::OPT_XX enum constant for XX.
644//
645// We want to unambiguously be able to refer to options from the driver source
646// code, for this reason the option name is mangled into an ID. This mangling
647// isn't guaranteed to have an inverse, but for practical purposes it does.
648//
649// The mangling scheme is to ignore the leading '-', and perform the following
650// substitutions:
651//   _ => __
652//   - => _
653//   / => _SLASH
654//   # => _HASH
655//   ? => _QUESTION
656//   , => _COMMA
657//   = => _EQ
658//   C++ => CXX
659//   . => _
660
661// Developer Driver Options
662
663def internal_Group : OptionGroup<"<clang internal options>">,
664  Flags<[HelpHidden]>;
665def internal_driver_Group : OptionGroup<"<clang driver internal options>">,
666  Group<internal_Group>, HelpText<"DRIVER OPTIONS">;
667def internal_debug_Group :
668  OptionGroup<"<clang debug/development internal options>">,
669  Group<internal_Group>, HelpText<"DEBUG/DEVELOPMENT OPTIONS">;
670
671class InternalDriverOpt : Group<internal_driver_Group>,
672  Flags<[NoXarchOption, HelpHidden]>;
673def driver_mode : Joined<["--"], "driver-mode=">, Group<internal_driver_Group>,
674  Flags<[NoXarchOption, HelpHidden]>,
675  Visibility<[ClangOption, FlangOption, CLOption, DXCOption]>,
676  HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', 'cl' or 'flang'">;
677def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group<internal_driver_Group>,
678  Flags<[NoXarchOption, HelpHidden]>,
679  Visibility<[ClangOption, CLOption, DXCOption]>,
680  HelpText<"Set the rsp quoting to either 'posix', or 'windows'">;
681def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, InternalDriverOpt,
682  HelpText<"Name for native GCC compiler">,
683  MetaVarName<"<gcc-path>">;
684
685class InternalDebugOpt : Group<internal_debug_Group>,
686  Flags<[NoXarchOption, HelpHidden]>,
687  Visibility<[ClangOption, CLOption, DXCOption]>;
688def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt,
689  HelpText<"Simulate installation in the given directory">;
690def ccc_print_phases : Flag<["-"], "ccc-print-phases">,
691  Flags<[NoXarchOption, HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption,
692  FlangOption]>,
693  HelpText<"Dump list of actions to perform">;
694def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, InternalDebugOpt,
695  HelpText<"Show bindings of tools to actions">;
696
697def ccc_arcmt_check : Flag<["-"], "ccc-arcmt-check">, InternalDriverOpt,
698  HelpText<"Check for ARC migration issues that need manual handling">;
699def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, InternalDriverOpt,
700  HelpText<"Apply modifications to files to conform to ARC">;
701def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt,
702  HelpText<"Apply modifications and produces temporary files that conform to ARC">;
703def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">,
704  HelpText<"Output path for the plist report">,
705  Visibility<[ClangOption, CC1Option]>,
706  MarshallingInfoString<FrontendOpts<"ARCMTMigrateReportOut">>;
707def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">,
708  HelpText<"Emit ARC errors even if the migrator can fix them">,
709  Visibility<[ClangOption, CC1Option]>,
710  MarshallingInfoFlag<FrontendOpts<"ARCMTMigrateEmitARCErrors">>;
711def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">,
712  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
713  HelpText<"Emit reproducer on (option: off, crash (default), error, always)">;
714def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt,
715  Alias<gen_reproducer_eq>, AliasArgs<["always"]>,
716  HelpText<"Auto-generates preprocessed source files and a reproduction script">;
717def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt,
718  HelpText<"Emit a compilation database fragment to the specified directory">;
719
720def round_trip_args : Flag<["-"], "round-trip-args">, Visibility<[CC1Option]>,
721  HelpText<"Enable command line arguments round-trip.">;
722def no_round_trip_args : Flag<["-"], "no-round-trip-args">,
723  Visibility<[CC1Option]>,
724  HelpText<"Disable command line arguments round-trip.">;
725
726def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>,
727  HelpText<"Run the migrator">;
728def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">,
729  InternalDriverOpt,
730  HelpText<"Apply modifications and produces temporary files to migrate to "
731   "modern ObjC syntax">;
732
733def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">,
734  Visibility<[ClangOption, CC1Option]>,
735  HelpText<"Enable migration to modern ObjC literals">,
736  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Literals">;
737def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">,
738  Visibility<[ClangOption, CC1Option]>,
739  HelpText<"Enable migration to modern ObjC subscripting">,
740  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Subscripting">;
741def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">,
742  Visibility<[ClangOption, CC1Option]>,
743  HelpText<"Enable migration to modern ObjC property">,
744  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Property">;
745def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">,
746  Visibility<[ClangOption, CC1Option]>,
747  HelpText<"Enable migration to modern ObjC">,
748  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_MigrateDecls">;
749def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">,
750  Visibility<[ClangOption, CC1Option]>,
751  HelpText<"Enable migration to modern ObjC readonly property">,
752  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadonlyProperty">;
753def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">,
754  Visibility<[ClangOption, CC1Option]>,
755  HelpText<"Enable migration to modern ObjC readwrite property">,
756  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadwriteProperty">;
757def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">,
758  Visibility<[ClangOption, CC1Option]>,
759  HelpText<"Enable migration of setter/getter messages to property-dot syntax">,
760  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_PropertyDotSyntax">;
761def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">,
762  Visibility<[ClangOption, CC1Option]>,
763  HelpText<"Enable migration to property and method annotations">,
764  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Annotation">;
765def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">,
766  Visibility<[ClangOption, CC1Option]>,
767  HelpText<"Enable migration to infer instancetype for method result type">,
768  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Instancetype">;
769def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">,
770  Visibility<[ClangOption, CC1Option]>,
771  HelpText<"Enable migration to NS_ENUM/NS_OPTIONS macros">,
772  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsMacros">;
773def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">,
774  Visibility<[ClangOption, CC1Option]>,
775  HelpText<"Enable migration to add protocol conformance on classes">,
776  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ProtocolConformance">;
777def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">,
778  Visibility<[ClangOption, CC1Option]>,
779  HelpText<"Make migration to 'atomic' properties">,
780  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_AtomicProperty">;
781def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">,
782  Visibility<[ClangOption, CC1Option]>,
783  HelpText<"Enable migration to annotate property with NS_RETURNS_INNER_POINTER">,
784  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReturnsInnerPointerProperty">;
785def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">,
786  Visibility<[ClangOption, CC1Option]>,
787  HelpText<"Enable migration to use NS_NONATOMIC_IOSONLY macro for setting property's 'atomic' attribute">,
788  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty">;
789def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">,
790  Visibility<[ClangOption, CC1Option]>,
791  HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">,
792  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_DesignatedInitializer">;
793
794def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">,
795  Visibility<[ClangOption, CC1Option]>,
796  HelpText<"Only modify files with a filename contained in the provided directory path">,
797  MarshallingInfoString<FrontendOpts<"ObjCMTAllowListPath">>;
798def : Joined<["-"], "objcmt-whitelist-dir-path=">,
799  Visibility<[ClangOption, CC1Option]>,
800  HelpText<"Alias for -objcmt-allowlist-dir-path">,
801  Alias<objcmt_allowlist_dir_path>;
802// The misspelt "white-list" [sic] alias is due for removal.
803def : Joined<["-"], "objcmt-white-list-dir-path=">,
804  Visibility<[ClangOption, CC1Option]>,
805  Alias<objcmt_allowlist_dir_path>;
806
807// Make sure all other -ccc- options are rejected.
808def ccc_ : Joined<["-"], "ccc-">, Group<internal_Group>, Flags<[Unsupported]>;
809
810// Standard Options
811
812def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption]>,
813  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
814    HelpText<"Print (but do not run) the commands to run for this compilation">;
815def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>,
816    Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
817def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>,
818  Group<gfortran_Group>;
819def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"<prefix>">,
820    Visibility<[ClangOption, FlangOption]>,
821    HelpText<"Search $prefix$file for executables, libraries, and data files. "
822    "If $prefix is a directory, search $prefix/$file">;
823def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">,
824  Visibility<[ClangOption, FlangOption]>,
825  HelpText<"Use GCC installation in the specified directory. The directory ends with path components like 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
826  "Note: executables (e.g. ld) used by the compiler are not overridden by the selected GCC installation">;
827def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>,
828  Visibility<[ClangOption, FlangOption]>,
829  HelpText<
830    "Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
831    "Clang will use the GCC installation with the largest version">,
832  HelpTextForVariants<[FlangOption],
833    "Specify a directory where Flang can find 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
834    "Flang will use the GCC installation with the largest version">;
835def gcc_triple_EQ : Joined<["--"], "gcc-triple=">,
836  HelpText<"Search for the GCC installation with the specified triple.">;
837def CC : Flag<["-"], "CC">, Visibility<[ClangOption, CC1Option]>,
838  Group<Preprocessor_Group>,
839    HelpText<"Include comments from within macros in preprocessed output">,
840    MarshallingInfoFlag<PreprocessorOutputOpts<"ShowMacroComments">>;
841def C : Flag<["-"], "C">, Visibility<[ClangOption, CC1Option]>,
842  Group<Preprocessor_Group>,
843    HelpText<"Include comments in preprocessed output">,
844    MarshallingInfoFlag<PreprocessorOutputOpts<"ShowComments">>;
845def D : JoinedOrSeparate<["-"], "D">, Group<Preprocessor_Group>,
846    Visibility<[ClangOption, CC1Option, FlangOption, FC1Option, DXCOption]>,
847    MetaVarName<"<macro>=<value>">,
848    HelpText<"Define <macro> to <value> (or 1 if <value> omitted)">;
849def E : Flag<["-"], "E">, Flags<[NoXarchOption]>,
850  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
851  Group<Action_Group>,
852    HelpText<"Only run the preprocessor">;
853def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined]>,
854  Visibility<[ClangOption, CC1Option]>,
855    HelpText<"Add directory to framework include search path">;
856def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption, TargetSpecific]>,
857  Group<m_Group>,
858    MetaVarName<"<size>">, HelpText<"Put objects of at most <size> bytes "
859    "into small data section (MIPS / Hexagon)">;
860def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>,
861  Group<m_Group>, Alias<G>;
862def H : Flag<["-"], "H">, Visibility<[ClangOption, CC1Option]>,
863  Group<Preprocessor_Group>,
864    HelpText<"Show header includes and nesting depth">,
865    MarshallingInfoFlag<DependencyOutputOpts<"ShowHeaderIncludes">>;
866def fshow_skipped_includes : Flag<["-"], "fshow-skipped-includes">,
867  Visibility<[ClangOption, CC1Option]>,
868  HelpText<"Show skipped includes in -H output.">,
869  DocBrief<[{#include files may be "skipped" due to include guard optimization
870             or #pragma once. This flag makes -H show also such includes.}]>,
871  MarshallingInfoFlag<DependencyOutputOpts<"ShowSkippedHeaderIncludes">>;
872
873def I_ : Flag<["-"], "I-">, Group<I_Group>,
874    HelpText<"Restrict all prior -I flags to double-quoted inclusion and "
875             "remove current directory from include path">;
876def I : JoinedOrSeparate<["-"], "I">, Group<I_Group>,
877    Visibility<[ClangOption, CC1Option, CC1AsOption, FlangOption, FC1Option]>,
878    MetaVarName<"<dir>">,
879    HelpText<"Add directory to the end of the list of include search paths">,
880    DocBrief<[{Add directory to include search path. For C++ inputs, if
881there are multiple -I options, these directories are searched
882in the order they are given before the standard system directories
883are searched. If the same directory is in the SYSTEM include search
884paths, for example if also specified with -isystem, the -I option
885will be ignored}]>;
886def L : JoinedOrSeparate<["-"], "L">, Flags<[RenderJoined]>, Group<Link_Group>,
887    Visibility<[ClangOption, FlangOption]>,
888    MetaVarName<"<dir>">, HelpText<"Add directory to library search path">;
889def embed_dir_EQ : Joined<["--"], "embed-dir=">, Group<Preprocessor_Group>,
890    Visibility<[ClangOption, CC1Option]>, MetaVarName<"<dir>">,
891    HelpText<"Add directory to embed search path">;
892def MD : Flag<["-"], "MD">, Group<M_Group>,
893    HelpText<"Write a depfile containing user and system headers">;
894def MMD : Flag<["-"], "MMD">, Group<M_Group>,
895    HelpText<"Write a depfile containing user headers">;
896def M : Flag<["-"], "M">, Group<M_Group>,
897    HelpText<"Like -MD, but also implies -E and writes to stdout by default">;
898def MM : Flag<["-"], "MM">, Group<M_Group>,
899    HelpText<"Like -MMD, but also implies -E and writes to stdout by default">;
900def MF : JoinedOrSeparate<["-"], "MF">, Group<M_Group>,
901    HelpText<"Write depfile output from -MMD, -MD, -MM, or -M to <file>">,
902    MetaVarName<"<file>">;
903def MG : Flag<["-"], "MG">, Group<M_Group>, Visibility<[ClangOption, CC1Option]>,
904    HelpText<"Add missing headers to depfile">,
905    MarshallingInfoFlag<DependencyOutputOpts<"AddMissingHeaderDeps">>;
906def MJ : JoinedOrSeparate<["-"], "MJ">, Group<M_Group>,
907    HelpText<"Write a compilation database entry per input">;
908def MP : Flag<["-"], "MP">, Group<M_Group>, Visibility<[ClangOption, CC1Option]>,
909    HelpText<"Create phony target for each dependency (other than main file)">,
910    MarshallingInfoFlag<DependencyOutputOpts<"UsePhonyTargets">>;
911def MQ : JoinedOrSeparate<["-"], "MQ">, Group<M_Group>,
912  Visibility<[ClangOption, CC1Option]>,
913    HelpText<"Specify name of main file output to quote in depfile">;
914def MT : JoinedOrSeparate<["-"], "MT">, Group<M_Group>,
915  Visibility<[ClangOption, CC1Option]>,
916    HelpText<"Specify name of main file output in depfile">,
917    MarshallingInfoStringVector<DependencyOutputOpts<"Targets">>;
918def MV : Flag<["-"], "MV">, Group<M_Group>, Visibility<[ClangOption, CC1Option]>,
919    HelpText<"Use NMake/Jom format for the depfile">,
920    MarshallingInfoFlag<DependencyOutputOpts<"OutputFormat">, "DependencyOutputFormat::Make">,
921    Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">;
922def Mach : Flag<["-"], "Mach">, Group<Link_Group>;
923def O0 : Flag<["-"], "O0">, Group<O_Group>, Flags<[HelpHidden]>,
924  Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>;
925def O4 : Flag<["-"], "O4">, Group<O_Group>, Flags<[HelpHidden]>,
926  Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>;
927def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>,
928  HelpText<"Treat source input files as Objective-C++ inputs">;
929def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>,
930  HelpText<"Treat source input files as Objective-C inputs">;
931def O : Joined<["-"], "O">, Group<O_Group>,
932  Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>;
933def O_flag : Flag<["-"], "O">, Visibility<[ClangOption, CC1Option, FC1Option]>,
934  Alias<O>, AliasArgs<["1"]>;
935def Ofast : Joined<["-"], "Ofast">, Group<O_Group>,
936  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
937  HelpTextForVariants<[FlangOption, FC1Option],
938    "Deprecated; use '-O3 -ffast-math -fstack-arrays' for the same behavior,"
939    " or '-O3 -fstack-arrays' to enable only conforming optimizations">,
940  HelpText<"Deprecated; use '-O3 -ffast-math' for the same behavior,"
941           " or '-O3' to enable only conforming optimizations">;
942def P : Flag<["-"], "P">,
943  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
944  Group<Preprocessor_Group>,
945  HelpText<"Disable linemarker output in -E mode">,
946  MarshallingInfoNegativeFlag<PreprocessorOutputOpts<"ShowLineMarkers">>;
947def Qy : Flag<["-"], "Qy">, Visibility<[ClangOption, CC1Option]>,
948  HelpText<"Emit metadata containing compiler name and version">;
949def Qn : Flag<["-"], "Qn">, Visibility<[ClangOption, CC1Option]>,
950  HelpText<"Do not emit metadata containing compiler name and version">;
951def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>,
952  Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>;
953def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>,
954  Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>;
955def Qunused_arguments : Flag<["-"], "Qunused-arguments">,
956  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
957  HelpText<"Don't emit warning for unused driver arguments">;
958def Q : Flag<["-"], "Q">, IgnoredGCCCompat;
959def S : Flag<["-"], "S">, Flags<[NoXarchOption]>,
960  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
961  Group<Action_Group>,
962  HelpText<"Only run preprocess and compilation steps">;
963def T : JoinedOrSeparate<["-"], "T">, Group<T_Group>,
964  MetaVarName<"<script>">, HelpText<"Specify <script> as linker script">;
965def U : JoinedOrSeparate<["-"], "U">, Group<Preprocessor_Group>,
966  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
967  MetaVarName<"<macro>">, HelpText<"Undefine macro <macro>">;
968def V : JoinedOrSeparate<["-"], "V">, Flags<[NoXarchOption, Unsupported]>;
969def Wa_COMMA : CommaJoined<["-"], "Wa,">,
970  HelpText<"Pass the comma separated arguments in <arg> to the assembler">,
971  MetaVarName<"<arg>">;
972def warning_suppression_mappings_EQ : Joined<["--"],
973  "warning-suppression-mappings=">, Group<Diag_Group>,
974  HelpText<"File containing diagnostic suppresion mappings. See user manual "
975  "for file format.">, Visibility<[ClangOption, CC1Option]>;
976def Wall : Flag<["-"], "Wall">, Group<W_Group>, Flags<[HelpHidden]>,
977  Visibility<[ClangOption, CC1Option, FlangOption]>;
978def WCL4 : Flag<["-"], "WCL4">, Group<W_Group>, Flags<[HelpHidden]>,
979  Visibility<[ClangOption, CC1Option]>;
980def Wsystem_headers : Flag<["-"], "Wsystem-headers">, Group<W_Group>,
981  Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
982def Wno_system_headers : Flag<["-"], "Wno-system-headers">, Group<W_Group>,
983  Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
984def Wsystem_headers_in_module_EQ : Joined<["-"], "Wsystem-headers-in-module=">,
985  Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
986  MetaVarName<"<module>">,
987  HelpText<"Enable -Wsystem-headers when building <module>">,
988  MarshallingInfoStringVector<DiagnosticOpts<"SystemHeaderWarningsModules">>;
989def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<W_Group>,
990  Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
991  HelpText<"Enable warnings for deprecated constructs and define __DEPRECATED">;
992def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>,
993  Visibility<[ClangOption, CC1Option]>;
994defm invalid_constexpr : BoolWOption<"invalid-constexpr",
995  LangOpts<"CheckConstexprFunctionBodies">,
996  Default<!strconcat("!", cpp23.KeyPath)>,
997  NegFlag<SetFalse, [HelpHidden], [ClangOption, CC1Option], "Disable">,
998  PosFlag<SetTrue, [HelpHidden], [ClangOption, CC1Option], "Enable">,
999  BothFlags<[], [ClangOption, CC1Option], " checking of constexpr function bodies for validity within a constant expression context">>;
1000def Wl_COMMA : CommaJoined<["-"], "Wl,">, Visibility<[ClangOption, FlangOption]>,
1001  Flags<[LinkerInput, RenderAsInput]>,
1002  HelpText<"Pass the comma separated arguments in <arg> to the linker">,
1003  MetaVarName<"<arg>">, Group<Link_Group>;
1004// FIXME: This is broken; these should not be Joined arguments.
1005def Wno_nonportable_cfstrings : Joined<["-"], "Wno-nonportable-cfstrings">, Group<W_Group>,
1006  Visibility<[ClangOption, CC1Option]>;
1007def Wnonportable_cfstrings : Joined<["-"], "Wnonportable-cfstrings">, Group<W_Group>,
1008  Visibility<[ClangOption, CC1Option]>;
1009def Wp_COMMA : CommaJoined<["-"], "Wp,">,
1010  HelpText<"Pass the comma separated arguments in <arg> to the preprocessor">,
1011  MetaVarName<"<arg>">, Group<Preprocessor_Group>;
1012def Wundef_prefix_EQ : CommaJoined<["-"], "Wundef-prefix=">, Group<W_value_Group>,
1013  Flags<[HelpHidden]>,
1014  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
1015  MetaVarName<"<arg>">,
1016  HelpText<"Enable warnings for undefined macros with a prefix in the comma separated list <arg>">,
1017  MarshallingInfoStringVector<DiagnosticOpts<"UndefPrefixes">>;
1018def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group<W_Group>,
1019  Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
1020def Wno_write_strings : Flag<["-"], "Wno-write-strings">, Group<W_Group>,
1021  Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
1022def Winvalid_gnu_asm_cast : Flag<["-"], "Winvalid-gnu-asm-cast">, Group<W_Group>,
1023  Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
1024def W_Joined : Joined<["-"], "W">, Group<W_Group>,
1025  Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FC1Option, FlangOption]>,
1026  MetaVarName<"<warning>">, HelpText<"Enable the specified warning">;
1027def Xanalyzer : Separate<["-"], "Xanalyzer">,
1028  HelpText<"Pass <arg> to the static analyzer">, MetaVarName<"<arg>">,
1029  Group<StaticAnalyzer_Group>;
1030def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[NoXarchOption]>;
1031def Xarch_host : Separate<["-"], "Xarch_host">, Flags<[NoXarchOption]>,
1032  HelpText<"Pass <arg> to the CUDA/HIP host compilation">, MetaVarName<"<arg>">;
1033def Xarch_device : Separate<["-"], "Xarch_device">, Flags<[NoXarchOption]>,
1034  HelpText<"Pass <arg> to the CUDA/HIP device compilation">, MetaVarName<"<arg>">;
1035def Xassembler : Separate<["-"], "Xassembler">,
1036  HelpText<"Pass <arg> to the assembler">, MetaVarName<"<arg>">,
1037  Group<CompileOnly_Group>;
1038def Xclang : Separate<["-"], "Xclang">,
1039  HelpText<"Pass <arg> to clang -cc1">, MetaVarName<"<arg>">,
1040  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
1041  Group<CompileOnly_Group>;
1042def : Joined<["-"], "Xclang=">, Group<CompileOnly_Group>,
1043  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
1044  Alias<Xclang>,
1045  HelpText<"Alias for -Xclang">, MetaVarName<"<arg>">;
1046def Xcuda_fatbinary : Separate<["-"], "Xcuda-fatbinary">,
1047  HelpText<"Pass <arg> to fatbinary invocation">, MetaVarName<"<arg>">;
1048def Xcuda_ptxas : Separate<["-"], "Xcuda-ptxas">,
1049  HelpText<"Pass <arg> to the ptxas assembler">, MetaVarName<"<arg>">,
1050  Visibility<[ClangOption, CLOption]>;
1051def Xopenmp_target : Separate<["-"], "Xopenmp-target">, Group<CompileOnly_Group>,
1052  HelpText<"Pass <arg> to the target offloading toolchain.">, MetaVarName<"<arg>">;
1053def Xopenmp_target_EQ : JoinedAndSeparate<["-"], "Xopenmp-target=">, Group<CompileOnly_Group>,
1054  HelpText<"Pass <arg> to the target offloading toolchain identified by <triple>.">,
1055  MetaVarName<"<triple> <arg>">;
1056def z : Separate<["-"], "z">, Flags<[LinkerInput]>,
1057  HelpText<"Pass -z <arg> to the linker">, MetaVarName<"<arg>">,
1058  Group<Link_Group>;
1059def offload_link : Flag<["--"], "offload-link">, Group<Link_Group>,
1060  HelpText<"Use the new offloading linker to perform the link job.">;
1061def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>,
1062  Visibility<[ClangOption, CLOption, FlangOption]>,
1063  HelpText<"Pass <arg> to the linker">, MetaVarName<"<arg>">,
1064  Group<Link_Group>;
1065def Xoffload_linker : JoinedAndSeparate<["-"], "Xoffload-linker">,
1066  Visibility<[ClangOption, FlangOption]>,
1067  HelpText<"Pass <arg> to the offload linkers or the ones identified by -<triple>">,
1068  MetaVarName<"<triple> <arg>">, Group<Link_Group>;
1069def Xpreprocessor : Separate<["-"], "Xpreprocessor">, Group<Preprocessor_Group>,
1070  HelpText<"Pass <arg> to the preprocessor">, MetaVarName<"<arg>">;
1071def X_Flag : Flag<["-"], "X">, Group<Link_Group>;
1072// Used by some macOS projects. IgnoredGCCCompat is a misnomer since GCC doesn't allow it.
1073def : Flag<["-"], "Xparser">, IgnoredGCCCompat;
1074// FIXME -Xcompiler is misused by some ChromeOS packages. Remove it after a while.
1075def : Flag<["-"], "Xcompiler">, IgnoredGCCCompat;
1076def Z_Flag : Flag<["-"], "Z">, Group<Link_Group>;
1077def all__load : Flag<["-"], "all_load">;
1078def allowable__client : Separate<["-"], "allowable_client">;
1079def ansi : Flag<["-", "--"], "ansi">, Group<CompileOnly_Group>;
1080def arch__errors__fatal : Flag<["-"], "arch_errors_fatal">;
1081def arch : Separate<["-"], "arch">, Flags<[NoXarchOption,TargetSpecific]>;
1082def arch__only : Separate<["-"], "arch_only">;
1083def autocomplete : Joined<["--"], "autocomplete=">;
1084def bind__at__load : Flag<["-"], "bind_at_load">;
1085def bundle__loader : Separate<["-"], "bundle_loader">;
1086def bundle : Flag<["-"], "bundle">;
1087def b : JoinedOrSeparate<["-"], "b">, Flags<[LinkerInput]>,
1088  HelpText<"Pass -b <arg> to the linker on AIX">, MetaVarName<"<arg>">,
1089  Group<Link_Group>;
1090
1091defm offload_uniform_block : BoolFOption<"offload-uniform-block",
1092  LangOpts<"OffloadUniformBlock">, Default<"LangOpts->CUDA">,
1093  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Assume">,
1094  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Don't assume">,
1095  BothFlags<[], [ClangOption], " that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)">>;
1096
1097def fcomplex_arithmetic_EQ : Joined<["-"], "fcomplex-arithmetic=">, Group<f_Group>,
1098  Visibility<[ClangOption, CC1Option]>,
1099  Values<"full,improved,promoted,basic">, NormalizedValuesScope<"LangOptions">,
1100  NormalizedValues<["CX_Full", "CX_Improved", "CX_Promoted", "CX_Basic"]>;
1101
1102def complex_range_EQ : Joined<["-"], "complex-range=">, Group<f_Group>,
1103  Visibility<[CC1Option]>,
1104  Values<"full,improved,promoted,basic">, NormalizedValuesScope<"LangOptions">,
1105  NormalizedValues<["CX_Full", "CX_Improved", "CX_Promoted", "CX_Basic"]>,
1106  MarshallingInfoEnum<LangOpts<"ComplexRange">, "CX_Full">;
1107
1108defm cx_limited_range: BoolOptionWithoutMarshalling<"f", "cx-limited-range",
1109  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Basic algebraic expansions of "
1110  "complex arithmetic operations involving are enabled.">,
1111  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Basic algebraic expansions "
1112  "of complex arithmetic operations involving are disabled.">>;
1113
1114defm cx_fortran_rules: BoolOptionWithoutMarshalling<"f", "cx-fortran-rules",
1115  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Range reduction is enabled for "
1116  "complex arithmetic operations.">,
1117  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Range reduction is disabled "
1118  "for complex arithmetic operations">>;
1119
1120// OpenCL-only Options
1121def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group<opencl_Group>,
1122  Visibility<[ClangOption, CC1Option]>,
1123  HelpText<"OpenCL only. This option disables all optimizations. By default optimizations are enabled.">;
1124def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group<opencl_Group>,
1125  Visibility<[ClangOption, CC1Option]>,
1126  HelpText<"OpenCL only. This option is added for compatibility with OpenCL 1.0.">;
1127def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">, Group<opencl_Group>,
1128  Visibility<[ClangOption, CC1Option]>,
1129  HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">,
1130  MarshallingInfoFlag<LangOpts<"SinglePrecisionConstants">>;
1131def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">, Group<opencl_Group>,
1132  Visibility<[ClangOption, CC1Option]>,
1133  HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">;
1134def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">, Group<opencl_Group>,
1135  Visibility<[ClangOption, CC1Option]>,
1136  HelpText<"OpenCL only. Generate kernel argument metadata.">,
1137  MarshallingInfoFlag<CodeGenOpts<"EmitOpenCLArgMetadata">>;
1138def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">, Group<opencl_Group>,
1139  Visibility<[ClangOption, CC1Option]>,
1140  HelpText<"OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable.">,
1141  MarshallingInfoFlag<LangOpts<"CLUnsafeMath">>;
1142def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">, Group<opencl_Group>,
1143  Visibility<[ClangOption, CC1Option]>,
1144  HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__.">,
1145  MarshallingInfoFlag<LangOpts<"FastRelaxedMath">>;
1146def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>,
1147  Visibility<[ClangOption, CC1Option]>,
1148  HelpText<"OpenCL only. Allow use of less precise MAD computations in the generated binary.">,
1149  MarshallingInfoFlag<CodeGenOpts<"LessPreciseFPMAD">>,
1150  ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, cl_fast_relaxed_math.KeyPath]>;
1151def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>,
1152  Visibility<[ClangOption, CC1Option]>,
1153  HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">,
1154  MarshallingInfoFlag<LangOpts<"CLNoSignedZero">>;
1155def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>,
1156  Visibility<[ClangOption, CC1Option]>,
1157  HelpText<"OpenCL language standard to compile for.">,
1158  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">;
1159def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>,
1160  HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
1161def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>,
1162  Visibility<[ClangOption, CC1Option]>,
1163  HelpText<"OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.">,
1164  MarshallingInfoFlag<CodeGenOpts<"OpenCLCorrectlyRoundedDivSqrt">>;
1165def cl_uniform_work_group_size : Flag<["-"], "cl-uniform-work-group-size">, Group<opencl_Group>,
1166  Visibility<[ClangOption, CC1Option]>, Alias<foffload_uniform_block>,
1167  HelpText<"OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel">;
1168def cl_no_stdinc : Flag<["-"], "cl-no-stdinc">, Group<opencl_Group>,
1169  HelpText<"OpenCL only. Disables all standard includes containing non-native compiler types and functions.">;
1170def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">, Group<opencl_Group>,
1171  Visibility<[ClangOption, CC1Option]>,
1172  HelpText<"OpenCL only. Enable or disable OpenCL extensions/optional features. The argument is a comma-separated "
1173           "sequence of one or more extension names, each prefixed by '+' or '-'.">,
1174  MarshallingInfoStringVector<TargetOpts<"OpenCLExtensionsAsWritten">>;
1175
1176def client__name : JoinedOrSeparate<["-"], "client_name">;
1177def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>;
1178def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">;
1179def config : Joined<["--"], "config=">, Flags<[NoXarchOption]>,
1180  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, MetaVarName<"<file>">,
1181  HelpText<"Specify configuration file">;
1182def : Separate<["--"], "config">, Visibility<[ClangOption, FlangOption]>, Alias<config>;
1183def no_default_config : Flag<["--"], "no-default-config">,
1184  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1185  HelpText<"Disable loading default configuration files">;
1186def config_system_dir_EQ : Joined<["--"], "config-system-dir=">,
1187  Flags<[NoXarchOption, HelpHidden]>,
1188  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1189  HelpText<"System directory for configuration files">;
1190def config_user_dir_EQ : Joined<["--"], "config-user-dir=">,
1191  Flags<[NoXarchOption, HelpHidden]>,
1192  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1193  HelpText<"User directory for configuration files">;
1194def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>,
1195  Visibility<[ClangOption, CLOption]>;
1196def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
1197def current__version : JoinedOrSeparate<["-"], "current_version">;
1198def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
1199  HelpText<"Add directory to the C++ SYSTEM include search path">,
1200  Visibility<[ClangOption, CC1Option]>,
1201  MetaVarName<"<directory>">;
1202def c : Flag<["-"], "c">, Flags<[NoXarchOption]>,
1203  Visibility<[ClangOption, FlangOption]>, Group<Action_Group>,
1204  HelpText<"Only run preprocess, compile, and assemble steps">;
1205def fconvergent_functions : Flag<["-"], "fconvergent-functions">,
1206  Visibility<[ClangOption, CC1Option]>,
1207  HelpText< "Assume all functions may be convergent.">;
1208def fno_convergent_functions : Flag<["-"], "fno-convergent-functions">,
1209  Visibility<[ClangOption, CC1Option]>;
1210
1211// Common offloading options
1212let Group = offload_Group in {
1213def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
1214  Visibility<[ClangOption, FlangOption]>,
1215  HelpText<"Specify an offloading device architecture for CUDA, HIP, or OpenMP. (e.g. sm_35). "
1216           "If 'native' is used the compiler will detect locally installed architectures. "
1217           "For HIP offloading, the device architecture can be followed by target ID features "
1218           "delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once.">;
1219def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">,
1220  Flags<[NoXarchOption]>,
1221  Visibility<[ClangOption, FlangOption]>,
1222  HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. "
1223           "'all' resets the list to its default value.">;
1224
1225def offload_new_driver : Flag<["--"], "offload-new-driver">,
1226  Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
1227  MarshallingInfoFlag<LangOpts<"OffloadingNewDriver">>, HelpText<"Use the new driver for offloading compilation.">;
1228def no_offload_new_driver : Flag<["--"], "no-offload-new-driver">,
1229  Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
1230  HelpText<"Don't Use the new driver for offloading compilation.">;
1231
1232def offload_device_only : Flag<["--"], "offload-device-only">,
1233  Visibility<[ClangOption, FlangOption]>,
1234  HelpText<"Only compile for the offloading device.">;
1235def offload_host_only : Flag<["--"], "offload-host-only">,
1236  Visibility<[ClangOption, FlangOption]>,
1237  HelpText<"Only compile for the offloading host.">;
1238def offload_host_device : Flag<["--"], "offload-host-device">,
1239  Visibility<[ClangOption, FlangOption]>,
1240  HelpText<"Compile for both the offloading host and device (default).">;
1241
1242def gpu_use_aux_triple_only : Flag<["--"], "gpu-use-aux-triple-only">,
1243  InternalDriverOpt, HelpText<"Prepare '-aux-triple' only without populating "
1244                              "'-aux-target-cpu' and '-aux-target-feature'.">;
1245def amdgpu_arch_tool_EQ : Joined<["--"], "amdgpu-arch-tool=">,
1246  HelpText<"Tool used for detecting AMD GPU arch in the system.">;
1247def nvptx_arch_tool_EQ : Joined<["--"], "nvptx-arch-tool=">,
1248  HelpText<"Tool used for detecting NVIDIA GPU arch in the system.">;
1249
1250defm gpu_rdc : BoolFOption<"gpu-rdc",
1251  LangOpts<"GPURelocatableDeviceCode">, DefaultFalse,
1252  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1253          "Generate relocatable device code, also known as separate compilation mode">,
1254  NegFlag<SetFalse>>;
1255
1256defm offload_implicit_host_device_templates :
1257  BoolFOption<"offload-implicit-host-device-templates",
1258  LangOpts<"OffloadImplicitHostDeviceTemplates">, DefaultFalse,
1259  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1260          "Template functions or specializations without host, device and "
1261          "global attributes have implicit host device attributes (CUDA/HIP only)">,
1262  NegFlag<SetFalse>>;
1263
1264def fgpu_default_stream_EQ : Joined<["-"], "fgpu-default-stream=">,
1265  HelpText<"Specify default stream. The default value is 'legacy'. (CUDA/HIP only)">,
1266  Visibility<[ClangOption, CC1Option]>,
1267  Values<"legacy,per-thread">,
1268  NormalizedValuesScope<"LangOptions::GPUDefaultStreamKind">,
1269  NormalizedValues<["Legacy", "PerThread"]>,
1270  MarshallingInfoEnum<LangOpts<"GPUDefaultStream">, "Legacy">;
1271
1272def fgpu_flush_denormals_to_zero : Flag<["-"], "fgpu-flush-denormals-to-zero">,
1273  HelpText<"Flush denormal floating point values to zero in CUDA/HIP device mode.">;
1274def fno_gpu_flush_denormals_to_zero : Flag<["-"], "fno-gpu-flush-denormals-to-zero">;
1275
1276defm gpu_defer_diag : BoolFOption<"gpu-defer-diag",
1277  LangOpts<"GPUDeferDiag">, DefaultFalse,
1278  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Defer">,
1279  NegFlag<SetFalse, [], [ClangOption], "Don't defer">,
1280  BothFlags<[], [ClangOption], " host/device related diagnostic messages for CUDA/HIP">>;
1281
1282defm gpu_exclude_wrong_side_overloads : BoolFOption<"gpu-exclude-wrong-side-overloads",
1283  LangOpts<"GPUExcludeWrongSideOverloads">, DefaultFalse,
1284  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1285          "Always exclude wrong side overloads">,
1286  NegFlag<SetFalse, [], [ClangOption], "Exclude wrong side overloads only if there are same side overloads">,
1287  BothFlags<[HelpHidden], [], " in overloading resolution for CUDA/HIP">>;
1288
1289def cuid_EQ : Joined<["-"], "cuid=">, Visibility<[ClangOption, CC1Option]>,
1290  HelpText<"An ID for compilation unit, which should be the same for the same "
1291           "compilation unit but different for different compilation units. "
1292           "It is used to externalize device-side static variables for single "
1293           "source offloading languages CUDA and HIP so that they can be "
1294           "accessed by the host code of the same compilation unit.">,
1295  MarshallingInfoString<LangOpts<"CUID">>;
1296def fuse_cuid_EQ : Joined<["-"], "fuse-cuid=">,
1297  HelpText<"Method to generate ID's for compilation units for single source "
1298           "offloading languages CUDA and HIP: 'hash' (ID's generated by hashing "
1299           "file path and command line options) | 'random' (ID's generated as "
1300           "random numbers) | 'none' (disabled). Default is 'hash'. This option "
1301           "will be overridden by option '-cuid=[ID]' if it is specified." >;
1302
1303def fgpu_inline_threshold_EQ : Joined<["-"], "fgpu-inline-threshold=">,
1304  Flags<[HelpHidden]>,
1305  HelpText<"Inline threshold for device compilation for CUDA/HIP">;
1306
1307def fgpu_sanitize : Flag<["-"], "fgpu-sanitize">, Group<f_Group>,
1308  HelpText<"Enable sanitizer for supported offloading devices">;
1309def fno_gpu_sanitize : Flag<["-"], "fno-gpu-sanitize">, Group<f_Group>;
1310
1311def offload_compress : Flag<["--"], "offload-compress">,
1312  HelpText<"Compress offload device binaries (HIP only)">;
1313def no_offload_compress : Flag<["--"], "no-offload-compress">;
1314
1315def offload_compression_level_EQ : Joined<["--"], "offload-compression-level=">,
1316  Flags<[HelpHidden]>,
1317  HelpText<"Compression level for offload device binaries (HIP only)">;
1318
1319defm offload_via_llvm : BoolFOption<"offload-via-llvm",
1320  LangOpts<"OffloadViaLLVM">, DefaultFalse,
1321  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
1322  NegFlag<SetFalse, [], [ClangOption], "Don't use">,
1323  BothFlags<[], [ClangOption], " LLVM/Offload as portable offloading runtime.">>;
1324}
1325
1326// CUDA options
1327let Group = cuda_Group in {
1328def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">,
1329  Flags<[NoXarchOption]>,
1330  HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
1331def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">,
1332  Flags<[NoXarchOption]>,
1333  HelpText<"Do not include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
1334def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">, Flags<[NoXarchOption]>,
1335  Alias<offload_arch_EQ>;
1336def cuda_feature_EQ : Joined<["--"], "cuda-feature=">, HelpText<"Manually specify the CUDA feature to use">;
1337def no_cuda_gpu_arch_EQ : Joined<["--"], "no-cuda-gpu-arch=">,
1338  Flags<[NoXarchOption]>,
1339  Alias<no_offload_arch_EQ>;
1340
1341def cuda_device_only : Flag<["--"], "cuda-device-only">, Alias<offload_device_only>,
1342  HelpText<"Compile CUDA code for device only">;
1343def cuda_host_only : Flag<["--"], "cuda-host-only">, Alias<offload_host_only>,
1344  HelpText<"Compile CUDA code for host only. Has no effect on non-CUDA compilations.">;
1345def cuda_compile_host_device : Flag<["--"], "cuda-compile-host-device">, Alias<offload_host_device>,
1346  HelpText<"Compile CUDA code for both host and device (default). Has no "
1347           "effect on non-CUDA compilations.">;
1348
1349def cuda_noopt_device_debug : Flag<["--"], "cuda-noopt-device-debug">,
1350  HelpText<"Enable device-side debug info generation. Disables ptxas optimizations.">;
1351def no_cuda_version_check : Flag<["--"], "no-cuda-version-check">,
1352  HelpText<"Don't error out if the detected version of the CUDA install is "
1353           "too low for the requested CUDA gpu architecture.">;
1354def no_cuda_noopt_device_debug : Flag<["--"], "no-cuda-noopt-device-debug">;
1355def cuda_path_EQ : Joined<["--"], "cuda-path=">, Group<i_Group>,
1356  HelpText<"CUDA installation path">;
1357def cuda_path_ignore_env : Flag<["--"], "cuda-path-ignore-env">, Group<i_Group>,
1358  HelpText<"Ignore environment variables to detect CUDA installation">;
1359def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Group<i_Group>,
1360  HelpText<"Path to ptxas (used for compiling CUDA code)">;
1361def fcuda_flush_denormals_to_zero : Flag<["-"], "fcuda-flush-denormals-to-zero">,
1362  Alias<fgpu_flush_denormals_to_zero>;
1363def fno_cuda_flush_denormals_to_zero : Flag<["-"], "fno-cuda-flush-denormals-to-zero">,
1364  Alias<fno_gpu_flush_denormals_to_zero>;
1365def : Flag<["-"], "fcuda-rdc">, Alias<fgpu_rdc>;
1366def : Flag<["-"], "fno-cuda-rdc">, Alias<fno_gpu_rdc>;
1367defm cuda_short_ptr : BoolFOption<"cuda-short-ptr",
1368  TargetOpts<"NVPTXUseShortPointers">, DefaultFalse,
1369  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1370          "Use 32-bit pointers for accessing const/local/shared address spaces">,
1371  NegFlag<SetFalse>>;
1372}
1373
1374def emit_static_lib : Flag<["--"], "emit-static-lib">,
1375  HelpText<"Enable linker job to emit a static library.">;
1376
1377def mprintf_kind_EQ : Joined<["-"], "mprintf-kind=">, Group<m_Group>,
1378  HelpText<"Specify the printf lowering scheme (AMDGPU only), allowed values are "
1379  "\"hostcall\"(printing happens during kernel execution, this scheme "
1380  "relies on hostcalls which require system to support pcie atomics) "
1381  "and \"buffered\"(printing happens after all kernel threads exit, "
1382  "this uses a printf buffer and does not rely on pcie atomic support)">,
1383  Visibility<[ClangOption, CC1Option]>,
1384  Values<"hostcall,buffered">,
1385  NormalizedValuesScope<"TargetOptions::AMDGPUPrintfKind">,
1386  NormalizedValues<["Hostcall", "Buffered"]>,
1387  MarshallingInfoEnum<TargetOpts<"AMDGPUPrintfKindVal">, "Hostcall">;
1388
1389// HIP options
1390let Group = hip_Group in {
1391def hip_link : Flag<["--"], "hip-link">, Group<opencl_Group>,
1392  HelpText<"Link clang-offload-bundler bundles for HIP">;
1393def no_hip_rt: Flag<["-"], "no-hip-rt">, Group<hip_Group>,
1394  HelpText<"Do not link against HIP runtime libraries">;
1395def rocm_path_EQ : Joined<["--"], "rocm-path=">,
1396  Visibility<[FlangOption]>, Group<hip_Group>,
1397  HelpText<"ROCm installation path, used for finding and automatically linking required bitcode libraries.">;
1398def hip_path_EQ : Joined<["--"], "hip-path=">, Group<hip_Group>,
1399  HelpText<"HIP runtime installation path, used for finding HIP version and adding HIP include path.">;
1400def hipstdpar : Flag<["--"], "hipstdpar">,
1401  Visibility<[ClangOption, CC1Option]>,
1402  Group<CompileOnly_Group>,
1403  HelpText<"Enable HIP acceleration for standard parallel algorithms">,
1404  MarshallingInfoFlag<LangOpts<"HIPStdPar">>;
1405def hipstdpar_interpose_alloc : Flag<["--"], "hipstdpar-interpose-alloc">,
1406  Visibility<[ClangOption, CC1Option]>,
1407  Group<CompileOnly_Group>,
1408  HelpText<"Replace all memory allocation / deallocation calls with "
1409           "hipManagedMalloc / hipFree equivalents">,
1410  MarshallingInfoFlag<LangOpts<"HIPStdParInterposeAlloc">>;
1411// TODO: use MarshallingInfo here
1412def hipstdpar_path_EQ : Joined<["--"], "hipstdpar-path=">, Group<i_Group>,
1413  HelpText<
1414    "HIP Standard Parallel Algorithm Acceleration library path, used for "
1415    "finding and implicitly including the library header">;
1416def hipstdpar_thrust_path_EQ : Joined<["--"], "hipstdpar-thrust-path=">,
1417  Group<i_Group>,
1418  HelpText<
1419    "rocThrust path, required by the HIP Standard Parallel Algorithm "
1420    "Acceleration library, used to implicitly include the rocThrust library">;
1421def hipstdpar_prim_path_EQ : Joined<["--"], "hipstdpar-prim-path=">,
1422  Group<i_Group>,
1423  HelpText<
1424    "rocPrim path, required by the HIP Standard Parallel Algorithm "
1425    "Acceleration library, used to implicitly include the rocPrim library">;
1426def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Group<hip_Group>,
1427  HelpText<"ROCm device library path. Alternative to rocm-path.">;
1428def : Joined<["--"], "hip-device-lib-path=">, Alias<rocm_device_lib_path_EQ>;
1429def hip_device_lib_EQ : Joined<["--"], "hip-device-lib=">, Group<hip_Group>,
1430  HelpText<"HIP device library">;
1431def hip_version_EQ : Joined<["--"], "hip-version=">, Group<hip_Group>,
1432  HelpText<"HIP version in the format of major.minor.patch">;
1433def fhip_dump_offload_linker_script : Flag<["-"], "fhip-dump-offload-linker-script">,
1434  Group<hip_Group>, Flags<[NoArgumentUnused, HelpHidden]>;
1435defm hip_new_launch_api : BoolFOption<"hip-new-launch-api",
1436  LangOpts<"HIPUseNewLaunchAPI">, DefaultFalse,
1437  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
1438  NegFlag<SetFalse, [], [ClangOption], "Don't use">,
1439  BothFlags<[], [ClangOption], " new kernel launching API for HIP">>;
1440defm hip_fp32_correctly_rounded_divide_sqrt : BoolFOption<"hip-fp32-correctly-rounded-divide-sqrt",
1441  CodeGenOpts<"HIPCorrectlyRoundedDivSqrt">, DefaultTrue,
1442  PosFlag<SetTrue, [], [ClangOption], "Specify">,
1443  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Don't specify">,
1444  BothFlags<[], [ClangOption], " that single precision floating-point divide and sqrt used in "
1445  "the program source are correctly rounded (HIP device compilation only)">>,
1446  ShouldParseIf<hip.KeyPath>;
1447defm hip_kernel_arg_name : BoolFOption<"hip-kernel-arg-name",
1448  CodeGenOpts<"HIPSaveKernelArgName">, DefaultFalse,
1449  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Specify">,
1450  NegFlag<SetFalse, [], [ClangOption], "Don't specify">,
1451  BothFlags<[], [ClangOption], " that kernel argument names are preserved (HIP only)">>,
1452  ShouldParseIf<hip.KeyPath>;
1453def hipspv_pass_plugin_EQ : Joined<["--"], "hipspv-pass-plugin=">,
1454  Group<Link_Group>, MetaVarName<"<dsopath>">,
1455  HelpText<"path to a pass plugin for HIP to SPIR-V passes.">;
1456defm gpu_allow_device_init : BoolFOption<"gpu-allow-device-init",
1457  LangOpts<"GPUAllowDeviceInit">, DefaultFalse,
1458  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Allow">,
1459  NegFlag<SetFalse, [], [ClangOption], "Don't allow">,
1460  BothFlags<[], [ClangOption], " device side init function in HIP (experimental)">>,
1461  ShouldParseIf<hip.KeyPath>;
1462def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">,
1463  Visibility<[ClangOption, CC1Option]>,
1464  HelpText<"Default max threads per block for kernel launch bounds for HIP">,
1465  MarshallingInfoInt<LangOpts<"GPUMaxThreadsPerBlock">, "1024">,
1466  ShouldParseIf<hip.KeyPath>;
1467def gpu_instrument_lib_EQ : Joined<["--"], "gpu-instrument-lib=">,
1468  HelpText<"Instrument device library for HIP, which is a LLVM bitcode containing "
1469  "__cyg_profile_func_enter and __cyg_profile_func_exit">;
1470def gpu_bundle_output : Flag<["--"], "gpu-bundle-output">,
1471  HelpText<"Bundle output files of HIP device compilation">;
1472def no_gpu_bundle_output : Flag<["--"], "no-gpu-bundle-output">,
1473  Group<hip_Group>, HelpText<"Do not bundle output files of HIP device compilation">;
1474def fhip_emit_relocatable : Flag<["-"], "fhip-emit-relocatable">,
1475  HelpText<"Compile HIP source to relocatable">;
1476def fno_hip_emit_relocatable : Flag<["-"], "fno-hip-emit-relocatable">,
1477  HelpText<"Do not override toolchain to compile HIP source to relocatable">;
1478}
1479
1480// Clang specific/exclusive options for OpenACC.
1481def openacc_macro_override
1482    : Separate<["-"], "fexperimental-openacc-macro-override">,
1483      Visibility<[ClangOption, CC1Option]>,
1484      Group<f_Group>,
1485      HelpText<"Overrides the _OPENACC macro value for experimental testing "
1486               "during OpenACC support development">;
1487def openacc_macro_override_EQ
1488    : Joined<["-"], "fexperimental-openacc-macro-override=">,
1489      Alias<openacc_macro_override>;
1490
1491// End Clang specific/exclusive options for OpenACC.
1492
1493def libomptarget_amdgpu_bc_path_EQ : Joined<["--"], "libomptarget-amdgpu-bc-path=">, Group<i_Group>,
1494  HelpText<"Path to libomptarget-amdgcn bitcode library">;
1495def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path=">, Group<i_Group>,
1496  HelpText<"Path to libomptarget-amdgcn bitcode library">, Alias<libomptarget_amdgpu_bc_path_EQ>;
1497def libomptarget_nvptx_bc_path_EQ : Joined<["--"], "libomptarget-nvptx-bc-path=">, Group<i_Group>,
1498  HelpText<"Path to libomptarget-nvptx bitcode library">;
1499def libomptarget_spirv_bc_path_EQ : Joined<["--"], "libomptarget-spirv-bc-path=">, Group<i_Group>,
1500  HelpText<"Path to libomptarget-spirv bitcode library">;
1501def dD : Flag<["-"], "dD">, Group<d_Group>, Visibility<[ClangOption, CC1Option]>,
1502  HelpText<"Print macro definitions in -E mode in addition to normal output">;
1503def dI : Flag<["-"], "dI">, Group<d_Group>, Visibility<[ClangOption, CC1Option]>,
1504  HelpText<"Print include directives in -E mode in addition to normal output">,
1505  MarshallingInfoFlag<PreprocessorOutputOpts<"ShowIncludeDirectives">>;
1506def dE : Flag<["-"], "dE">, Group<d_Group>, Visibility<[CC1Option]>,
1507  HelpText<"Print embed directives in -E mode in addition to normal output">,
1508  MarshallingInfoFlag<PreprocessorOutputOpts<"ShowEmbedDirectives">>;
1509def dM : Flag<["-"], "dM">, Group<d_Group>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
1510  HelpText<"Print macro definitions in -E mode instead of normal output">;
1511def dead__strip : Flag<["-"], "dead_strip">;
1512def dependency_file : Separate<["-"], "dependency-file">,
1513  Visibility<[ClangOption, CC1Option]>,
1514  HelpText<"Filename (or -) to write dependency output to">,
1515  MarshallingInfoString<DependencyOutputOpts<"OutputFile">>;
1516def dependency_dot : Separate<["-"], "dependency-dot">,
1517  Visibility<[ClangOption, CC1Option]>,
1518  HelpText<"Filename to write DOT-formatted header dependencies to">,
1519  MarshallingInfoString<DependencyOutputOpts<"DOTOutputFile">>;
1520def module_dependency_dir : Separate<["-"], "module-dependency-dir">,
1521  Visibility<[ClangOption, CC1Option]>,
1522  HelpText<"Directory to dump module dependencies to">,
1523  MarshallingInfoString<DependencyOutputOpts<"ModuleDependencyOutputDir">>;
1524def dsym_dir : JoinedOrSeparate<["-"], "dsym-dir">,
1525  Flags<[NoXarchOption, RenderAsInput]>,
1526  HelpText<"Directory to output dSYM's (if any) to">, MetaVarName<"<dir>">;
1527// GCC style -dumpdir. We intentionally don't implement the less useful -dumpbase{,-ext}.
1528def dumpdir : Separate<["-"], "dumpdir">, Visibility<[ClangOption, CC1Option]>,
1529  MetaVarName<"<dumppfx>">,
1530  HelpText<"Use <dumpfpx> as a prefix to form auxiliary and dump file names">;
1531def dumpmachine : Flag<["-"], "dumpmachine">,
1532  Visibility<[ClangOption, FlangOption]>,
1533  HelpText<"Display the compiler's target processor">;
1534def dumpversion : Flag<["-"], "dumpversion">,
1535  Visibility<[ClangOption, FlangOption]>,
1536  HelpText<"Display the version of the compiler">;
1537def dumpspecs : Flag<["-"], "dumpspecs">, Flags<[Unsupported]>;
1538def dylib__file : Separate<["-"], "dylib_file">;
1539def dylinker__install__name : JoinedOrSeparate<["-"], "dylinker_install_name">;
1540def dylinker : Flag<["-"], "dylinker">;
1541def dynamiclib : Flag<["-"], "dynamiclib">;
1542def dynamic : Flag<["-"], "dynamic">, Flags<[NoArgumentUnused]>;
1543def d_Flag : Flag<["-"], "d">, Group<d_Group>;
1544def d_Joined : Joined<["-"], "d">, Group<d_Group>;
1545def emit_ast : Flag<["-"], "emit-ast">,
1546  Visibility<[ClangOption, CLOption, DXCOption]>,
1547  HelpText<"Emit Clang AST files for source inputs">;
1548def emit_llvm : Flag<["-"], "emit-llvm">,
1549  Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>,
1550  Group<Action_Group>,
1551  HelpText<"Use the LLVM representation for assembler and object files">;
1552def emit_interface_stubs : Flag<["-"], "emit-interface-stubs">,
1553  Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
1554  HelpText<"Generate Interface Stub Files.">;
1555def emit_merged_ifs : Flag<["-"], "emit-merged-ifs">,
1556  Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
1557  HelpText<"Generate Interface Stub Files, emit merged text not binary.">;
1558def end_no_unused_arguments : Flag<["--"], "end-no-unused-arguments">,
1559  Visibility<[ClangOption, CLOption, DXCOption]>,
1560  HelpText<"Start emitting warnings for unused driver arguments">;
1561def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version=">,
1562  Visibility<[ClangOption, CC1Option]>;
1563def exported__symbols__list : Separate<["-"], "exported_symbols_list">;
1564def alias_list : Separate<["-"], "alias_list">, Flags<[LinkerInput]>;
1565def extract_api : Flag<["-"], "extract-api">,
1566  Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
1567  HelpText<"Extract API information">;
1568def product_name_EQ: Joined<["--"], "product-name=">,
1569  Visibility<[ClangOption, CC1Option]>,
1570  MarshallingInfoString<FrontendOpts<"ProductName">>;
1571def emit_symbol_graph: Flag<["-"], "emit-symbol-graph">,
1572  Visibility<[ClangOption, CC1Option]>,
1573  HelpText<"Generate Extract API information as a side effect of compilation.">,
1574  MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraph">>;
1575def emit_extension_symbol_graphs: Flag<["--"], "emit-extension-symbol-graphs">,
1576  Visibility<[ClangOption, CC1Option]>,
1577  HelpText<"Generate additional symbol graphs for extended modules.">,
1578  MarshallingInfoFlag<FrontendOpts<"EmitExtensionSymbolGraphs">>;
1579def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">,
1580  Visibility<[ClangOption, CC1Option]>,
1581    HelpText<"Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.">,
1582    MarshallingInfoStringVector<FrontendOpts<"ExtractAPIIgnoresFileList">>;
1583def symbol_graph_dir_EQ: Joined<["--"], "symbol-graph-dir=">,
1584   Visibility<[ClangOption, CC1Option]>,
1585   HelpText<"Directory in which to emit symbol graphs.">,
1586   MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
1587def emit_pretty_sgf: Flag<["--"], "pretty-sgf">,
1588    Visibility<[ClangOption, CC1Option]>,
1589    HelpText<"Emit pretty printed symbol graphs">,
1590    MarshallingInfoFlag<FrontendOpts<"EmitPrettySymbolGraphs">>;
1591def emit_sgf_symbol_labels_for_testing: Flag<["--"], "emit-sgf-symbol-labels-for-testing">,
1592   Visibility<[CC1Option]>,
1593   MarshallingInfoFlag<FrontendOpts<"EmitSymbolGraphSymbolLabelsForTesting">>;
1594def e : Separate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
1595def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>,
1596  Visibility<[ClangOption, CC1Option]>,
1597  HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
1598  MarshallingInfoInt<LangOpts<"MaxTokens">>;
1599defm access_control : BoolFOption<"access-control",
1600  LangOpts<"AccessControl">, DefaultTrue,
1601  NegFlag<SetFalse, [], [ClangOption, CC1Option],
1602          "Disable C++ access control">,
1603  PosFlag<SetTrue>>;
1604def falign_functions : Flag<["-"], "falign-functions">, Group<f_Group>;
1605def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group<f_Group>;
1606def falign_loops_EQ : Joined<["-"], "falign-loops=">, Group<f_Group>,
1607  Visibility<[ClangOption, CC1Option]>, MetaVarName<"<N>">,
1608  HelpText<"N must be a power of two. Align loops to the boundary">,
1609  MarshallingInfoInt<CodeGenOpts<"LoopAlignment">>;
1610def fno_align_functions: Flag<["-"], "fno-align-functions">, Group<f_Group>;
1611defm allow_editor_placeholders : BoolFOption<"allow-editor-placeholders",
1612  LangOpts<"AllowEditorPlaceholders">, DefaultFalse,
1613  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1614          "Treat editor placeholders as valid source code">,
1615  NegFlag<SetFalse>>;
1616def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group<f_Group>;
1617def fapple_kext : Flag<["-"], "fapple-kext">, Group<f_Group>,
1618  Visibility<[ClangOption, CC1Option]>,
1619  HelpText<"Use Apple's kernel extensions ABI">,
1620  MarshallingInfoFlag<LangOpts<"AppleKext">>;
1621def fstrict_flex_arrays_EQ : Joined<["-"], "fstrict-flex-arrays=">, Group<f_Group>,
1622  MetaVarName<"<n>">, Values<"0,1,2,3">,
1623  LangOpts<"StrictFlexArraysLevel">,
1624  Visibility<[ClangOption, CC1Option]>,
1625  NormalizedValuesScope<"LangOptions::StrictFlexArraysLevelKind">,
1626  NormalizedValues<["Default", "OneZeroOrIncomplete", "ZeroOrIncomplete", "IncompleteOnly"]>,
1627  HelpText<"Enable optimizations based on the strict definition of flexible arrays">,
1628  MarshallingInfoEnum<LangOpts<"StrictFlexArraysLevel">, "Default">;
1629defm apple_pragma_pack : BoolFOption<"apple-pragma-pack",
1630  LangOpts<"ApplePragmaPack">, DefaultFalse,
1631  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1632          "Enable Apple gcc-compatible #pragma pack handling">,
1633  NegFlag<SetFalse>>;
1634defm xl_pragma_pack : BoolFOption<"xl-pragma-pack",
1635  LangOpts<"XLPragmaPack">, DefaultFalse,
1636  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1637          "Enable IBM XL #pragma pack handling">,
1638  NegFlag<SetFalse>>;
1639def shared_libsan : Flag<["-"], "shared-libsan">,
1640  HelpText<"Dynamically link the sanitizer runtime">;
1641def static_libsan : Flag<["-"], "static-libsan">,
1642  HelpText<"Statically link the sanitizer runtime (Not supported for ASan, TSan or UBSan on darwin)">;
1643def : Flag<["-"], "shared-libasan">, Alias<shared_libsan>;
1644def : Flag<["-"], "static-libasan">, Alias<static_libsan>;
1645def fasm : Flag<["-"], "fasm">, Group<f_Group>;
1646
1647defm assume_unique_vtables : BoolFOption<"assume-unique-vtables",
1648  CodeGenOpts<"AssumeUniqueVTables">, DefaultTrue,
1649  PosFlag<SetTrue>,
1650  NegFlag<SetFalse, [], [ClangOption, CC1Option],
1651          "Disable optimizations based on vtable pointer identity">,
1652  BothFlags<[], [ClangOption, CLOption]>>;
1653
1654def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group<f_Group>;
1655def fastcp : Flag<["-"], "fastcp">, Group<f_Group>;
1656def fastf : Flag<["-"], "fastf">, Group<f_Group>;
1657def fast : Flag<["-"], "fast">, Group<f_Group>;
1658def fasynchronous_unwind_tables : Flag<["-"], "fasynchronous-unwind-tables">, Group<f_Group>;
1659
1660defm double_square_bracket_attributes : BoolFOption<"double-square-bracket-attributes",
1661  LangOpts<"DoubleSquareBracketAttributes">, DefaultTrue, PosFlag<SetTrue>,
1662 NegFlag<SetFalse>>;
1663
1664defm experimental_late_parse_attributes : BoolFOption<"experimental-late-parse-attributes",
1665  LangOpts<"ExperimentalLateParseAttributes">, DefaultFalse,
1666  PosFlag<SetTrue, [], [ClangOption], "Enable">,
1667  NegFlag<SetFalse, [], [ClangOption], "Disable">,
1668  BothFlags<[], [ClangOption, CC1Option],
1669          " experimental late parsing of attributes">>;
1670
1671defm autolink : BoolFOption<"autolink",
1672  CodeGenOpts<"Autolink">, DefaultTrue,
1673  NegFlag<SetFalse, [], [ClangOption, CC1Option],
1674          "Disable generation of linker directives for automatic library linking">,
1675  PosFlag<SetTrue>>;
1676
1677let Flags = [TargetSpecific] in {
1678defm auto_import : BoolFOption<"auto-import",
1679  CodeGenOpts<"AutoImport">, DefaultTrue,
1680  NegFlag<SetFalse, [], [ClangOption, CC1Option],
1681          "MinGW specific. Disable support for automatic dllimport in code generation "
1682          "and linking">,
1683  PosFlag<SetTrue, [], [], "MinGW specific. Enable code generation support for "
1684          "automatic dllimport, and enable support for it in the linker. "
1685          "Enabled by default.">>;
1686} // let Flags = [TargetSpecific]
1687
1688// In the future this option will be supported by other offloading
1689// languages and accept other values such as CPU/GPU architectures,
1690// offload kinds and target aliases.
1691def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>,
1692  HelpText<"Specify comma-separated list of offloading target triples (CUDA and HIP only)">;
1693
1694// C++ Coroutines
1695defm coroutines : BoolFOption<"coroutines",
1696  LangOpts<"Coroutines">, Default<cpp20.KeyPath>,
1697  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1698          "Enable support for the C++ Coroutines">,
1699  NegFlag<SetFalse>>;
1700
1701defm coro_aligned_allocation : BoolFOption<"coro-aligned-allocation",
1702  LangOpts<"CoroAlignedAllocation">, DefaultFalse,
1703  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1704          "Prefer aligned allocation for C++ Coroutines">,
1705  NegFlag<SetFalse>>;
1706
1707defm experimental_library : BoolFOption<"experimental-library",
1708  LangOpts<"ExperimentalLibrary">, DefaultFalse,
1709  PosFlag<SetTrue, [], [ClangOption, CC1Option, CLOption],
1710          "Control whether unstable and experimental library features are enabled. "
1711          "This option enables various library features that are either experimental (also known as TSes), or have been "
1712          "but are not stable yet in the selected Standard Library implementation. It is not recommended to use this option "
1713          "in production code, since neither ABI nor API stability are guaranteed. This is intended to provide a preview "
1714          "of features that will ship in the future for experimentation purposes">,
1715  NegFlag<SetFalse>>;
1716
1717def fembed_offload_object_EQ : Joined<["-"], "fembed-offload-object=">,
1718  Group<f_Group>, Flags<[NoXarchOption]>,
1719  Visibility<[ClangOption, CC1Option, FC1Option]>,
1720  HelpText<"Embed Offloading device-side binary into host object file as a section.">,
1721  MarshallingInfoStringVector<CodeGenOpts<"OffloadObjects">>;
1722def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">,
1723    Group<f_Group>, Flags<[NoXarchOption]>,
1724    Visibility<[ClangOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
1725    HelpText<"Embed LLVM bitcode">,
1726    Values<"off,all,bitcode,marker">, NormalizedValuesScope<"CodeGenOptions">,
1727    NormalizedValues<["Embed_Off", "Embed_All", "Embed_Bitcode", "Embed_Marker"]>,
1728    MarshallingInfoEnum<CodeGenOpts<"EmbedBitcode">, "Embed_Off">;
1729def fembed_bitcode : Flag<["-"], "fembed-bitcode">, Group<f_Group>,
1730  Alias<fembed_bitcode_EQ>, AliasArgs<["all"]>,
1731  HelpText<"Embed LLVM IR bitcode as data">;
1732def fembed_bitcode_marker : Flag<["-"], "fembed-bitcode-marker">,
1733  Alias<fembed_bitcode_EQ>, AliasArgs<["marker"]>,
1734  HelpText<"Embed placeholder LLVM IR data as a marker">;
1735defm gnu_inline_asm : BoolFOption<"gnu-inline-asm",
1736  LangOpts<"GNUAsm">, DefaultTrue,
1737  NegFlag<SetFalse, [], [ClangOption, CC1Option],
1738          "Disable GNU style inline asm">,
1739  PosFlag<SetTrue>>;
1740
1741def fno_profile_sample_use : Flag<["-"], "fno-profile-sample-use">, Group<f_Group>,
1742    Visibility<[ClangOption, CLOption]>;
1743def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
1744    Group<f_Group>,
1745    Visibility<[ClangOption, CLOption, CC1Option]>,
1746    HelpText<"Enable sample-based profile guided optimizations">,
1747    MarshallingInfoString<CodeGenOpts<"SampleProfileFile">>;
1748def fprofile_sample_accurate : Flag<["-"], "fprofile-sample-accurate">,
1749    Group<f_Group>,
1750    Visibility<[ClangOption, CC1Option]>,
1751    HelpText<"Specifies that the sample profile is accurate">,
1752    DocBrief<[{Specifies that the sample profile is accurate. If the sample
1753               profile is accurate, callsites without profile samples are marked
1754               as cold. Otherwise, treat callsites without profile samples as if
1755               we have no profile}]>,
1756   MarshallingInfoFlag<CodeGenOpts<"ProfileSampleAccurate">>;
1757def fsample_profile_use_profi : Flag<["-"], "fsample-profile-use-profi">,
1758    Visibility<[ClangOption, CC1Option]>,
1759    Group<f_Group>,
1760    HelpText<"Use profi to infer block and edge counts">,
1761    DocBrief<[{Infer block and edge counts. If the profiles have errors or missing
1762               blocks caused by sampling, profile inference (profi) can convert
1763               basic block counts to branch probabilites to fix them by extended
1764               and re-engineered classic MCMF (min-cost max-flow) approach.}]>;
1765def fno_profile_sample_accurate : Flag<["-"], "fno-profile-sample-accurate">, Group<f_Group>;
1766def fno_auto_profile : Flag<["-"], "fno-auto-profile">, Group<f_Group>,
1767    Alias<fno_profile_sample_use>;
1768def fauto_profile_EQ : Joined<["-"], "fauto-profile=">,
1769    Alias<fprofile_sample_use_EQ>;
1770def fauto_profile_accurate : Flag<["-"], "fauto-profile-accurate">,
1771    Group<f_Group>, Alias<fprofile_sample_accurate>;
1772def fno_auto_profile_accurate : Flag<["-"], "fno-auto-profile-accurate">,
1773    Group<f_Group>, Alias<fno_profile_sample_accurate>;
1774def fdebug_compilation_dir_EQ : Joined<["-"], "fdebug-compilation-dir=">,
1775    Group<f_Group>,
1776    Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
1777    HelpText<"The compilation directory to embed in the debug info">,
1778    MarshallingInfoString<CodeGenOpts<"DebugCompilationDir">>;
1779def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
1780    Group<f_Group>,
1781    Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
1782    Alias<fdebug_compilation_dir_EQ>;
1783def fcoverage_compilation_dir_EQ : Joined<["-"], "fcoverage-compilation-dir=">,
1784    Group<f_Group>, Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption]>,
1785    HelpText<"The compilation directory to embed in the coverage mapping.">,
1786    MarshallingInfoString<CodeGenOpts<"CoverageCompilationDir">>;
1787def ffile_compilation_dir_EQ : Joined<["-"], "ffile-compilation-dir=">, Group<f_Group>,
1788    Visibility<[ClangOption, CLOption, DXCOption]>,
1789    HelpText<"The compilation directory to embed in the debug info and coverage mapping.">;
1790defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling",
1791  CodeGenOpts<"DebugInfoForProfiling">, DefaultFalse,
1792  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1793          "Emit extra debug info to make sample profile more accurate">,
1794  NegFlag<SetFalse>>;
1795def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">,
1796    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1797    HelpText<"Generate instrumented code to collect coverage info for cold functions into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1798def fprofile_generate_cold_function_coverage_EQ : Joined<["-"], "fprofile-generate-cold-function-coverage=">,
1799    Group<f_Group>, Visibility<[ClangOption, CLOption]>, MetaVarName<"<directory>">,
1800    HelpText<"Generate instrumented code to collect coverage info for cold functions into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1801def ftemporal_profile : Flag<["-"], "ftemporal-profile">,
1802    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1803    HelpText<"Generate instrumented code to collect temporal information">;
1804def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">,
1805    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1806    HelpText<"Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1807def fprofile_instr_generate_EQ : Joined<["-"], "fprofile-instr-generate=">,
1808    Group<f_Group>, Visibility<[ClangOption, CLOption]>, MetaVarName<"<file>">,
1809    HelpText<"Generate instrumented code to collect execution counts into <file> (overridden by LLVM_PROFILE_FILE env var)">;
1810def fprofile_instr_use : Flag<["-"], "fprofile-instr-use">, Group<f_Group>,
1811    Visibility<[ClangOption, CLOption]>;
1812def fprofile_instr_use_EQ : Joined<["-"], "fprofile-instr-use=">,
1813    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1814    HelpText<"Use instrumentation data for profile-guided optimization">;
1815def fprofile_remapping_file_EQ : Joined<["-"], "fprofile-remapping-file=">,
1816    Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1817    MetaVarName<"<file>">,
1818    HelpText<"Use the remappings described in <file> to match the profile data against names in the program">,
1819    MarshallingInfoString<CodeGenOpts<"ProfileRemappingFile">>;
1820defm coverage_mapping : BoolFOption<"coverage-mapping",
1821  CodeGenOpts<"CoverageMapping">, DefaultFalse,
1822  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1823          "Generate coverage mapping to enable code coverage analysis">,
1824  NegFlag<SetFalse, [], [ClangOption], "Disable code coverage analysis">, BothFlags<
1825          [], [ClangOption, CLOption]>>;
1826defm mcdc_coverage : BoolFOption<"coverage-mcdc",
1827  CodeGenOpts<"MCDCCoverage">, DefaultFalse,
1828  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1829          "Enable MC/DC criteria when generating code coverage">,
1830  NegFlag<SetFalse, [], [ClangOption], "Disable MC/DC coverage criteria">,
1831          BothFlags<[], [ClangOption, CLOption]>>;
1832def fmcdc_max_conditions_EQ : Joined<["-"], "fmcdc-max-conditions=">,
1833  Group<f_Group>, Visibility<[CC1Option]>,
1834  HelpText<"Maximum number of conditions in MC/DC coverage">,
1835  MarshallingInfoInt<CodeGenOpts<"MCDCMaxConds">, "32767">;
1836def fmcdc_max_test_vectors_EQ : Joined<["-"], "fmcdc-max-test-vectors=">,
1837  Group<f_Group>, Visibility<[CC1Option]>,
1838  HelpText<"Maximum number of test vectors in MC/DC coverage">,
1839  MarshallingInfoInt<CodeGenOpts<"MCDCMaxTVs">, "0x7FFFFFFE">;
1840def fprofile_generate : Flag<["-"], "fprofile-generate">,
1841    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1842    HelpText<"Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1843def fprofile_generate_EQ : Joined<["-"], "fprofile-generate=">,
1844    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1845    MetaVarName<"<directory>">,
1846    HelpText<"Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1847def fcs_profile_generate : Flag<["-"], "fcs-profile-generate">,
1848    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1849    HelpText<"Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1850def fcs_profile_generate_EQ : Joined<["-"], "fcs-profile-generate=">,
1851    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1852    MetaVarName<"<directory>">,
1853    HelpText<"Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1854def fprofile_use : Flag<["-"], "fprofile-use">, Group<f_Group>,
1855    Visibility<[ClangOption, CLOption]>, Alias<fprofile_instr_use>;
1856def fprofile_use_EQ : Joined<["-"], "fprofile-use=">,
1857    Group<f_Group>,
1858    Visibility<[ClangOption, CLOption]>,
1859    MetaVarName<"<pathname>">,
1860    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>.">;
1861def fno_profile_instr_generate : Flag<["-"], "fno-profile-instr-generate">,
1862    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1863    HelpText<"Disable generation of profile instrumentation.">;
1864def fno_profile_generate : Flag<["-"], "fno-profile-generate">,
1865    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1866    HelpText<"Disable generation of profile instrumentation.">;
1867def fno_profile_instr_use : Flag<["-"], "fno-profile-instr-use">,
1868    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
1869    HelpText<"Disable using instrumentation data for profile-guided optimization">;
1870def fno_profile_use : Flag<["-"], "fno-profile-use">,
1871    Alias<fno_profile_instr_use>;
1872def ftest_coverage : Flag<["-"], "ftest-coverage">, Group<f_Group>,
1873    HelpText<"Produce gcov notes files (*.gcno)">;
1874def fno_test_coverage : Flag<["-"], "fno-test-coverage">, Group<f_Group>;
1875def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group<f_Group>,
1876    HelpText<"Instrument code to produce gcov data files (*.gcda)">;
1877def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group<f_Group>;
1878def fprofile_filter_files_EQ : Joined<["-"], "fprofile-filter-files=">,
1879    Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1880    HelpText<"Instrument only functions from files where names match any regex separated by a semi-colon">,
1881    MarshallingInfoString<CodeGenOpts<"ProfileFilterFiles">>;
1882def fprofile_exclude_files_EQ : Joined<["-"], "fprofile-exclude-files=">,
1883    Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1884    HelpText<"Instrument only functions from files where names don't match all the regexes separated by a semi-colon">,
1885    MarshallingInfoString<CodeGenOpts<"ProfileExcludeFiles">>;
1886def fprofile_update_EQ : Joined<["-"], "fprofile-update=">,
1887    Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1888    Values<"atomic,prefer-atomic,single">,
1889    MetaVarName<"<method>">, HelpText<"Set update method of profile counters">,
1890    MarshallingInfoFlag<CodeGenOpts<"AtomicProfileUpdate">>;
1891defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
1892  CodeGenOpts<"PseudoProbeForProfiling">, DefaultFalse,
1893  PosFlag<SetTrue, [], [ClangOption], "Emit">,
1894  NegFlag<SetFalse, [], [ClangOption], "Do not emit">,
1895  BothFlags<[], [ClangOption, CC1Option],
1896          " pseudo probes for sample profiling">>;
1897def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
1898    Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1899    HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var). Deprecated, please use -ftemporal-profile">;
1900def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
1901    Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
1902    HelpText<"Filename defining the list of functions/files to instrument. "
1903             "The file uses the sanitizer special case list format.">,
1904    MarshallingInfoStringVector<LangOpts<"ProfileListFiles">>;
1905def fprofile_function_groups : Joined<["-"], "fprofile-function-groups=">,
1906  Group<f_Group>, Visibility<[ClangOption, CC1Option]>, MetaVarName<"<N>">,
1907  HelpText<"Partition functions into N groups and select only functions in group i to be instrumented using -fprofile-selected-function-group">,
1908  MarshallingInfoInt<CodeGenOpts<"ProfileTotalFunctionGroups">, "1">;
1909def fprofile_selected_function_group :
1910  Joined<["-"], "fprofile-selected-function-group=">, Group<f_Group>,
1911  Visibility<[ClangOption, CC1Option]>, MetaVarName<"<i>">,
1912  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">,
1913  MarshallingInfoInt<CodeGenOpts<"ProfileSelectedFunctionGroup">>;
1914def fcodegen_data_generate_EQ : Joined<["-"], "fcodegen-data-generate=">,
1915    Group<f_Group>, Visibility<[ClangOption, CLOption]>, MetaVarName<"<path>">,
1916    HelpText<"Emit codegen data into the object file. LLD for MachO (currently) merges them into the specified <path>.">;
1917def fcodegen_data_generate : Flag<["-"], "fcodegen-data-generate">,
1918    Group<f_Group>, Visibility<[ClangOption, CLOption]>, Alias<fcodegen_data_generate_EQ>, AliasArgs<["default.cgdata"]>,
1919    HelpText<"Emit codegen data into the object file. LLD for MachO (currently) merges them into default.cgdata.">;
1920def fcodegen_data_use_EQ : Joined<["-"], "fcodegen-data-use=">,
1921    Group<f_Group>, Visibility<[ClangOption, CLOption]>, MetaVarName<"<path>">,
1922    HelpText<"Use codegen data read from the specified <path>.">;
1923def fcodegen_data_use : Flag<["-"], "fcodegen-data-use">,
1924    Group<f_Group>, Visibility<[ClangOption, CLOption]>, Alias<fcodegen_data_use_EQ>, AliasArgs<["default.cgdata"]>,
1925    HelpText<"Use codegen data read from default.cgdata to optimize the binary">;
1926def fswift_async_fp_EQ : Joined<["-"], "fswift-async-fp=">,
1927    Group<f_Group>,
1928    Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption]>,
1929    MetaVarName<"<option>">,
1930    HelpText<"Control emission of Swift async extended frame info">,
1931    Values<"auto,always,never">,
1932    NormalizedValuesScope<"CodeGenOptions::SwiftAsyncFramePointerKind">,
1933    NormalizedValues<["Auto", "Always", "Never"]>,
1934    MarshallingInfoEnum<CodeGenOpts<"SwiftAsyncFramePointer">, "Always">;
1935defm apinotes : BoolOption<"f", "apinotes",
1936    LangOpts<"APINotes">, DefaultFalse,
1937    PosFlag<SetTrue, [], [ClangOption], "Enable">,
1938    NegFlag<SetFalse, [], [ClangOption], "Disable">,
1939    BothFlags<[], [ClangOption, CC1Option], " external API notes support">>,
1940    Group<f_clang_Group>;
1941defm apinotes_modules : BoolOption<"f", "apinotes-modules",
1942    LangOpts<"APINotesModules">, DefaultFalse,
1943    PosFlag<SetTrue, [], [ClangOption], "Enable">,
1944    NegFlag<SetFalse, [], [ClangOption], "Disable">,
1945    BothFlags<[], [ClangOption, CC1Option], " module-based external API notes support">>,
1946    Group<f_clang_Group>;
1947def fapinotes_swift_version : Joined<["-"], "fapinotes-swift-version=">,
1948  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
1949  MetaVarName<"<version>">,
1950  HelpText<"Specify the Swift version to use when filtering API notes">;
1951
1952defm bounds_safety : BoolFOption<
1953  "experimental-bounds-safety",
1954  LangOpts<"BoundsSafety">, DefaultFalse,
1955  PosFlag<SetTrue, [], [CC1Option], "Enable">,
1956  NegFlag<SetFalse, [], [CC1Option], "Disable">,
1957  BothFlags<[], [CC1Option],
1958          " experimental bounds safety extension for C">>;
1959
1960defm addrsig : BoolFOption<"addrsig",
1961  CodeGenOpts<"Addrsig">, DefaultFalse,
1962  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Emit">,
1963  NegFlag<SetFalse, [], [ClangOption], "Don't emit">,
1964  BothFlags<[], [ClangOption, CLOption],
1965          " an address-significance table">>;
1966defm blocks : OptInCC1FFlag<"blocks", "Enable the 'blocks' language feature",
1967                            "", "", [ClangOption, CLOption]>;
1968def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group<f_Group>;
1969defm borland_extensions : BoolFOption<"borland-extensions",
1970  LangOpts<"Borland">, DefaultFalse,
1971  PosFlag<SetTrue, [], [ClangOption, CC1Option],
1972          "Accept non-standard constructs supported by the Borland compiler">,
1973  NegFlag<SetFalse>>;
1974def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>,
1975  Visibility<[ClangOption, CLOption, DXCOption]>;
1976def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group<f_Group>,
1977  Flags<[]>, HelpText<"Load the clang builtins module map file.">;
1978defm caret_diagnostics : BoolFOption<"caret-diagnostics",
1979  DiagnosticOpts<"ShowCarets">, DefaultTrue,
1980  NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
1981  PosFlag<SetTrue>>;
1982def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group<f_clang_Group>,
1983  Visibility<[ClangOption, CC1Option]>,
1984  MetaVarName<"<version>">, Values<"<major>.<minor>,latest">,
1985  HelpText<"Attempt to match the ABI of Clang <version>">;
1986def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>;
1987def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group<f_Group>,
1988
1989  Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FlangOption, FC1Option]>,
1990  HelpText<"Enable colors in diagnostics">;
1991def fno_color_diagnostics : Flag<["-"], "fno-color-diagnostics">, Group<f_Group>,
1992  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1993  HelpText<"Disable colors in diagnostics">;
1994def : Flag<["-"], "fdiagnostics-color">, Group<f_Group>,
1995  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1996  Alias<fcolor_diagnostics>;
1997def : Flag<["-"], "fno-diagnostics-color">, Group<f_Group>,
1998  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
1999  Alias<fno_color_diagnostics>;
2000def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group<f_Group>,
2001  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
2002  Values<"auto,always,never">,
2003  HelpText<"When to use colors in diagnostics">;
2004def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group<f_Group>,
2005  Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
2006  HelpText<"Use ANSI escape codes for diagnostics">,
2007  MarshallingInfoFlag<DiagnosticOpts<"UseANSIEscapeCodes">>;
2008def fcomment_block_commands : CommaJoined<["-"], "fcomment-block-commands=">, Group<f_clang_Group>,
2009  Visibility<[ClangOption, CC1Option]>,
2010  HelpText<"Treat each comma separated argument in <arg> as a documentation comment block command">,
2011  MetaVarName<"<arg>">, MarshallingInfoStringVector<LangOpts<"CommentOpts.BlockCommandNames">>;
2012defm define_target_os_macros : OptInCC1FFlag<"define-target-os-macros",
2013  "Enable", "Disable", " predefined target OS macros",
2014  [ClangOption, CC1Option]>;
2015def fparse_all_comments : Flag<["-"], "fparse-all-comments">, Group<f_clang_Group>,
2016  Visibility<[ClangOption, CC1Option]>,
2017  MarshallingInfoFlag<LangOpts<"CommentOpts.ParseAllComments">>;
2018def frecord_command_line : Flag<["-"], "frecord-command-line">,
2019  DocBrief<[{Generate a section named ".GCC.command.line" containing the
2020driver command-line. After linking, the section may contain multiple command
2021lines, which will be individually terminated by null bytes. Separate arguments
2022within a command line are combined with spaces; spaces and backslashes within an
2023argument are escaped with backslashes. This format differs from the format of
2024the equivalent section produced by GCC with the -frecord-gcc-switches flag.
2025This option is currently only supported on ELF targets.}]>,
2026  Group<f_Group>,
2027  Visibility<[ClangOption, FlangOption]>;
2028def fno_record_command_line : Flag<["-"], "fno-record-command-line">,
2029  Group<f_Group>,
2030  Visibility<[ClangOption, FlangOption]>;
2031def : Flag<["-"], "frecord-gcc-switches">, Alias<frecord_command_line>;
2032def : Flag<["-"], "fno-record-gcc-switches">, Alias<fno_record_command_line>;
2033def fcommon : Flag<["-"], "fcommon">, Group<f_Group>,
2034  Visibility<[ClangOption, CLOption, CC1Option]>,
2035  HelpText<"Place uninitialized global variables in a common block">,
2036  MarshallingInfoNegativeFlag<CodeGenOpts<"NoCommon">>,
2037  DocBrief<[{Place definitions of variables with no storage class and no initializer
2038(tentative definitions) in a common block, instead of generating individual
2039zero-initialized definitions (default -fno-common).}]>;
2040def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group<f_Group>;
2041defm complete_member_pointers : BoolOption<"f", "complete-member-pointers",
2042  LangOpts<"CompleteMemberPointers">, DefaultFalse,
2043  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Require">,
2044  NegFlag<SetFalse, [], [ClangOption], "Do not require">,
2045  BothFlags<[], [ClangOption, CLOption],
2046          " member pointer base types to be complete if they"
2047            " would be significant under the Microsoft ABI">>,
2048  Group<f_clang_Group>;
2049def fcf_runtime_abi_EQ : Joined<["-"], "fcf-runtime-abi=">, Group<f_Group>,
2050    Visibility<[ClangOption, CC1Option]>,
2051    Values<"unspecified,standalone,objc,swift,swift-5.0,swift-4.2,swift-4.1">,
2052    NormalizedValuesScope<"LangOptions::CoreFoundationABI">,
2053    NormalizedValues<["ObjectiveC", "ObjectiveC", "ObjectiveC", "Swift5_0", "Swift5_0", "Swift4_2", "Swift4_1"]>,
2054    MarshallingInfoEnum<LangOpts<"CFRuntime">, "ObjectiveC">;
2055defm constant_cfstrings : BoolFOption<"constant-cfstrings",
2056  LangOpts<"NoConstantCFStrings">, DefaultFalse,
2057  NegFlag<SetTrue, [], [ClangOption, CC1Option],
2058          "Disable creation of CodeFoundation-type constant strings">,
2059  PosFlag<SetFalse>>;
2060def fconstant_string_class_EQ : Joined<["-"], "fconstant-string-class=">, Group<f_Group>;
2061def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group<f_Group>,
2062  Visibility<[ClangOption, CC1Option]>,
2063  HelpText<"Set the maximum depth of recursive constexpr function calls">,
2064  MarshallingInfoInt<LangOpts<"ConstexprCallDepth">, "512">;
2065def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group<f_Group>,
2066  Visibility<[ClangOption, CC1Option]>,
2067  HelpText<"Set the maximum number of steps in constexpr function evaluation">,
2068  MarshallingInfoInt<LangOpts<"ConstexprStepLimit">, "1048576">;
2069def fexperimental_new_constant_interpreter : Flag<["-"], "fexperimental-new-constant-interpreter">, Group<f_Group>,
2070  HelpText<"Enable the experimental new constant interpreter">,
2071  Visibility<[ClangOption, CC1Option]>,
2072  MarshallingInfoFlag<LangOpts<"EnableNewConstInterp">>;
2073def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">, Group<f_Group>,
2074  Visibility<[ClangOption, CC1Option]>,
2075  HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit)">,
2076  MarshallingInfoInt<DiagnosticOpts<"ConstexprBacktraceLimit">, "DiagnosticOptions::DefaultConstexprBacktraceLimit">;
2077def fcrash_diagnostics_EQ : Joined<["-"], "fcrash-diagnostics=">, Group<f_clang_Group>,
2078  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
2079  HelpText<"Set level of crash diagnostic reporting, (option: off, compiler, all)">;
2080def fcrash_diagnostics : Flag<["-"], "fcrash-diagnostics">, Group<f_clang_Group>,
2081  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
2082  HelpText<"Enable crash diagnostic reporting (default)">, Alias<fcrash_diagnostics_EQ>, AliasArgs<["compiler"]>;
2083def fno_crash_diagnostics : Flag<["-"], "fno-crash-diagnostics">, Group<f_clang_Group>,
2084  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
2085  Alias<gen_reproducer_eq>, AliasArgs<["off"]>,
2086  HelpText<"Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash">;
2087def fcrash_diagnostics_dir : Joined<["-"], "fcrash-diagnostics-dir=">,
2088  Group<f_clang_Group>, Flags<[NoArgumentUnused]>,
2089  Visibility<[ClangOption, CLOption, DXCOption]>,
2090  HelpText<"Put crash-report files in <dir>">, MetaVarName<"<dir>">;
2091def fcreate_profile : Flag<["-"], "fcreate-profile">, Group<f_Group>;
2092defm cxx_exceptions: BoolFOption<"cxx-exceptions",
2093  LangOpts<"CXXExceptions">, DefaultFalse,
2094  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable C++ exceptions">,
2095  NegFlag<SetFalse>>;
2096defm async_exceptions: BoolFOption<"async-exceptions",
2097  LangOpts<"EHAsynch">, DefaultFalse,
2098  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2099          "Enable EH Asynchronous exceptions">,
2100  NegFlag<SetFalse>>;
2101defm cxx_modules : BoolFOption<"cxx-modules",
2102  LangOpts<"CPlusPlusModules">, Default<cpp20.KeyPath>,
2103  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Disable">,
2104  PosFlag<SetTrue, [], [ClangOption], "Enable">,
2105  BothFlags<[], [], " modules for C++">>,
2106  ShouldParseIf<cplusplus.KeyPath>;
2107def fdebug_pass_arguments : Flag<["-"], "fdebug-pass-arguments">, Group<f_Group>;
2108def fdebug_pass_structure : Flag<["-"], "fdebug-pass-structure">, Group<f_Group>;
2109def fdepfile_entry : Joined<["-"], "fdepfile-entry=">,
2110    Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>;
2111def fdiagnostics_fixit_info : Flag<["-"], "fdiagnostics-fixit-info">, Group<f_clang_Group>;
2112def fno_diagnostics_fixit_info : Flag<["-"], "fno-diagnostics-fixit-info">, Group<f_Group>,
2113  Visibility<[ClangOption, CC1Option]>,
2114  HelpText<"Do not include fixit information in diagnostics">,
2115  MarshallingInfoNegativeFlag<DiagnosticOpts<"ShowFixits">>;
2116def fdiagnostics_parseable_fixits : Flag<["-"], "fdiagnostics-parseable-fixits">, Group<f_clang_Group>,
2117    Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
2118    HelpText<"Print fix-its in machine parseable form">,
2119    MarshallingInfoFlag<DiagnosticOpts<"ShowParseableFixits">>;
2120def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">,
2121    Group<f_clang_Group>,  Visibility<[ClangOption, CC1Option]>,
2122    HelpText<"Print source range spans in numeric form">,
2123    MarshallingInfoFlag<DiagnosticOpts<"ShowSourceRanges">>;
2124defm diagnostics_show_hotness : BoolFOption<"diagnostics-show-hotness",
2125  CodeGenOpts<"DiagnosticsWithHotness">, DefaultFalse,
2126  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2127          "Enable profile hotness information in diagnostic line">,
2128  NegFlag<SetFalse>>;
2129def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">,
2130    Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2131    MetaVarName<"<value>">,
2132    HelpText<"Prevent optimization remarks from being output if they do not have at least this profile count. "
2133    "Use 'auto' to apply the threshold from profile summary">;
2134def fdiagnostics_misexpect_tolerance_EQ : Joined<["-"], "fdiagnostics-misexpect-tolerance=">,
2135    Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2136    MetaVarName<"<value>">,
2137    HelpText<"Prevent misexpect diagnostics from being output if the profile counts are within N% of the expected. ">;
2138defm diagnostics_show_option : BoolFOption<"diagnostics-show-option",
2139    DiagnosticOpts<"ShowOptionNames">, DefaultTrue,
2140    NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
2141    PosFlag<SetTrue, [], [ClangOption], "Print option name with mappable diagnostics">>;
2142defm diagnostics_show_note_include_stack : BoolFOption<"diagnostics-show-note-include-stack",
2143    DiagnosticOpts<"ShowNoteIncludeStack">, DefaultFalse,
2144    PosFlag<SetTrue, [], [ClangOption], "Display include stacks for diagnostic notes">,
2145    NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
2146def fdiagnostics_format_EQ : Joined<["-"], "fdiagnostics-format=">, Group<f_clang_Group>;
2147def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">, Group<f_clang_Group>;
2148def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">,
2149    Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2150    HelpText<"Print a template comparison tree for differing templates">,
2151    MarshallingInfoFlag<DiagnosticOpts<"ShowTemplateTree">>;
2152defm safe_buffer_usage_suggestions : BoolFOption<"safe-buffer-usage-suggestions",
2153  DiagnosticOpts<"ShowSafeBufferUsageSuggestions">, DefaultFalse,
2154  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2155          "Display suggestions to update code associated with -Wunsafe-buffer-usage warnings">,
2156  NegFlag<SetFalse>>;
2157def fverify_intermediate_code : Flag<["-"], "fverify-intermediate-code">,
2158  Group<f_clang_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
2159  HelpText<"Enable verification of LLVM IR">;
2160def fno_verify_intermediate_code : Flag<["-"], "fno-verify-intermediate-code">,
2161  Group<f_clang_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
2162  HelpText<"Disable verification of LLVM IR">;
2163def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">,
2164  Group<f_clang_Group>, Visibility<[ClangOption, DXCOption]>,
2165  HelpText<"Discard value names in LLVM IR">;
2166def fno_discard_value_names : Flag<["-"], "fno-discard-value-names">,
2167  Group<f_clang_Group>, Visibility<[ClangOption, DXCOption]>,
2168  HelpText<"Do not discard value names in LLVM IR">;
2169defm dollars_in_identifiers : BoolFOption<"dollars-in-identifiers",
2170  LangOpts<"DollarIdents">, Default<!strconcat("!", asm_preprocessor.KeyPath)>,
2171  PosFlag<SetTrue, [], [ClangOption], "Allow">,
2172  NegFlag<SetFalse, [], [ClangOption], "Disallow">,
2173  BothFlags<[], [ClangOption, CC1Option], " '$' in identifiers">>;
2174def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
2175def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
2176defm dwarf_directory_asm : BoolFOption<"dwarf-directory-asm",
2177  CodeGenOpts<"NoDwarfDirectoryAsm">, DefaultFalse,
2178  NegFlag<SetTrue, [], [ClangOption, CC1Option]>,
2179  PosFlag<SetFalse>>;
2180defm elide_constructors : BoolFOption<"elide-constructors",
2181  LangOpts<"ElideConstructors">, DefaultTrue,
2182  NegFlag<SetFalse, [], [ClangOption, CC1Option],
2183          "Disable C++ copy constructor elision">,
2184  PosFlag<SetTrue>>;
2185def fno_elide_type : Flag<["-"], "fno-elide-type">, Group<f_Group>,
2186    Visibility<[ClangOption, CC1Option]>,
2187    HelpText<"Do not elide types when printing diagnostics">,
2188    MarshallingInfoNegativeFlag<DiagnosticOpts<"ElideType">>;
2189def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group<f_Group>;
2190defm eliminate_unused_debug_types : OptOutCC1FFlag<"eliminate-unused-debug-types",
2191  "Do not emit ", "Emit ", " debug info for defined but unused types", [ClangOption, CLOption]>;
2192def femit_all_decls : Flag<["-"], "femit-all-decls">, Group<f_Group>,
2193  Visibility<[ClangOption, CC1Option]>,
2194  HelpText<"Emit all declarations, even if unused">,
2195  MarshallingInfoFlag<LangOpts<"EmitAllDecls">>;
2196defm emulated_tls : BoolFOption<"emulated-tls",
2197  CodeGenOpts<"EmulatedTLS">, DefaultFalse,
2198  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2199          "Use emutls functions to access thread_local variables">,
2200  NegFlag<SetFalse>>;
2201def fencoding_EQ : Joined<["-"], "fencoding=">, Group<f_Group>;
2202def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<f_Group>,
2203  Visibility<[ClangOption, CLOption, DXCOption]>;
2204defm exceptions : BoolFOption<"exceptions",
2205  LangOpts<"Exceptions">, DefaultFalse,
2206  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2207  NegFlag<SetFalse, [], [ClangOption], "Disable">,
2208  BothFlags<[], [ClangOption], " support for exception handling">>;
2209def fdwarf_exceptions : Flag<["-"], "fdwarf-exceptions">, Group<f_Group>,
2210  HelpText<"Use DWARF style exceptions">;
2211def fsjlj_exceptions : Flag<["-"], "fsjlj-exceptions">, Group<f_Group>,
2212  HelpText<"Use SjLj style exceptions">;
2213def fseh_exceptions : Flag<["-"], "fseh-exceptions">, Group<f_Group>,
2214  HelpText<"Use SEH style exceptions">;
2215def fwasm_exceptions : Flag<["-"], "fwasm-exceptions">, Group<f_Group>,
2216  HelpText<"Use WebAssembly style exceptions">;
2217def exception_model : Separate<["-"], "exception-model">,
2218  Visibility<[CC1Option]>, HelpText<"The exception model">,
2219  Values<"dwarf,sjlj,seh,wasm">,
2220  NormalizedValuesScope<"LangOptions::ExceptionHandlingKind">,
2221  NormalizedValues<["DwarfCFI", "SjLj", "WinEH", "Wasm"]>,
2222  MarshallingInfoEnum<LangOpts<"ExceptionHandling">, "None">;
2223def exception_model_EQ : Joined<["-"], "exception-model=">,
2224  Visibility<[CC1Option]>, Alias<exception_model>;
2225def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group<f_Group>,
2226  Visibility<[ClangOption, CC1Option]>,
2227  HelpText<"Enable support for ignoring exception handling constructs">,
2228  MarshallingInfoFlag<LangOpts<"IgnoreExceptions">>;
2229defm assume_nothrow_exception_dtor: BoolFOption<"assume-nothrow-exception-dtor",
2230  LangOpts<"AssumeNothrowExceptionDtor">, DefaultFalse,
2231  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Assume that exception objects' destructors are non-throwing">,
2232  NegFlag<SetFalse>>;
2233def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
2234  Visibility<[ClangOption, CLOption]>,
2235  HelpText<"Allows control over excess precision on targets where native "
2236  "support for the precision types is not available. By default, excess "
2237  "precision is used to calculate intermediate results following the "
2238  "rules specified in ISO C99.">,
2239  Values<"standard,fast,none">, NormalizedValuesScope<"LangOptions">,
2240  NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>;
2241def ffloat16_excess_precision_EQ : Joined<["-"], "ffloat16-excess-precision=">,
2242  Group<f_Group>, Visibility<[CC1Option]>,
2243  HelpText<"Allows control over excess precision on targets where native "
2244  "support for Float16 precision types is not available. By default, excess "
2245  "precision is used to calculate intermediate results following the "
2246  "rules specified in ISO C99.">,
2247  Values<"standard,fast,none">, NormalizedValuesScope<"LangOptions">,
2248  NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>,
2249  MarshallingInfoEnum<LangOpts<"Float16ExcessPrecision">, "FPP_Standard">;
2250def fbfloat16_excess_precision_EQ : Joined<["-"], "fbfloat16-excess-precision=">,
2251  Group<f_Group>, Visibility<[CC1Option]>,
2252  HelpText<"Allows control over excess precision on targets where native "
2253  "support for BFloat16 precision types is not available. By default, excess "
2254  "precision is used to calculate intermediate results following the "
2255  "rules specified in ISO C99.">,
2256  Values<"standard,fast,none">, NormalizedValuesScope<"LangOptions">,
2257  NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>,
2258  MarshallingInfoEnum<LangOpts<"BFloat16ExcessPrecision">, "FPP_Standard">;
2259def : Flag<["-"], "fexpensive-optimizations">, Group<clang_ignored_gcc_optimization_f_Group>;
2260def : Flag<["-"], "fno-expensive-optimizations">, Group<clang_ignored_gcc_optimization_f_Group>;
2261def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group<f_Group>;
2262def : Flag<["-"], "fdefer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
2263def : Flag<["-"], "fno-defer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
2264def : Flag<["-"], "fextended-identifiers">, Group<clang_ignored_f_Group>;
2265def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>,
2266  Flags<[Unsupported]>;
2267def fhosted : Flag<["-"], "fhosted">, Group<f_Group>;
2268def fdenormal_fp_math_EQ : Joined<["-"], "fdenormal-fp-math=">, Group<f_Group>,
2269  Visibility<[ClangOption, CC1Option]>;
2270def ffile_reproducible : Flag<["-"], "ffile-reproducible">, Group<f_Group>,
2271  Visibility<[ClangOption, CLOption, CC1Option]>,
2272  HelpText<"Use the target's platform-specific path separator character when "
2273           "expanding the __FILE__ macro">;
2274def fno_file_reproducible : Flag<["-"], "fno-file-reproducible">,
2275  Group<f_Group>, Visibility<[ClangOption, CLOption, CC1Option]>,
2276  HelpText<"Use the host's platform-specific path separator character when "
2277           "expanding the __FILE__ macro">;
2278def ffp_eval_method_EQ : Joined<["-"], "ffp-eval-method=">, Group<f_Group>,
2279  Visibility<[ClangOption, CC1Option]>,
2280  HelpText<"Specifies the evaluation method to use for floating-point arithmetic.">,
2281  Values<"source,double,extended">, NormalizedValuesScope<"LangOptions">,
2282  NormalizedValues<["FEM_Source", "FEM_Double", "FEM_Extended"]>,
2283  MarshallingInfoEnum<LangOpts<"FPEvalMethod">, "FEM_UnsetOnCommandLine">;
2284def ffp_model_EQ : Joined<["-"], "ffp-model=">, Group<f_Group>,
2285  HelpText<"Controls the semantics of floating-point calculations.">;
2286def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<f_Group>,
2287  Visibility<[ClangOption, CC1Option]>,
2288  HelpText<"Specifies the exception behavior of floating-point operations.">,
2289  Values<"ignore,maytrap,strict">, NormalizedValuesScope<"LangOptions">,
2290  NormalizedValues<["FPE_Ignore", "FPE_MayTrap", "FPE_Strict"]>,
2291  MarshallingInfoEnum<LangOpts<"FPExceptionMode">, "FPE_Default">;
2292defm fast_math : BoolFOption<"fast-math",
2293  LangOpts<"FastMath">, Default<hlsl.KeyPath>,
2294  PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
2295          "Allow aggressive, lossy floating-point optimizations",
2296          [cl_fast_relaxed_math.KeyPath]>,
2297  NegFlag<SetFalse, [], [ClangOption, CC1Option, FC1Option, FlangOption]>>;
2298defm math_errno : BoolFOption<"math-errno",
2299  LangOpts<"MathErrno">, DefaultFalse,
2300  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2301          "Require math functions to indicate errors by setting errno">,
2302  NegFlag<SetFalse>>,
2303  ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
2304def fextend_args_EQ : Joined<["-"], "fextend-arguments=">, Group<f_Group>,
2305  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>,
2306  HelpText<"Controls how scalar integer arguments are extended in calls "
2307           "to unprototyped and varargs functions">,
2308  Values<"32,64">,
2309  NormalizedValues<["ExtendTo32", "ExtendTo64"]>,
2310  NormalizedValuesScope<"LangOptions::ExtendArgsKind">,
2311  MarshallingInfoEnum<LangOpts<"ExtendIntArgs">,"ExtendTo32">;
2312def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group<f_Group>,
2313  Visibility<[ClangOption, CLOption]>;
2314def fsignaling_math : Flag<["-"], "fsignaling-math">, Group<f_Group>;
2315def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group<f_Group>;
2316defm jump_tables : BoolFOption<"jump-tables",
2317  CodeGenOpts<"NoUseJumpTables">, DefaultFalse,
2318  NegFlag<SetTrue, [], [ClangOption, CC1Option], "Do not use">,
2319  PosFlag<SetFalse, [], [ClangOption], "Use">,
2320  BothFlags<[], [ClangOption], " jump tables for lowering switches">>;
2321defm force_enable_int128 : BoolFOption<"force-enable-int128",
2322  TargetOpts<"ForceEnableInt128">, DefaultFalse,
2323  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2324  NegFlag<SetFalse, [], [ClangOption], "Disable">,
2325  BothFlags<[], [ClangOption], " support for int128_t type">>;
2326defm keep_static_consts : BoolFOption<"keep-static-consts",
2327  CodeGenOpts<"KeepStaticConsts">, DefaultFalse,
2328  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Keep">,
2329  NegFlag<SetFalse, [], [ClangOption], "Don't keep">,
2330  BothFlags<[], [], " static const variables even if unused">>;
2331defm keep_persistent_storage_variables : BoolFOption<"keep-persistent-storage-variables",
2332  CodeGenOpts<"KeepPersistentStorageVariables">, DefaultFalse,
2333  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2334  NegFlag<SetFalse, [], [ClangOption], "Disable">,
2335  BothFlags<[], [],
2336          " keeping all variables that have a persistent storage duration, including global, static and thread-local variables, to guarantee that they can be directly addressed">>;
2337defm fixed_point : BoolFOption<"fixed-point",
2338  LangOpts<"FixedPoint">, DefaultFalse,
2339  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2340  NegFlag<SetFalse, [], [ClangOption], "Disable">,
2341  BothFlags<[], [ClangOption], " fixed point types">>;
2342def cxx_static_destructors_EQ : Joined<["-"], "fc++-static-destructors=">, Group<f_Group>,
2343  HelpText<"Controls which variables C++ static destructors are registered for">,
2344  Values<"all,thread-local,none">,
2345  NormalizedValues<["All", "ThreadLocal", "None"]>,
2346  NormalizedValuesScope<"LangOptions::RegisterStaticDestructorsKind">,
2347  MarshallingInfoEnum<LangOpts<"RegisterStaticDestructors">, "All">,
2348  Visibility<[ClangOption, CC1Option]>;
2349def cxx_static_destructors : Flag<["-"], "fc++-static-destructors">, Group<f_Group>,
2350  Alias<cxx_static_destructors_EQ>, AliasArgs<["all"]>;
2351def no_cxx_static_destructors : Flag<["-"], "fno-c++-static-destructors">, Group<f_Group>,
2352  Alias<cxx_static_destructors_EQ>, AliasArgs<["none"]>,
2353  HelpText<"Disable C++ static destructor registration">;
2354def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group<f_Group>,
2355  Visibility<[ClangOption, CC1Option]>,
2356  MarshallingInfoString<CodeGenOpts<"SymbolPartition">>;
2357
2358defm memory_profile : OptInCC1FFlag<"memory-profile", "Enable", "Disable", " heap memory profiling">;
2359def fmemory_profile_EQ : Joined<["-"], "fmemory-profile=">,
2360    Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2361    MetaVarName<"<directory>">,
2362    HelpText<"Enable heap memory profiling and dump results into <directory>">;
2363def fmemory_profile_use_EQ : Joined<["-"], "fmemory-profile-use=">,
2364    Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
2365    MetaVarName<"<pathname>">,
2366    HelpText<"Use memory profile for profile-guided memory optimization">,
2367    MarshallingInfoString<CodeGenOpts<"MemoryProfileUsePath">>;
2368
2369// Begin sanitizer flags. These should all be core options exposed in all driver
2370// modes.
2371let Visibility = [ClangOption, CC1Option, CLOption] in {
2372
2373def fsanitize_EQ : CommaJoined<["-"], "fsanitize=">, Group<f_clang_Group>,
2374                   MetaVarName<"<check>">,
2375                   HelpText<"Turn on runtime checks for various forms of undefined "
2376                            "or suspicious behavior. See user manual for available checks">;
2377def fno_sanitize_EQ : CommaJoined<["-"], "fno-sanitize=">, Group<f_clang_Group>,
2378                      Visibility<[ClangOption, CLOption]>;
2379
2380def fsanitize_ignorelist_EQ : Joined<["-"], "fsanitize-ignorelist=">,
2381  Group<f_clang_Group>, HelpText<"Path to ignorelist file for sanitizers">;
2382def : Joined<["-"], "fsanitize-blacklist=">,
2383  Group<f_clang_Group>, Flags<[HelpHidden]>, Alias<fsanitize_ignorelist_EQ>,
2384  HelpText<"Alias for -fsanitize-ignorelist=">;
2385
2386def fsanitize_system_ignorelist_EQ : Joined<["-"], "fsanitize-system-ignorelist=">,
2387  HelpText<"Path to system ignorelist file for sanitizers">,
2388  Visibility<[ClangOption, CC1Option]>;
2389
2390def fno_sanitize_ignorelist : Flag<["-"], "fno-sanitize-ignorelist">,
2391  Group<f_clang_Group>, HelpText<"Don't use ignorelist file for sanitizers">;
2392def : Flag<["-"], "fno-sanitize-blacklist">,
2393  Group<f_clang_Group>, Flags<[HelpHidden]>, Alias<fno_sanitize_ignorelist>;
2394
2395def fsanitize_coverage : CommaJoined<["-"], "fsanitize-coverage=">,
2396  Group<f_clang_Group>,
2397  HelpText<"Specify the type of coverage instrumentation for Sanitizers">;
2398def fno_sanitize_coverage : CommaJoined<["-"], "fno-sanitize-coverage=">,
2399  Group<f_clang_Group>, Visibility<[ClangOption, CLOption]>,
2400  HelpText<"Disable features of coverage instrumentation for Sanitizers">,
2401  Values<"func,bb,edge,indirect-calls,trace-bb,trace-cmp,trace-div,trace-gep,"
2402         "8bit-counters,trace-pc,trace-pc-guard,no-prune,inline-8bit-counters,"
2403         "inline-bool-flag">;
2404def fsanitize_coverage_allowlist : Joined<["-"], "fsanitize-coverage-allowlist=">,
2405    Group<f_clang_Group>, Visibility<[ClangOption, CLOption]>,
2406    HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
2407    MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageAllowlistFiles">>;
2408def fsanitize_coverage_ignorelist : Joined<["-"], "fsanitize-coverage-ignorelist=">,
2409    Group<f_clang_Group>, Visibility<[ClangOption, CLOption]>,
2410    HelpText<"Disable sanitizer coverage instrumentation for modules and functions "
2411             "that match the provided special case list, even the allowed ones">,
2412    MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageIgnorelistFiles">>;
2413def fexperimental_sanitize_metadata_EQ : CommaJoined<["-"], "fexperimental-sanitize-metadata=">,
2414  Group<f_Group>,
2415  HelpText<"Specify the type of metadata to emit for binary analysis sanitizers">;
2416def fno_experimental_sanitize_metadata_EQ : CommaJoined<["-"], "fno-experimental-sanitize-metadata=">,
2417  Group<f_Group>, Visibility<[ClangOption, CLOption]>,
2418  HelpText<"Disable emitting metadata for binary analysis sanitizers">;
2419def fexperimental_sanitize_metadata_ignorelist_EQ : Joined<["-"], "fexperimental-sanitize-metadata-ignorelist=">,
2420    Group<f_Group>, Visibility<[ClangOption, CLOption]>,
2421    HelpText<"Disable sanitizer metadata for modules and functions that match the provided special case list">,
2422    MarshallingInfoStringVector<CodeGenOpts<"SanitizeMetadataIgnorelistFiles">>;
2423def fsanitize_memory_track_origins_EQ : Joined<["-"], "fsanitize-memory-track-origins=">,
2424                                        Group<f_clang_Group>,
2425                                        HelpText<"Enable origins tracking in MemorySanitizer">,
2426                                        MarshallingInfoInt<CodeGenOpts<"SanitizeMemoryTrackOrigins">>;
2427def fsanitize_memory_track_origins : Flag<["-"], "fsanitize-memory-track-origins">,
2428                                     Group<f_clang_Group>,
2429                                     Alias<fsanitize_memory_track_origins_EQ>, AliasArgs<["2"]>,
2430                                     HelpText<"Enable origins tracking in MemorySanitizer">;
2431def fno_sanitize_memory_track_origins : Flag<["-"], "fno-sanitize-memory-track-origins">,
2432                                        Group<f_clang_Group>,
2433                                        Visibility<[ClangOption, CLOption]>,
2434                                        HelpText<"Disable origins tracking in MemorySanitizer">;
2435def fsanitize_address_outline_instrumentation : Flag<["-"], "fsanitize-address-outline-instrumentation">,
2436                                                Group<f_clang_Group>,
2437                                                HelpText<"Always generate function calls for address sanitizer instrumentation">;
2438def fno_sanitize_address_outline_instrumentation : Flag<["-"], "fno-sanitize-address-outline-instrumentation">,
2439                                                   Group<f_clang_Group>,
2440                                                   HelpText<"Use default code inlining logic for the address sanitizer">;
2441defm sanitize_stable_abi
2442  : OptInCC1FFlag<"sanitize-stable-abi", "Stable  ", "Conventional ",
2443    "ABI instrumentation for sanitizer runtime. Default: Conventional">;
2444
2445def fsanitize_memtag_mode_EQ : Joined<["-"], "fsanitize-memtag-mode=">,
2446                                        Group<f_clang_Group>,
2447                                        HelpText<"Set default MTE mode to 'sync' (default) or 'async'">;
2448def fsanitize_hwaddress_experimental_aliasing
2449  : Flag<["-"], "fsanitize-hwaddress-experimental-aliasing">,
2450    Group<f_clang_Group>,
2451    HelpText<"Enable aliasing mode in HWAddressSanitizer">;
2452def fno_sanitize_hwaddress_experimental_aliasing
2453  : Flag<["-"], "fno-sanitize-hwaddress-experimental-aliasing">,
2454    Group<f_clang_Group>,
2455    Visibility<[ClangOption, CLOption]>,
2456    HelpText<"Disable aliasing mode in HWAddressSanitizer">;
2457defm sanitize_memory_use_after_dtor : BoolOption<"f", "sanitize-memory-use-after-dtor",
2458  CodeGenOpts<"SanitizeMemoryUseAfterDtor">, DefaultFalse,
2459  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2460  NegFlag<SetFalse, [], [ClangOption], "Disable">,
2461  BothFlags<[], [ClangOption], " use-after-destroy detection in MemorySanitizer">>,
2462  Group<f_clang_Group>;
2463def fsanitize_address_field_padding : Joined<["-"], "fsanitize-address-field-padding=">,
2464                                        Group<f_clang_Group>,
2465                                        HelpText<"Level of field padding for AddressSanitizer">,
2466                                        MarshallingInfoInt<LangOpts<"SanitizeAddressFieldPadding">>;
2467defm sanitize_address_use_after_scope : BoolOption<"f", "sanitize-address-use-after-scope",
2468  CodeGenOpts<"SanitizeAddressUseAfterScope">, DefaultFalse,
2469  PosFlag<SetTrue, [], [ClangOption], "Enable">,
2470  NegFlag<SetFalse, [], [ClangOption, CLOption],
2471          "Disable">,
2472  BothFlags<[], [ClangOption], " use-after-scope detection in AddressSanitizer">>,
2473  Group<f_clang_Group>;
2474def sanitize_address_use_after_return_EQ
2475  : Joined<["-"], "fsanitize-address-use-after-return=">,
2476    MetaVarName<"<mode>">,
2477    Visibility<[ClangOption, CC1Option]>,
2478    HelpText<"Select the mode of detecting stack use-after-return in AddressSanitizer">,
2479    Group<f_clang_Group>,
2480    Values<"never,runtime,always">,
2481    NormalizedValuesScope<"llvm::AsanDetectStackUseAfterReturnMode">,
2482    NormalizedValues<["Never", "Runtime", "Always"]>,
2483    MarshallingInfoEnum<CodeGenOpts<"SanitizeAddressUseAfterReturn">, "Runtime">;
2484defm sanitize_address_poison_custom_array_cookie : BoolOption<"f", "sanitize-address-poison-custom-array-cookie",
2485  CodeGenOpts<"SanitizeAddressPoisonCustomArrayCookie">, DefaultFalse,
2486  PosFlag<SetTrue, [], [ClangOption], "Enable">,
2487  NegFlag<SetFalse, [], [ClangOption], "Disable">,
2488  BothFlags<[], [ClangOption], " poisoning array cookies when using custom operator new[] in AddressSanitizer">>,
2489  DocBrief<[{Enable "poisoning" array cookies when allocating arrays with a
2490custom operator new\[\] in Address Sanitizer, preventing accesses to the
2491cookies from user code. An array cookie is a small implementation-defined
2492header added to certain array allocations to record metadata such as the
2493length of the array. Accesses to array cookies from user code are technically
2494allowed by the standard but are more likely to be the result of an
2495out-of-bounds array access.
2496
2497An operator new\[\] is "custom" if it is not one of the allocation functions
2498provided by the C++ standard library. Array cookies from non-custom allocation
2499functions are always poisoned.}]>,
2500  Group<f_clang_Group>;
2501defm sanitize_address_globals_dead_stripping : BoolOption<"f", "sanitize-address-globals-dead-stripping",
2502  CodeGenOpts<"SanitizeAddressGlobalsDeadStripping">, DefaultFalse,
2503  PosFlag<SetTrue, [], [ClangOption], "Enable linker dead stripping of globals in AddressSanitizer">,
2504  NegFlag<SetFalse, [], [ClangOption], "Disable linker dead stripping of globals in AddressSanitizer">>,
2505  Group<f_clang_Group>;
2506defm sanitize_address_use_odr_indicator : BoolOption<"f", "sanitize-address-use-odr-indicator",
2507  CodeGenOpts<"SanitizeAddressUseOdrIndicator">, DefaultTrue,
2508  PosFlag<SetTrue, [], [ClangOption], "Enable ODR indicator globals to avoid false ODR violation"
2509            " reports in partially sanitized programs at the cost of an increase in binary size">,
2510  NegFlag<SetFalse, [], [ClangOption], "Disable ODR indicator globals">>,
2511  Group<f_clang_Group>;
2512def sanitize_address_destructor_EQ
2513    : Joined<["-"], "fsanitize-address-destructor=">,
2514      Visibility<[ClangOption, CC1Option]>,
2515      HelpText<"Set the kind of module destructors emitted by "
2516               "AddressSanitizer instrumentation. These destructors are "
2517               "emitted to unregister instrumented global variables when "
2518               "code is unloaded (e.g. via `dlclose()`).">,
2519      Group<f_clang_Group>,
2520      Values<"none,global">,
2521      NormalizedValuesScope<"llvm::AsanDtorKind">,
2522      NormalizedValues<["None", "Global"]>,
2523      MarshallingInfoEnum<CodeGenOpts<"SanitizeAddressDtor">, "Global">;
2524defm sanitize_memory_param_retval
2525    : BoolFOption<"sanitize-memory-param-retval",
2526        CodeGenOpts<"SanitizeMemoryParamRetval">,
2527        DefaultTrue,
2528        PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
2529        NegFlag<SetFalse, [], [ClangOption], "Disable">,
2530        BothFlags<[], [ClangOption], " detection of uninitialized parameters and return values">>;
2531//// Note: This flag was introduced when it was necessary to distinguish between
2532//       ABI for correct codegen.  This is no longer needed, but the flag is
2533//       not removed since targeting either ABI will behave the same.
2534//       This way we cause no disturbance to existing scripts & code, and if we
2535//       want to use this flag in the future we will cause no disturbance then
2536//       either.
2537def fsanitize_hwaddress_abi_EQ
2538    : Joined<["-"], "fsanitize-hwaddress-abi=">,
2539      Group<f_clang_Group>,
2540      HelpText<"Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused.">;
2541def fsanitize_recover_EQ : CommaJoined<["-"], "fsanitize-recover=">,
2542                           Group<f_clang_Group>,
2543                           HelpText<"Enable recovery for specified sanitizers">;
2544def fno_sanitize_recover_EQ : CommaJoined<["-"], "fno-sanitize-recover=">,
2545                              Group<f_clang_Group>,
2546                              Visibility<[ClangOption, CLOption]>,
2547                              HelpText<"Disable recovery for specified sanitizers">;
2548def fsanitize_recover : Flag<["-"], "fsanitize-recover">, Group<f_clang_Group>,
2549                        Alias<fsanitize_recover_EQ>, AliasArgs<["all"]>;
2550def fno_sanitize_recover : Flag<["-"], "fno-sanitize-recover">,
2551                           Visibility<[ClangOption, CLOption]>,
2552                           Group<f_clang_Group>,
2553                           Alias<fno_sanitize_recover_EQ>, AliasArgs<["all"]>;
2554def fsanitize_trap_EQ : CommaJoined<["-"], "fsanitize-trap=">, Group<f_clang_Group>,
2555                        HelpText<"Enable trapping for specified sanitizers">;
2556def fno_sanitize_trap_EQ : CommaJoined<["-"], "fno-sanitize-trap=">, Group<f_clang_Group>,
2557                           Visibility<[ClangOption, CLOption]>,
2558                           HelpText<"Disable trapping for specified sanitizers">;
2559def fsanitize_trap : Flag<["-"], "fsanitize-trap">, Group<f_clang_Group>,
2560                     Alias<fsanitize_trap_EQ>, AliasArgs<["all"]>,
2561                     HelpText<"Enable trapping for all sanitizers">;
2562def fno_sanitize_trap : Flag<["-"], "fno-sanitize-trap">, Group<f_clang_Group>,
2563                        Alias<fno_sanitize_trap_EQ>, AliasArgs<["all"]>,
2564                        Visibility<[ClangOption, CLOption]>,
2565                        HelpText<"Disable trapping for all sanitizers">;
2566def fsanitize_merge_handlers_EQ
2567    : CommaJoined<["-"], "fsanitize-merge=">,
2568      Group<f_clang_Group>,
2569      HelpText<"Allow compiler to merge handlers for specified sanitizers">;
2570def fno_sanitize_merge_handlers_EQ
2571    : CommaJoined<["-"], "fno-sanitize-merge=">,
2572      Group<f_clang_Group>,
2573      HelpText<"Do not allow compiler to merge handlers for specified sanitizers">;
2574def fsanitize_merge_handlers : Flag<["-"], "fsanitize-merge">, Group<f_clang_Group>,
2575                     Alias<fsanitize_merge_handlers_EQ>, AliasArgs<["all"]>,
2576                     HelpText<"Allow compiler to merge handlers for all sanitizers">;
2577def fno_sanitize_merge_handlers : Flag<["-"], "fno-sanitize-merge">, Group<f_clang_Group>,
2578                        Alias<fno_sanitize_merge_handlers_EQ>, AliasArgs<["all"]>,
2579                        Visibility<[ClangOption, CLOption]>,
2580                        HelpText<"Do not allow compiler to merge handlers for any sanitizers">;
2581def fsanitize_undefined_trap_on_error
2582    : Flag<["-"], "fsanitize-undefined-trap-on-error">, Group<f_clang_Group>,
2583      Alias<fsanitize_trap_EQ>, AliasArgs<["undefined"]>;
2584def fno_sanitize_undefined_trap_on_error
2585    : Flag<["-"], "fno-sanitize-undefined-trap-on-error">, Group<f_clang_Group>,
2586      Alias<fno_sanitize_trap_EQ>, AliasArgs<["undefined"]>;
2587defm sanitize_minimal_runtime : BoolOption<"f", "sanitize-minimal-runtime",
2588  CodeGenOpts<"SanitizeMinimalRuntime">, DefaultFalse,
2589  PosFlag<SetTrue>,
2590  NegFlag<SetFalse>>,
2591  Group<f_clang_Group>;
2592def fsanitize_link_runtime : Flag<["-"], "fsanitize-link-runtime">,
2593                           Group<f_clang_Group>;
2594def fno_sanitize_link_runtime : Flag<["-"], "fno-sanitize-link-runtime">,
2595                              Group<f_clang_Group>;
2596def fsanitize_link_cxx_runtime : Flag<["-"], "fsanitize-link-c++-runtime">,
2597                                 Group<f_clang_Group>;
2598def fno_sanitize_link_cxx_runtime : Flag<["-"], "fno-sanitize-link-c++-runtime">,
2599                                    Group<f_clang_Group>;
2600defm sanitize_cfi_cross_dso : BoolOption<"f", "sanitize-cfi-cross-dso",
2601  CodeGenOpts<"SanitizeCfiCrossDso">, DefaultFalse,
2602  PosFlag<SetTrue, [], [ClangOption], "Enable">,
2603  NegFlag<SetFalse, [], [ClangOption, CLOption],
2604          "Disable">,
2605  BothFlags<[], [ClangOption], " control flow integrity (CFI) checks for cross-DSO calls.">>,
2606  Group<f_clang_Group>;
2607def fsanitize_cfi_icall_generalize_pointers : Flag<["-"], "fsanitize-cfi-icall-generalize-pointers">,
2608                                              Group<f_clang_Group>,
2609                                              HelpText<"Generalize pointers in CFI indirect call type signature checks">,
2610                                              MarshallingInfoFlag<CodeGenOpts<"SanitizeCfiICallGeneralizePointers">>;
2611def fsanitize_cfi_icall_normalize_integers : Flag<["-"], "fsanitize-cfi-icall-experimental-normalize-integers">,
2612                                             Group<f_clang_Group>,
2613                                             HelpText<"Normalize integers in CFI indirect call type signature checks">,
2614                                             MarshallingInfoFlag<CodeGenOpts<"SanitizeCfiICallNormalizeIntegers">>;
2615defm sanitize_cfi_canonical_jump_tables : BoolOption<"f", "sanitize-cfi-canonical-jump-tables",
2616  CodeGenOpts<"SanitizeCfiCanonicalJumpTables">, DefaultFalse,
2617  PosFlag<SetTrue, [], [ClangOption], "Make">,
2618  NegFlag<SetFalse, [], [ClangOption, CLOption],
2619          "Do not make">,
2620  BothFlags<[], [ClangOption], " the jump table addresses canonical in the symbol table">>,
2621  Group<f_clang_Group>;
2622defm sanitize_stats : BoolOption<"f", "sanitize-stats",
2623  CodeGenOpts<"SanitizeStats">, DefaultFalse,
2624  PosFlag<SetTrue, [], [ClangOption], "Enable">,
2625  NegFlag<SetFalse, [], [ClangOption, CLOption],
2626          "Disable">,
2627  BothFlags<[], [ClangOption], " sanitizer statistics gathering.">>,
2628  Group<f_clang_Group>;
2629def fsanitize_undefined_ignore_overflow_pattern_EQ : CommaJoined<["-"], "fsanitize-undefined-ignore-overflow-pattern=">,
2630  HelpText<"Specify the overflow patterns to exclude from arithmetic sanitizer instrumentation">,
2631  Visibility<[ClangOption, CC1Option]>,
2632  Values<"none,all,add-unsigned-overflow-test,add-signed-overflow-test,negated-unsigned-const,unsigned-post-decr-while">,
2633  MarshallingInfoStringVector<LangOpts<"OverflowPatternExclusionValues">>;
2634def fsanitize_thread_memory_access : Flag<["-"], "fsanitize-thread-memory-access">,
2635                                     Group<f_clang_Group>,
2636                                     HelpText<"Enable memory access instrumentation in ThreadSanitizer (default)">;
2637def fno_sanitize_thread_memory_access : Flag<["-"], "fno-sanitize-thread-memory-access">,
2638                                        Group<f_clang_Group>,
2639                                        Visibility<[ClangOption, CLOption]>,
2640                                        HelpText<"Disable memory access instrumentation in ThreadSanitizer">;
2641def fsanitize_thread_func_entry_exit : Flag<["-"], "fsanitize-thread-func-entry-exit">,
2642                                       Group<f_clang_Group>,
2643                                       HelpText<"Enable function entry/exit instrumentation in ThreadSanitizer (default)">;
2644def fno_sanitize_thread_func_entry_exit : Flag<["-"], "fno-sanitize-thread-func-entry-exit">,
2645                                          Group<f_clang_Group>,
2646                                          Visibility<[ClangOption, CLOption]>,
2647                                          HelpText<"Disable function entry/exit instrumentation in ThreadSanitizer">;
2648def fsanitize_thread_atomics : Flag<["-"], "fsanitize-thread-atomics">,
2649                               Group<f_clang_Group>,
2650                               HelpText<"Enable atomic operations instrumentation in ThreadSanitizer (default)">;
2651def fno_sanitize_thread_atomics : Flag<["-"], "fno-sanitize-thread-atomics">,
2652                                  Group<f_clang_Group>,
2653                                  Visibility<[ClangOption, CLOption]>,
2654                                  HelpText<"Disable atomic operations instrumentation in ThreadSanitizer">;
2655def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-undefined-strip-path-components=">,
2656  Group<f_clang_Group>, MetaVarName<"<number>">,
2657  HelpText<"Strip (or keep only, if negative) a given number of path components "
2658           "when emitting check metadata.">,
2659  MarshallingInfoInt<CodeGenOpts<"EmitCheckPathComponentsToStrip">, "0", "int">;
2660def fsanitize_skip_hot_cutoff_EQ
2661    : CommaJoined<["-"], "fsanitize-skip-hot-cutoff=">,
2662      Group<f_clang_Group>,
2663      HelpText<
2664          "Exclude sanitization for the top hottest code responsible for "
2665          "the given fraction of PGO counters "
2666          "(0.0 [default] = skip none; 1.0 = skip all). "
2667          "Argument format: <sanitizer1>=<value1>,<sanitizer2>=<value2>,...">;
2668
2669} // end -f[no-]sanitize* flags
2670
2671def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">,
2672  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2673  HelpText<"Allow unsafe floating-point math optimizations which may decrease precision">,
2674  MarshallingInfoFlag<LangOpts<"UnsafeFPMath">>,
2675  ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, ffast_math.KeyPath]>;
2676def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">,
2677  Group<f_Group>;
2678def fassociative_math : Flag<["-"], "fassociative-math">, Visibility<[ClangOption, FlangOption]>, Group<f_Group>;
2679def fno_associative_math : Flag<["-"], "fno-associative-math">, Visibility<[ClangOption, FlangOption]>, Group<f_Group>;
2680defm reciprocal_math : BoolFOption<"reciprocal-math",
2681  LangOpts<"AllowRecip">, DefaultFalse,
2682  PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
2683          "Allow division operations to be reassociated",
2684          [funsafe_math_optimizations.KeyPath]>,
2685  NegFlag<SetFalse, [], [ClangOption, CC1Option, FC1Option, FlangOption]>>;
2686defm approx_func : BoolFOption<"approx-func", LangOpts<"ApproxFunc">, DefaultFalse,
2687   PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
2688           "Allow certain math function calls to be replaced "
2689           "with an approximately equivalent calculation",
2690           [funsafe_math_optimizations.KeyPath]>,
2691   NegFlag<SetFalse, [], [ClangOption, CC1Option, FC1Option, FlangOption]>>;
2692defm finite_math_only : BoolOptionWithoutMarshalling<"f", "finite-math-only",
2693  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2694          "Allow floating-point optimizations that "
2695          "assume arguments and results are not NaNs or +-inf. This defines "
2696          "the \\_\\_FINITE\\_MATH\\_ONLY\\_\\_ preprocessor macro.",
2697          [ffast_math.KeyPath]>,
2698  NegFlag<SetFalse>>;
2699defm signed_zeros : BoolFOption<"signed-zeros",
2700  LangOpts<"NoSignedZero">, DefaultFalse,
2701  NegFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
2702          "Allow optimizations that ignore the sign of floating point zeros",
2703            [cl_no_signed_zeros.KeyPath, funsafe_math_optimizations.KeyPath]>,
2704  PosFlag<SetFalse, [], [ClangOption, CC1Option, FC1Option, FlangOption]>>;
2705def fhonor_nans : Flag<["-"], "fhonor-nans">, Group<f_Group>,
2706  Visibility<[ClangOption, FlangOption]>,
2707  HelpText<"Specify that floating-point optimizations are not allowed that "
2708           "assume arguments and results are not NANs.">;
2709def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Visibility<[ClangOption, FlangOption]>, Group<f_Group>;
2710def fhonor_infinities : Flag<["-"], "fhonor-infinities">,
2711  Group<f_Group>, Visibility<[ClangOption, FlangOption]>,
2712  HelpText<"Specify that floating-point optimizations are not allowed that "
2713           "assume arguments and results are not +-inf.">;
2714def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">,
2715  Visibility<[ClangOption, FlangOption]>, Group<f_Group>;
2716// This option was originally misspelt "infinites" [sic].
2717def : Flag<["-"], "fhonor-infinites">, Alias<fhonor_infinities>;
2718def : Flag<["-"], "fno-honor-infinites">, Alias<fno_honor_infinities>;
2719def frounding_math : Flag<["-"], "frounding-math">, Group<f_Group>,
2720  Visibility<[ClangOption, CC1Option]>,
2721  MarshallingInfoFlag<LangOpts<"RoundingMath">>,
2722  Normalizer<"makeFlagToValueNormalizer(llvm::RoundingMode::Dynamic)">;
2723def fno_rounding_math : Flag<["-"], "fno-rounding-math">, Group<f_Group>,
2724  Visibility<[ClangOption, CC1Option]>;
2725def ftrapping_math : Flag<["-"], "ftrapping-math">, Group<f_Group>;
2726def fno_trapping_math : Flag<["-"], "fno-trapping-math">, Group<f_Group>;
2727def ffp_contract : Joined<["-"], "ffp-contract=">, Group<f_Group>,
2728  Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>,
2729  DocBrief<"Form fused FP ops (e.g. FMAs):"
2730  " fast (fuses across statements disregarding pragmas)"
2731  " | on (only fuses in the same statement unless dictated by pragmas)"
2732  " | off (never fuses)"
2733  " | fast-honor-pragmas (fuses across statements unless dictated by pragmas)."
2734  " Default is 'fast' for CUDA, 'fast-honor-pragmas' for HIP, and 'on' otherwise.">,
2735  HelpText<"Form fused FP ops (e.g. FMAs)">,
2736  Values<"fast,on,off,fast-honor-pragmas">;
2737
2738defm strict_float_cast_overflow : BoolFOption<"strict-float-cast-overflow",
2739  CodeGenOpts<"StrictFloatCastOverflow">, DefaultTrue,
2740  NegFlag<SetFalse, [], [ClangOption, CC1Option],
2741          "Relax language rules and try to match the behavior"
2742            " of the target's native float-to-int conversion instructions">,
2743  PosFlag<SetTrue, [], [ClangOption], "Assume that overflowing float-to-int casts are undefined (default)">>;
2744
2745defm protect_parens : BoolFOption<"protect-parens",
2746  LangOpts<"ProtectParens">, DefaultFalse,
2747  PosFlag<SetTrue, [], [ClangOption, CLOption, CC1Option],
2748          "Determines whether the optimizer honors parentheses when "
2749          "floating-point expressions are evaluated">,
2750  NegFlag<SetFalse>>;
2751
2752defm daz_ftz : SimpleMFlag<"daz-ftz",
2753  "Globally set", "Do not globally set",
2754  " the denormals-are-zero (DAZ) and flush-to-zero (FTZ) bits in the "
2755  "floating-point control register on program startup">;
2756
2757def ffor_scope : Flag<["-"], "ffor-scope">, Group<f_Group>;
2758def fno_for_scope : Flag<["-"], "fno-for-scope">, Group<f_Group>;
2759
2760defm rewrite_imports : BoolFOption<"rewrite-imports",
2761  PreprocessorOutputOpts<"RewriteImports">, DefaultFalse,
2762  PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
2763  NegFlag<SetFalse>>;
2764defm rewrite_includes : BoolFOption<"rewrite-includes",
2765  PreprocessorOutputOpts<"RewriteIncludes">, DefaultFalse,
2766  PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
2767  NegFlag<SetFalse>>;
2768
2769defm directives_only : OptInCC1FFlag<"directives-only", "">;
2770
2771defm delete_null_pointer_checks : BoolFOption<"delete-null-pointer-checks",
2772  CodeGenOpts<"NullPointerIsValid">, DefaultFalse,
2773  NegFlag<SetTrue, [], [ClangOption, CC1Option],
2774          "Do not treat usage of null pointers as undefined behavior">,
2775  PosFlag<SetFalse, [], [ClangOption], "Treat usage of null pointers as undefined behavior (default)">,
2776  BothFlags<[], [ClangOption, CLOption]>>,
2777  DocBrief<[{When enabled, treat null pointer dereference, creation of a reference to null,
2778or passing a null pointer to a function parameter annotated with the "nonnull"
2779attribute as undefined behavior. (And, thus the optimizer may assume that any
2780pointer used in such a way must not have been null and optimize away the
2781branches accordingly.) On by default.}]>;
2782
2783defm use_line_directives : BoolFOption<"use-line-directives",
2784  PreprocessorOutputOpts<"UseLineDirectives">, DefaultFalse,
2785  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2786          "Use #line in preprocessed output">,
2787  NegFlag<SetFalse>>;
2788defm minimize_whitespace : BoolFOption<"minimize-whitespace",
2789  PreprocessorOutputOpts<"MinimizeWhitespace">, DefaultFalse,
2790  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2791          "Ignore the whitespace from the input file "
2792          "when emitting preprocessor output. It will only contain whitespace "
2793          "when necessary, e.g. to keep two minus signs from merging into to "
2794          "an increment operator. Useful with the -P option to normalize "
2795          "whitespace such that two files with only formatting changes are "
2796          "equal.\n\nOnly valid with -E on C-like inputs and incompatible "
2797          "with -traditional-cpp.">, NegFlag<SetFalse>>;
2798defm keep_system_includes : BoolFOption<"keep-system-includes",
2799  PreprocessorOutputOpts<"KeepSystemIncludes">, DefaultFalse,
2800  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2801          "Instead of expanding system headers when emitting preprocessor "
2802          "output, preserve the #include directive. Useful when producing "
2803          "preprocessed output for test case reduction. May produce incorrect "
2804          "output if preprocessor symbols that control the included content "
2805          "(e.g. _XOPEN_SOURCE) are defined in the including source file. The "
2806          "portability of the resulting source to other compilation environments "
2807          "is not guaranteed.\n\nOnly valid with -E.">,
2808  NegFlag<SetFalse>>;
2809
2810def ffreestanding : Flag<["-"], "ffreestanding">, Group<f_Group>,
2811  Visibility<[ClangOption, CC1Option]>,
2812  HelpText<"Assert that the compilation takes place in a freestanding environment">,
2813  MarshallingInfoFlag<LangOpts<"Freestanding">>;
2814def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group<f_Group>,
2815  HelpText<"Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)">,
2816  Visibility<[ClangOption, CC1Option, CLOption]>;
2817// We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension
2818// keywords. This behavior is provided by GCC's poorly named '-fasm' flag,
2819// while a subset (the non-C++ GNU keywords) is provided by GCC's
2820// '-fgnu-keywords'. Clang conflates the two for simplicity under the single
2821// name, as it doesn't seem a useful distinction.
2822defm gnu_keywords : BoolFOption<"gnu-keywords",
2823  LangOpts<"GNUKeywords">, Default<gnu_mode.KeyPath>,
2824  PosFlag<SetTrue, [], [ClangOption], "Allow GNU-extension keywords regardless of language standard">,
2825  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
2826defm gnu89_inline : BoolFOption<"gnu89-inline",
2827  LangOpts<"GNUInline">, Default<!strconcat("!", c99.KeyPath, " && !", cplusplus.KeyPath)>,
2828  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2829          "Use the gnu89 inline semantics">,
2830  NegFlag<SetFalse>>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
2831def fgnu_runtime : Flag<["-"], "fgnu-runtime">, Group<f_Group>,
2832  HelpText<"Generate output compatible with the standard GNU Objective-C runtime">;
2833// This used to be a standalone flag but is now mapped to
2834// -Wno-error=invalid-gnu-asm-cast, which is the only thing the flag used to
2835// control.
2836def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">,
2837  Alias<W_Joined>, AliasArgs<["no-error=invalid-gnu-asm-cast"]>,
2838  HelpText<"(Deprecated) Controls whether '-Winvalid-gnu-asm-cast' defaults to "
2839           "an error or a warning">;
2840def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>,
2841               Group<Link_Group>;
2842def : Flag<["-"], "findirect-virtual-calls">, Alias<fapple_kext>;
2843def finline_functions : Flag<["-"], "finline-functions">, Group<f_clang_Group>,
2844  Visibility<[ClangOption, CC1Option]>,
2845  HelpText<"Inline suitable functions">;
2846def finline_hint_functions: Flag<["-"], "finline-hint-functions">, Group<f_clang_Group>,
2847  Visibility<[ClangOption, CC1Option]>,
2848  HelpText<"Inline functions which are (explicitly or implicitly) marked inline">;
2849def finline : Flag<["-"], "finline">, Group<clang_ignored_f_Group>;
2850def finline_max_stacksize_EQ
2851    : Joined<["-"], "finline-max-stacksize=">,
2852      Group<f_Group>, Visibility<[ClangOption, CLOption, CC1Option]>,
2853      HelpText<"Suppress inlining of functions whose stack size exceeds the given value">,
2854      MarshallingInfoInt<CodeGenOpts<"InlineMaxStackSize">, "UINT_MAX">;
2855defm jmc : BoolFOption<"jmc",
2856  CodeGenOpts<"JMCInstrument">, DefaultFalse,
2857  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2858          "Enable just-my-code debugging">,
2859  NegFlag<SetFalse>>;
2860def fglobal_isel : Flag<["-"], "fglobal-isel">, Group<f_clang_Group>,
2861  HelpText<"Enables the global instruction selector">;
2862def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group<f_clang_Group>,
2863  Alias<fglobal_isel>;
2864def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">,
2865  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
2866  HelpText<"Enables the use of non-default rounding modes and non-default exception handling on targets that are not currently ready.">,
2867  MarshallingInfoFlag<LangOpts<"ExpStrictFP">>;
2868def finput_charset_EQ : Joined<["-"], "finput-charset=">,
2869  Visibility<[ClangOption, FlangOption, FC1Option]>, Group<f_Group>,
2870  HelpText<"Specify the default character set for source files">;
2871def fexec_charset_EQ : Joined<["-"], "fexec-charset=">, Group<f_Group>;
2872def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>,
2873  Visibility<[ClangOption, CC1Option]>,
2874  HelpText<"Generate calls to instrument function entry and exit">,
2875  MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctions">>;
2876def finstrument_functions_after_inlining : Flag<["-"], "finstrument-functions-after-inlining">, Group<f_Group>,
2877  Visibility<[ClangOption, CC1Option]>,
2878  HelpText<"Like -finstrument-functions, but insert the calls after inlining">,
2879  MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionsAfterInlining">>;
2880def finstrument_function_entry_bare : Flag<["-"], "finstrument-function-entry-bare">, Group<f_Group>,
2881  Visibility<[ClangOption, CC1Option]>,
2882  HelpText<"Instrument function entry only, after inlining, without arguments to the instrumentation call">,
2883  MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionEntryBare">>;
2884def fcf_protection_EQ : Joined<["-"], "fcf-protection=">,
2885  Visibility<[ClangOption, CLOption, CC1Option]>, Group<f_Group>,
2886  HelpText<"Instrument control-flow architecture protection">, Values<"return,branch,full,none">;
2887def fcf_protection : Flag<["-"], "fcf-protection">, Group<f_Group>,
2888  Visibility<[ClangOption, CLOption, CC1Option]>,
2889  Alias<fcf_protection_EQ>, AliasArgs<["full"]>,
2890  HelpText<"Enable cf-protection in 'full' mode">;
2891def mcf_branch_label_scheme_EQ : Joined<["-"], "mcf-branch-label-scheme=">,
2892  Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
2893  HelpText<"Select label scheme for branch control-flow architecture protection">,
2894  Values<"unlabeled,func-sig">;
2895def mfunction_return_EQ : Joined<["-"], "mfunction-return=">,
2896  Group<m_Group>, Visibility<[ClangOption, CLOption, CC1Option]>,
2897  HelpText<"Replace returns with jumps to ``__x86_return_thunk`` (x86 only, error otherwise)">,
2898  Values<"keep,thunk-extern">,
2899  NormalizedValues<["Keep", "Extern"]>,
2900  NormalizedValuesScope<"llvm::FunctionReturnThunksKind">,
2901  MarshallingInfoEnum<CodeGenOpts<"FunctionReturnThunks">, "Keep">;
2902def mindirect_branch_cs_prefix : Flag<["-"], "mindirect-branch-cs-prefix">,
2903  Group<m_Group>, Visibility<[ClangOption, CLOption, CC1Option]>,
2904  HelpText<"Add cs prefix to call and jmp to indirect thunk">,
2905  MarshallingInfoFlag<CodeGenOpts<"IndirectBranchCSPrefix">>;
2906
2907defm xray_instrument : BoolFOption<"xray-instrument",
2908  LangOpts<"XRayInstrument">, DefaultFalse,
2909  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2910          "Generate XRay instrumentation sleds on function entry and exit">,
2911  NegFlag<SetFalse>>;
2912
2913def fxray_instruction_threshold_EQ :
2914  Joined<["-"], "fxray-instruction-threshold=">,
2915  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2916  HelpText<"Sets the minimum function size to instrument with XRay">,
2917  MarshallingInfoInt<CodeGenOpts<"XRayInstructionThreshold">, "200">;
2918
2919def fxray_always_instrument :
2920  Joined<["-"], "fxray-always-instrument=">,
2921  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2922  HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.">,
2923  MarshallingInfoStringVector<LangOpts<"XRayAlwaysInstrumentFiles">>;
2924def fxray_never_instrument :
2925  Joined<["-"], "fxray-never-instrument=">,
2926  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2927  HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.">,
2928  MarshallingInfoStringVector<LangOpts<"XRayNeverInstrumentFiles">>;
2929def fxray_attr_list :
2930  Joined<["-"], "fxray-attr-list=">,
2931  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2932  HelpText<"Filename defining the list of functions/types for imbuing XRay attributes.">,
2933  MarshallingInfoStringVector<LangOpts<"XRayAttrListFiles">>;
2934def fxray_modes :
2935  Joined<["-"], "fxray-modes=">,
2936  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2937  HelpText<"List of modes to link in by default into XRay instrumented binaries.">;
2938
2939defm xray_always_emit_customevents : BoolFOption<"xray-always-emit-customevents",
2940  LangOpts<"XRayAlwaysEmitCustomEvents">, DefaultFalse,
2941  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2942          "Always emit __xray_customevent(...) calls"
2943          " even if the containing function is not always instrumented">,
2944  NegFlag<SetFalse>>;
2945
2946defm xray_always_emit_typedevents : BoolFOption<"xray-always-emit-typedevents",
2947  LangOpts<"XRayAlwaysEmitTypedEvents">, DefaultFalse,
2948  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2949          "Always emit __xray_typedevent(...) calls"
2950          " even if the containing function is not always instrumented">,
2951  NegFlag<SetFalse>>;
2952
2953defm xray_ignore_loops : BoolFOption<"xray-ignore-loops",
2954  CodeGenOpts<"XRayIgnoreLoops">, DefaultFalse,
2955  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2956          "Don't instrument functions with loops"
2957          " unless they also meet the minimum function size">,
2958  NegFlag<SetFalse>>;
2959
2960defm xray_function_index : BoolFOption<"xray-function-index",
2961  CodeGenOpts<"XRayFunctionIndex">, DefaultTrue,
2962  PosFlag<SetTrue, [], [ClangOption]>,
2963  NegFlag<SetFalse, [], [ClangOption, CC1Option],
2964          "Omit function index section at the"
2965          " expense of single-function patching performance">>;
2966
2967def fxray_link_deps : Flag<["-"], "fxray-link-deps">, Group<f_Group>,
2968  HelpText<"Link XRay runtime library when -fxray-instrument is specified (default)">;
2969def fno_xray_link_deps : Flag<["-"], "fno-xray-link-deps">, Group<f_Group>;
2970
2971def fxray_instrumentation_bundle :
2972  Joined<["-"], "fxray-instrumentation-bundle=">,
2973  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2974  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'.">;
2975
2976def fxray_function_groups :
2977  Joined<["-"], "fxray-function-groups=">,
2978  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2979  HelpText<"Only instrument 1 of N groups">,
2980  MarshallingInfoInt<CodeGenOpts<"XRayTotalFunctionGroups">, "1">;
2981
2982def fxray_selected_function_group :
2983  Joined<["-"], "fxray-selected-function-group=">,
2984  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
2985  HelpText<"When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1">,
2986  MarshallingInfoInt<CodeGenOpts<"XRaySelectedFunctionGroup">, "0">;
2987
2988defm xray_shared : BoolFOption<"xray-shared",
2989  CodeGenOpts<"XRayShared">, DefaultFalse,
2990  PosFlag<SetTrue, [], [ClangOption, CC1Option],
2991          "Enable shared library instrumentation with XRay">,
2992  NegFlag<SetFalse>>;
2993
2994defm fine_grained_bitfield_accesses : BoolOption<"f", "fine-grained-bitfield-accesses",
2995  CodeGenOpts<"FineGrainedBitfieldAccesses">, DefaultFalse,
2996  PosFlag<SetTrue, [], [ClangOption], "Use separate accesses for consecutive bitfield runs with legal widths and alignments.">,
2997  NegFlag<SetFalse, [], [ClangOption], "Use large-integer access for consecutive bitfield runs.">,
2998  BothFlags<[], [ClangOption, CC1Option]>>,
2999  Group<f_clang_Group>;
3000
3001def fexperimental_relative_cxx_abi_vtables :
3002  Flag<["-"], "fexperimental-relative-c++-abi-vtables">,
3003  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
3004  HelpText<"Use the experimental C++ class ABI for classes with virtual tables">;
3005def fno_experimental_relative_cxx_abi_vtables :
3006  Flag<["-"], "fno-experimental-relative-c++-abi-vtables">,
3007  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
3008  HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">;
3009
3010defm experimental_omit_vtable_rtti : BoolFOption<"experimental-omit-vtable-rtti",
3011  LangOpts<"OmitVTableRTTI">, DefaultFalse,
3012  PosFlag<SetTrue, [], [CC1Option], "Omit">,
3013  NegFlag<SetFalse, [], [CC1Option], "Do not omit">,
3014  BothFlags<[], [CC1Option], " the RTTI component from virtual tables">>;
3015
3016def fcxx_abi_EQ : Joined<["-"], "fc++-abi=">,
3017                  Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
3018                  HelpText<"C++ ABI to use. This will override the target C++ ABI.">;
3019
3020def flat__namespace : Flag<["-"], "flat_namespace">;
3021def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, Group<f_Group>,
3022  HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">,
3023  Visibility<[ClangOption, CC1Option]>,
3024  NormalizedValues<["LangOptions::LaxVectorConversionKind::None",
3025                    "LangOptions::LaxVectorConversionKind::Integer",
3026                    "LangOptions::LaxVectorConversionKind::All"]>,
3027  MarshallingInfoEnum<LangOpts<"LaxVectorConversions">,
3028                      !strconcat("(", open_cl.KeyPath, " || ", hlsl.KeyPath, ")") #
3029                          " ? LangOptions::LaxVectorConversionKind::None" #
3030                          " : LangOptions::LaxVectorConversionKind::All">;
3031def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Group>,
3032  Alias<flax_vector_conversions_EQ>, AliasArgs<["integer"]>;
3033def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
3034def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group<f_Group>,
3035  HelpText<"Force linking the clang builtins runtime library">;
3036
3037/// ClangIR-specific options - BEGIN
3038defm clangir : BoolFOption<"clangir",
3039  FrontendOpts<"UseClangIRPipeline">, DefaultFalse,
3040  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use the ClangIR pipeline to compile">,
3041  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Use the AST -> LLVM pipeline to compile">,
3042  BothFlags<[], [ClangOption, CC1Option], "">>;
3043def emit_cir : Flag<["-"], "emit-cir">, Visibility<[ClangOption, CC1Option]>,
3044  Group<Action_Group>, HelpText<"Build ASTs and then lower to ClangIR">;
3045/// ClangIR-specific options - END
3046
3047def flto_EQ : Joined<["-"], "flto=">,
3048  Visibility<[ClangOption, CLOption, CC1Option, FC1Option, FlangOption]>,
3049  Group<f_Group>,
3050  HelpText<"Set LTO mode">, Values<"thin,full">;
3051def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Visibility<[ClangOption, FlangOption]>, Group<f_Group>,
3052  Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
3053def flto_EQ_auto : Flag<["-"], "flto=auto">, Visibility<[ClangOption, FlangOption]>, Group<f_Group>,
3054  Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
3055def flto : Flag<["-"], "flto">,
3056  Visibility<[ClangOption, CLOption, CC1Option, FC1Option, FlangOption]>,
3057  Group<f_Group>,
3058  Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
3059defm unified_lto : BoolFOption<"unified-lto",
3060  CodeGenOpts<"UnifiedLTO">, DefaultFalse,
3061  PosFlag<SetTrue, [], [ClangOption], "Use the unified LTO pipeline">,
3062  NegFlag<SetFalse, [], [ClangOption], "Use distinct LTO pipelines">,
3063  BothFlags<[], [ClangOption, CC1Option], "">>;
3064def fno_lto : Flag<["-"], "fno-lto">,
3065  Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FlangOption]>, Group<f_Group>,
3066  HelpText<"Disable LTO mode (default)">;
3067def foffload_lto_EQ : Joined<["-"], "foffload-lto=">,
3068  Visibility<[ClangOption, CLOption]>, Group<f_Group>,
3069  HelpText<"Set LTO mode for offload compilation">, Values<"thin,full">;
3070def foffload_lto : Flag<["-"], "foffload-lto">,
3071  Visibility<[ClangOption, CLOption]>, Group<f_Group>,
3072  Alias<foffload_lto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode for offload compilation">;
3073def fno_offload_lto : Flag<["-"], "fno-offload-lto">,
3074  Visibility<[ClangOption, CLOption]>, Group<f_Group>,
3075  HelpText<"Disable LTO mode (default) for offload compilation">;
3076def flto_jobs_EQ : Joined<["-"], "flto-jobs=">,
3077  Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
3078  HelpText<"Controls the backend parallelism of -flto=thin (default "
3079           "of 0 means the number of threads will be derived from "
3080           "the number of CPUs detected)">;
3081def fthinlto_index_EQ : Joined<["-"], "fthinlto-index=">,
3082  Visibility<[ClangOption, CLOption, CC1Option]>, Group<f_Group>,
3083  HelpText<"Perform ThinLTO importing using provided function summary index">;
3084def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
3085  Visibility<[ClangOption, CLOption, CC1Option]>, Group<f_Group>,
3086  HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">,
3087  MarshallingInfoString<CodeGenOpts<"ThinLinkBitcodeFile">>;
3088defm fat_lto_objects : BoolFOption<"fat-lto-objects",
3089  CodeGenOpts<"FatLTO">, DefaultFalse,
3090  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
3091  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Disable">,
3092  BothFlags<[], [ClangOption, CC1Option], " fat LTO object support">>;
3093def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
3094  Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption]>,
3095  HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit)">,
3096  MarshallingInfoInt<DiagnosticOpts<"MacroBacktraceLimit">, "DiagnosticOptions::DefaultMacroBacktraceLimit">;
3097def fcaret_diagnostics_max_lines_EQ :
3098  Joined<["-"], "fcaret-diagnostics-max-lines=">,
3099  Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
3100  HelpText<"Set the maximum number of source lines to show in a caret diagnostic (0 = no limit).">,
3101  MarshallingInfoInt<DiagnosticOpts<"SnippetLineLimit">, "DiagnosticOptions::DefaultSnippetLineLimit">;
3102defm merge_all_constants : BoolFOption<"merge-all-constants",
3103  CodeGenOpts<"MergeAllConstants">, DefaultFalse,
3104  PosFlag<SetTrue, [], [ClangOption, CC1Option, CLOption], "Allow">,
3105  NegFlag<SetFalse, [], [ClangOption], "Disallow">,
3106  BothFlags<[], [ClangOption], " merging of constants">>;
3107def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>,
3108  Visibility<[ClangOption, CC1Option]>,
3109  HelpText<"Format message diagnostics so that they fit within N columns">,
3110  MarshallingInfoInt<DiagnosticOpts<"MessageLength">>;
3111def frandomize_layout_seed_EQ : Joined<["-"], "frandomize-layout-seed=">,
3112  MetaVarName<"<seed>">, Group<f_clang_Group>,
3113  Visibility<[ClangOption, CC1Option]>,
3114  HelpText<"The seed used by the randomize structure layout feature">;
3115def frandomize_layout_seed_file_EQ : Joined<["-"], "frandomize-layout-seed-file=">,
3116  MetaVarName<"<file>">, Group<f_clang_Group>,
3117  Visibility<[ClangOption, CC1Option]>,
3118  HelpText<"File holding the seed used by the randomize structure layout feature">;
3119def fms_compatibility : Flag<["-"], "fms-compatibility">, Group<f_Group>,
3120  Visibility<[ClangOption, CC1Option, CLOption]>,
3121  HelpText<"Enable full Microsoft Visual C++ compatibility">,
3122  MarshallingInfoFlag<LangOpts<"MSVCCompat">>;
3123def fms_define_stdc : Flag<["-"], "fms-define-stdc">, Group<f_Group>,
3124  Visibility<[ClangOption, CC1Option, CLOption]>,
3125  HelpText<"Define '__STDC__' to '1' in MSVC Compatibility mode">,
3126  MarshallingInfoFlag<LangOpts<"MSVCEnableStdcMacro">>;
3127def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>,
3128  Visibility<[ClangOption, CC1Option, CLOption]>,
3129  HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">,
3130  MarshallingInfoFlag<LangOpts<"MicrosoftExt">>, ImpliedByAnyOf<[fms_compatibility.KeyPath]>;
3131defm asm_blocks : BoolFOption<"asm-blocks",
3132  LangOpts<"AsmBlocks">, Default<fms_extensions.KeyPath>,
3133  PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
3134  NegFlag<SetFalse>>;
3135defm ms_volatile : BoolFOption<"ms-volatile",
3136  LangOpts<"MSVolatile">, DefaultFalse,
3137  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3138          "Volatile loads and stores have acquire and release semantics">,
3139  NegFlag<SetFalse>>;
3140def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>,
3141  Visibility<[ClangOption, CLOption]>,
3142  HelpText<"Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default))">;
3143def fms_compatibility_version
3144    : Joined<["-"], "fms-compatibility-version=">,
3145      Group<f_Group>,
3146      Visibility<[ClangOption, CC1Option, CLOption]>,
3147      HelpText<"Dot-separated value representing the Microsoft compiler "
3148               "version number to report in _MSC_VER (0 = don't define it "
3149               "(default))">;
3150def fms_runtime_lib_EQ : Joined<["-"], "fms-runtime-lib=">, Group<f_Group>,
3151  Flags<[]>, Visibility<[ClangOption, CLOption, FlangOption]>,
3152  Values<"static,static_dbg,dll,dll_dbg">,
3153  HelpText<"Select Windows run-time library">,
3154  DocBrief<[{
3155Specify Visual Studio C runtime library. "static" and "static_dbg" correspond
3156to the cl flags /MT and /MTd which use the multithread, static version. "dll"
3157and "dll_dbg" correspond to the cl flags /MD and /MDd which use the multithread,
3158dll version.}]>;
3159def fms_omit_default_lib : Joined<["-"], "fms-omit-default-lib">,
3160  Group<f_Group>, Flags<[]>,
3161  Visibility<[ClangOption, CLOption]>;
3162def fzos_extensions : Flag<["-"], "fzos-extensions">, Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3163  HelpText<"Accept some non-standard constructs supported by the z/OS compiler">;
3164def fno_zos_extensions : Flag<["-"], "fno-zos-extensions">, Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3165  HelpText<"Do not accept non-standard constructs supported by the z/OS compiler">;
3166defm delayed_template_parsing : BoolFOption<"delayed-template-parsing",
3167  LangOpts<"DelayedTemplateParsing">, DefaultFalse,
3168  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3169          "Parse templated function definitions at the end of the translation unit">,
3170  NegFlag<SetFalse, [], [], "Disable delayed template parsing">,
3171  BothFlags<[], [ClangOption, CLOption]>>;
3172def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group<f_Group>,
3173  Visibility<[ClangOption, CC1Option]>,
3174  Values<"single,multiple,virtual">, NormalizedValuesScope<"LangOptions">,
3175  NormalizedValues<["PPTMK_FullGeneralitySingleInheritance", "PPTMK_FullGeneralityMultipleInheritance",
3176                    "PPTMK_FullGeneralityVirtualInheritance"]>,
3177  MarshallingInfoEnum<LangOpts<"MSPointerToMemberRepresentationMethod">, "PPTMK_BestCase">;
3178def fms_kernel : Flag<["-"], "fms-kernel">, Group<f_Group>,
3179  Visibility<[CC1Option]>,
3180  MarshallingInfoFlag<LangOpts<"Kernel">>;
3181// __declspec is enabled by default for the PS4 by the driver, and also
3182// enabled for Microsoft Extensions or Borland Extensions, here.
3183//
3184// FIXME: __declspec is also currently enabled for CUDA, but isn't really a
3185// CUDA extension. However, it is required for supporting
3186// __clang_cuda_builtin_vars.h, which uses __declspec(property). Once that has
3187// been rewritten in terms of something more generic, remove the Opts.CUDA
3188// term here.
3189defm declspec : BoolOption<"f", "declspec",
3190  LangOpts<"DeclSpecKeyword">, DefaultFalse,
3191  PosFlag<SetTrue, [], [ClangOption], "Allow", [fms_extensions.KeyPath, fborland_extensions.KeyPath, cuda.KeyPath]>,
3192  NegFlag<SetFalse, [], [ClangOption], "Disallow">,
3193  BothFlags<[], [ClangOption, CC1Option],
3194          " __declspec as a keyword">>, Group<f_clang_Group>;
3195def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group<i_Group>,
3196  Flags<[]>, Visibility<[ClangOption, CC1Option]>,
3197  MetaVarName<"<directory>">,
3198  HelpText<"Specify the module cache path">;
3199def fmodules_user_build_path : Separate<["-"], "fmodules-user-build-path">, Group<i_Group>,
3200  Flags<[]>, Visibility<[ClangOption, CC1Option]>,
3201  MetaVarName<"<directory>">,
3202  HelpText<"Specify the module user build path">,
3203  MarshallingInfoString<HeaderSearchOpts<"ModuleUserBuildPath">>;
3204def fprebuilt_module_path : Joined<["-"], "fprebuilt-module-path=">, Group<i_Group>,
3205  Flags<[]>, Visibility<[ClangOption, CLOption, CC1Option]>,
3206  MetaVarName<"<directory>">,
3207  HelpText<"Specify the prebuilt module path">;
3208defm prebuilt_implicit_modules : BoolFOption<"prebuilt-implicit-modules",
3209  HeaderSearchOpts<"EnablePrebuiltImplicitModules">, DefaultFalse,
3210  PosFlag<SetTrue, [], [ClangOption], "Look up implicit modules in the prebuilt module path">,
3211  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
3212
3213def fmodule_output_EQ : Joined<["-"], "fmodule-output=">,
3214  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, CC1Option]>,
3215  MarshallingInfoString<FrontendOpts<"ModuleOutputPath">>,
3216  HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
3217def fmodule_output : Flag<["-"], "fmodule-output">, Flags<[NoXarchOption]>,
3218  Visibility<[ClangOption, CLOption, CC1Option]>,
3219  HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
3220
3221defm skip_odr_check_in_gmf : BoolOption<"f", "skip-odr-check-in-gmf",
3222  LangOpts<"SkipODRCheckInGMF">, DefaultFalse,
3223  PosFlag<SetTrue, [], [CC1Option],
3224          "Skip ODR checks for decls in the global module fragment.">,
3225  NegFlag<SetFalse, [], [CC1Option],
3226          "Perform ODR checks for decls in the global module fragment.">>,
3227  Group<f_Group>;
3228
3229def modules_reduced_bmi : Flag<["-"], "fmodules-reduced-bmi">,
3230  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3231  HelpText<"Generate the reduced BMI">,
3232  MarshallingInfoFlag<FrontendOpts<"GenReducedBMI">>;
3233
3234def experimental_modules_reduced_bmi : Flag<["-"], "fexperimental-modules-reduced-bmi">,
3235  Group<f_Group>, Visibility<[ClangOption, CC1Option]>, Alias<modules_reduced_bmi>;
3236
3237def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">,
3238  Visibility<[ClangOption, CC1Option, CLOption]>,
3239  HelpText<"Embed the contents of all files read by this compilation into "
3240           "the produced module file.">,
3241  MarshallingInfoFlag<FrontendOpts<"ModulesEmbedAllFiles">>;
3242
3243def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>,
3244  Visibility<[ClangOption, CC1Option]>, MetaVarName<"<seconds>">,
3245  HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">,
3246  MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneInterval">, "7 * 24 * 60 * 60">;
3247def fmodules_prune_after : Joined<["-"], "fmodules-prune-after=">, Group<i_Group>,
3248  Visibility<[ClangOption, CC1Option]>, MetaVarName<"<seconds>">,
3249  HelpText<"Specify the interval (in seconds) after which a module file will be considered unused">,
3250  MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneAfter">, "31 * 24 * 60 * 60">;
3251def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">,
3252  Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
3253  MetaVarName<"<time since Epoch in seconds>">,
3254  HelpText<"Time when the current build session started">,
3255  MarshallingInfoInt<HeaderSearchOpts<"BuildSessionTimestamp">, "0", "uint64_t">;
3256def fbuild_session_file : Joined<["-"], "fbuild-session-file=">,
3257  Group<i_Group>, MetaVarName<"<file>">,
3258  HelpText<"Use the last modification time of <file> as the build session timestamp">;
3259def fmodules_validate_once_per_build_session : Flag<["-"], "fmodules-validate-once-per-build-session">,
3260  Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
3261  HelpText<"Don't verify input files for the modules if the module has been "
3262           "successfully validated or loaded during this build session">,
3263  MarshallingInfoFlag<HeaderSearchOpts<"ModulesValidateOncePerBuildSession">>;
3264def fmodules_disable_diagnostic_validation : Flag<["-"], "fmodules-disable-diagnostic-validation">,
3265  Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
3266  HelpText<"Disable validation of the diagnostic options when loading the module">,
3267  MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesValidateDiagnosticOptions">>;
3268defm modules_validate_system_headers : BoolOption<"f", "modules-validate-system-headers",
3269  HeaderSearchOpts<"ModulesValidateSystemHeaders">, DefaultFalse,
3270  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3271          "Validate the system headers that a module depends on when loading the module">,
3272  NegFlag<SetFalse, [], []>>, Group<i_Group>;
3273def fno_modules_validate_textual_header_includes :
3274  Flag<["-"], "fno-modules-validate-textual-header-includes">,
3275  Group<f_Group>, Flags<[]>, Visibility<[ClangOption, CC1Option]>,
3276  MarshallingInfoNegativeFlag<LangOpts<"ModulesValidateTextualHeaderIncludes">>,
3277  HelpText<"Do not enforce -fmodules-decluse and private header restrictions for textual headers. "
3278           "This flag will be removed in a future Clang release.">;
3279defm modules_skip_diagnostic_options : BoolFOption<"modules-skip-diagnostic-options",
3280    HeaderSearchOpts<"ModulesSkipDiagnosticOptions">, DefaultFalse,
3281    PosFlag<SetTrue, [], [], "Disable writing diagnostic options">,
3282    NegFlag<SetFalse>, BothFlags<[], [CC1Option]>>;
3283defm modules_skip_header_search_paths : BoolFOption<"modules-skip-header-search-paths",
3284    HeaderSearchOpts<"ModulesSkipHeaderSearchPaths">, DefaultFalse,
3285    PosFlag<SetTrue, [], [], "Disable writing header search paths">,
3286    NegFlag<SetFalse>, BothFlags<[], [CC1Option]>>;
3287def fno_modules_prune_non_affecting_module_map_files :
3288    Flag<["-"], "fno-modules-prune-non-affecting-module-map-files">,
3289    Group<f_Group>, Flags<[]>, Visibility<[CC1Option]>,
3290    MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesPruneNonAffectingModuleMaps">>,
3291    HelpText<"Do not prune non-affecting module map files when writing module files">;
3292
3293def fincremental_extensions :
3294  Flag<["-"], "fincremental-extensions">,
3295  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3296  HelpText<"Enable incremental processing extensions such as processing "
3297           "statements on the global scope.">,
3298  MarshallingInfoFlag<LangOpts<"IncrementalExtensions">>;
3299
3300def fvalidate_ast_input_files_content:
3301  Flag <["-"], "fvalidate-ast-input-files-content">,
3302  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3303  HelpText<"Compute and store the hash of input files used to build an AST."
3304           " Files with mismatching mtime's are considered valid"
3305           " if both contents is identical">,
3306  MarshallingInfoFlag<HeaderSearchOpts<"ValidateASTInputFilesContent">>;
3307def fforce_check_cxx20_modules_input_files:
3308  Flag <["-"], "fforce-check-cxx20-modules-input-files">,
3309  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3310  HelpText<"Check the input source files from C++20 modules explicitly">,
3311  MarshallingInfoFlag<HeaderSearchOpts<"ForceCheckCXX20ModulesInputFiles">>;
3312def fmodules_validate_input_files_content:
3313  Flag <["-"], "fmodules-validate-input-files-content">,
3314  Group<f_Group>,
3315  HelpText<"Validate PCM input files based on content if mtime differs">;
3316def fno_modules_validate_input_files_content:
3317  Flag <["-"], "fno_modules-validate-input-files-content">,
3318  Group<f_Group>;
3319def fpch_validate_input_files_content:
3320  Flag <["-"], "fpch-validate-input-files-content">,
3321  Group<f_Group>,
3322  HelpText<"Validate PCH input files based on content if mtime differs">;
3323def fno_pch_validate_input_files_content:
3324  Flag <["-"], "fno_pch-validate-input-files-content">,
3325  Group<f_Group>;
3326defm pch_instantiate_templates : BoolFOption<"pch-instantiate-templates",
3327  LangOpts<"PCHInstantiateTemplates">, DefaultFalse,
3328  PosFlag<SetTrue, [], [ClangOption], "Instantiate templates already while building a PCH">,
3329  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option, CLOption]
3330          >>;
3331defm pch_codegen: OptInCC1FFlag<"pch-codegen", "Generate ", "Do not generate ",
3332  "code for uses of this PCH that assumes an explicit object file will be built for the PCH">;
3333defm pch_debuginfo: OptInCC1FFlag<"pch-debuginfo", "Generate ", "Do not generate ",
3334  "debug info for types in an object file built from this PCH and do not generate them elsewhere">;
3335
3336def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
3337  Visibility<[ClangOption, CC1Option, CLOption]>,
3338  HelpText<"Implicitly search the file system for module map files.">,
3339  MarshallingInfoFlag<HeaderSearchOpts<"ImplicitModuleMaps">>;
3340defm modulemap_allow_subdirectory_search : BoolFOption <"modulemap-allow-subdirectory-search",
3341  HeaderSearchOpts<"AllowModuleMapSubdirectorySearch">, DefaultTrue,
3342  PosFlag<SetTrue, [], [], "Allow to search for module maps in subdirectories of search paths">,
3343  NegFlag<SetFalse>, BothFlags<[NoXarchOption], [ClangOption, CC1Option]>>;
3344defm modules : BoolFOption<"modules",
3345  LangOpts<"Modules">, Default<fcxx_modules.KeyPath>,
3346  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3347          "Enable the 'modules' language feature">,
3348  NegFlag<SetFalse>, BothFlags<
3349          [NoXarchOption], [ClangOption, CLOption]>>;
3350def fbuiltin_headers_in_system_modules : Flag <["-"], "fbuiltin-headers-in-system-modules">,
3351  Group<f_Group>,
3352  Visibility<[CC1Option]>,
3353  ShouldParseIf<fmodules.KeyPath>,
3354  HelpText<"builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers">,
3355  MarshallingInfoFlag<LangOpts<"BuiltinHeadersInSystemModules">>;
3356def fmodule_maps : Flag <["-"], "fmodule-maps">,
3357  Visibility<[ClangOption, CLOption]>, Alias<fimplicit_module_maps>;
3358def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group<f_Group>,
3359  Visibility<[ClangOption, CC1Option, CLOption]>,
3360  MetaVarName<"<name>">,
3361  HelpText<"Specify the name of the module to build">,
3362  MarshallingInfoString<LangOpts<"ModuleName">>;
3363def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">,
3364  Visibility<[ClangOption, CC1Option, CLOption]>,
3365  Alias<fmodule_name_EQ>;
3366def fsystem_module : Flag<["-"], "fsystem-module">,
3367  Visibility<[ClangOption, CC1Option, CLOption]>,
3368  HelpText<"Build this module as a system module. Only used with -emit-module">,
3369  MarshallingInfoFlag<FrontendOpts<"IsSystemModule">>;
3370def fmodule_map_file : Joined<["-"], "fmodule-map-file=">,
3371  Group<f_Group>,
3372  Visibility<[ClangOption, CC1Option, CLOption]>,
3373  MetaVarName<"<file>">,
3374  HelpText<"Load this module map file">,
3375  MarshallingInfoStringVector<FrontendOpts<"ModuleMapFiles">>;
3376def fmodule_file : Joined<["-"], "fmodule-file=">,
3377  Group<i_Group>,
3378  Visibility<[ClangOption, CC1Option, CLOption]>,
3379  MetaVarName<"[<name>=]<file>">,
3380  HelpText<"Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.">;
3381def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>,
3382  Visibility<[ClangOption, CC1Option, CLOption]>,
3383  HelpText<"Ignore the definition of the given macro when building and loading modules">;
3384def fmodules_strict_decluse : Flag <["-"], "fmodules-strict-decluse">, Group<f_Group>,
3385  Visibility<[ClangOption, CC1Option, CLOption]>,
3386  HelpText<"Like -fmodules-decluse but requires all headers to be in modules">,
3387  MarshallingInfoFlag<LangOpts<"ModulesStrictDeclUse">>;
3388defm modules_decluse : BoolFOption<"modules-decluse",
3389  LangOpts<"ModulesDeclUse">, Default<fmodules_strict_decluse.KeyPath>,
3390  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3391          "Require declaration of modules used within a module">,
3392  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption]>>;
3393defm modules_search_all : BoolFOption<"modules-search-all",
3394  LangOpts<"ModulesSearchAll">, DefaultFalse,
3395  PosFlag<SetTrue, [], [ClangOption], "Search even non-imported modules to resolve references">,
3396  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option, CLOption]>>,
3397  ShouldParseIf<fmodules.KeyPath>;
3398defm implicit_modules : BoolFOption<"implicit-modules",
3399  LangOpts<"ImplicitModules">, DefaultTrue,
3400  NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
3401  PosFlag<SetTrue>, BothFlags<
3402          [NoXarchOption], [ClangOption, CLOption]>>;
3403def fno_modules_check_relocated : Joined<["-"], "fno-modules-check-relocated">,
3404  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3405  HelpText<"Skip checks for relocated modules when loading PCM files">,
3406  MarshallingInfoNegativeFlag<PreprocessorOpts<"ModulesCheckRelocated">>;
3407def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group<f_Group>,
3408  Visibility<[ClangOption, CC1Option]>,
3409  MarshallingInfoFlag<LangOpts<"RetainCommentsFromSystemHeaders">>;
3410def fmodule_header : Flag <["-"], "fmodule-header">, Group<f_Group>,
3411  Visibility<[ClangOption, CLOption]>,
3412  HelpText<"Build a C++20 Header Unit from a header">;
3413def fmodule_header_EQ : Joined<["-"], "fmodule-header=">, Group<f_Group>,
3414  Visibility<[ClangOption, CLOption]>,
3415  MetaVarName<"<kind>">,
3416  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.">;
3417
3418def fno_knr_functions : Flag<["-"], "fno-knr-functions">, Group<f_Group>,
3419  MarshallingInfoFlag<LangOpts<"DisableKNRFunctions">>,
3420  HelpText<"Disable support for K&R C function declarations">,
3421  Visibility<[ClangOption, CC1Option, CLOption]>;
3422
3423def fmudflapth : Flag<["-"], "fmudflapth">, Group<f_Group>;
3424def fmudflap : Flag<["-"], "fmudflap">, Group<f_Group>;
3425def fnested_functions : Flag<["-"], "fnested-functions">, Group<f_Group>;
3426def fnext_runtime : Flag<["-"], "fnext-runtime">, Group<f_Group>;
3427def fno_asm : Flag<["-"], "fno-asm">, Group<f_Group>;
3428def fno_asynchronous_unwind_tables : Flag<["-"], "fno-asynchronous-unwind-tables">, Group<f_Group>;
3429def fno_assume_sane_operator_new : Flag<["-"], "fno-assume-sane-operator-new">, Group<f_Group>,
3430  HelpText<"Don't assume that C++'s global operator new can't alias any pointer">,
3431  Visibility<[ClangOption, CC1Option]>,
3432  MarshallingInfoNegativeFlag<CodeGenOpts<"AssumeSaneOperatorNew">>;
3433def fno_builtin : Flag<["-"], "fno-builtin">, Group<f_Group>,
3434  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
3435  HelpText<"Disable implicit builtin knowledge of functions">;
3436def fno_builtin_ : Joined<["-"], "fno-builtin-">, Group<f_Group>,
3437  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
3438  HelpText<"Disable implicit builtin knowledge of a specific function">;
3439def fno_common : Flag<["-"], "fno-common">, Group<f_Group>,
3440  Visibility<[ClangOption, CC1Option]>,
3441    HelpText<"Compile common globals like normal definitions">;
3442defm digraphs : BoolFOption<"digraphs",
3443  LangOpts<"Digraphs">, Default<std#".hasDigraphs()">,
3444  PosFlag<SetTrue, [], [ClangOption], "Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)">,
3445  NegFlag<SetFalse, [], [ClangOption], "Disallow alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:'">,
3446  BothFlags<[], [ClangOption, CC1Option]>>;
3447def fno_eliminate_unused_debug_symbols : Flag<["-"], "fno-eliminate-unused-debug-symbols">, Group<f_Group>;
3448def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group<f_clang_Group>,
3449  Visibility<[ClangOption, CC1Option]>;
3450def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>,
3451  Visibility<[ClangOption, CC1Option]>;
3452def fno_global_isel : Flag<["-"], "fno-global-isel">, Group<f_clang_Group>,
3453  HelpText<"Disables the global instruction selector">;
3454def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_Group>,
3455  Alias<fno_global_isel>;
3456def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>,
3457  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3458    HelpText<"Use the given vector functions library">,
3459    HelpTextForVariants<[ClangOption, CC1Option],
3460      "Use the given vector functions library. "
3461      "Note: -fveclib={ArmPL,SLEEF} implies -fno-math-errno">,
3462    Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,AMDLIBM,none">,
3463    NormalizedValuesScope<"llvm::driver::VectorLibrary">,
3464    NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML", "SLEEF",
3465                      "Darwin_libsystem_m", "ArmPL", "AMDLIBM", "NoLibrary"]>,
3466    MarshallingInfoEnum<CodeGenOpts<"VecLib">, "NoLibrary">;
3467def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group<f_Group>,
3468  Alias<flax_vector_conversions_EQ>, AliasArgs<["none"]>;
3469def fno_implicit_module_maps : Flag <["-"], "fno-implicit-module-maps">, Group<f_Group>;
3470def fno_module_maps : Flag <["-"], "fno-module-maps">, Alias<fno_implicit_module_maps>;
3471def fno_modules_strict_decluse : Flag <["-"], "fno-strict-modules-decluse">, Group<f_Group>;
3472def fmodule_file_deps : Flag <["-"], "fmodule-file-deps">, Group<f_Group>;
3473def fno_module_file_deps : Flag <["-"], "fno-module-file-deps">, Group<f_Group>;
3474def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group<f_Group>,
3475  Visibility<[ClangOption, CLOption]>;
3476def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group<f_Group>,
3477  Visibility<[ClangOption, CLOption]>;
3478def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group<f_Group>;
3479def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>,
3480  Visibility<[ClangOption, CC1Option]>;
3481def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>,
3482  Visibility<[ClangOption, FlangOption]>;
3483defm operator_names : BoolFOption<"operator-names",
3484  LangOpts<"CXXOperatorNames">, Default<cplusplus.KeyPath>,
3485  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3486          "Do not treat C++ operator name keywords as synonyms for operators">,
3487  PosFlag<SetTrue>>;
3488def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group<f_Group>,
3489  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
3490  HelpText<"Print absolute paths in diagnostics">,
3491  MarshallingInfoFlag<DiagnosticOpts<"AbsolutePath">>;
3492defm diagnostics_show_line_numbers : BoolFOption<"diagnostics-show-line-numbers",
3493  DiagnosticOpts<"ShowLineNumbers">, DefaultTrue,
3494  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3495          "Show line numbers in diagnostic code snippets">,
3496  PosFlag<SetTrue>>;
3497def fno_realloc_lhs : Flag<["-"], "fno-realloc-lhs">, Group<f_Group>,
3498  HelpText<"An allocatable left-hand side of an intrinsic assignment is assumed to be allocated and match the shape/type of the right-hand side">,
3499  Visibility<[FlangOption, FC1Option]>;
3500def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>,
3501  HelpText<"Disable the use of stack protectors">;
3502def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>,
3503  Visibility<[ClangOption, CLOption, DXCOption]>,
3504  HelpText<"Disable optimizations based on strict aliasing rules">;
3505def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>;
3506def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group<f_Group>;
3507def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
3508def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>,
3509  Visibility<[ClangOption, FlangOption]>;
3510defm init_global_zero : BoolOptionWithoutMarshalling<"f", "init-global-zero",
3511  PosFlag<SetTrue, [], [FlangOption, FC1Option],
3512          "Zero initialize globals without default initialization (default)">,
3513  NegFlag<SetFalse, [], [FlangOption, FC1Option],
3514          "Do not zero initialize globals without default initialization">>;
3515def fno_pointer_tbaa : Flag<["-"], "fno-pointer-tbaa">, Group<f_Group>;
3516def fno_temp_file : Flag<["-"], "fno-temp-file">, Group<f_Group>,
3517  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>, HelpText<
3518  "Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes">,
3519  MarshallingInfoNegativeFlag<FrontendOpts<"UseTemporary">>;
3520defm use_cxa_atexit : BoolFOption<"use-cxa-atexit",
3521  CodeGenOpts<"CXAAtExit">, DefaultTrue,
3522  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3523          "Don't use __cxa_atexit for calling destructors">,
3524  PosFlag<SetTrue>>;
3525def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>;
3526def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>,
3527  Visibility<[ClangOption, CC1Option]>,
3528  MarshallingInfoNegativeFlag<CodeGenOpts<"AsmVerbose">>;
3529def fno_working_directory : Flag<["-"], "fno-working-directory">, Group<f_Group>;
3530def fobjc_arc : Flag<["-"], "fobjc-arc">, Group<f_Group>,
3531  Visibility<[ClangOption, CC1Option]>,
3532  HelpText<"Synthesize retain and release calls for Objective-C pointers">;
3533def fno_objc_arc : Flag<["-"], "fno-objc-arc">, Group<f_Group>;
3534defm objc_encode_cxx_class_template_spec : BoolFOption<"objc-encode-cxx-class-template-spec",
3535  LangOpts<"EncodeCXXClassTemplateSpec">, DefaultFalse,
3536  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3537          "Fully encode c++ class template specialization">,
3538  NegFlag<SetFalse>>;
3539defm objc_convert_messages_to_runtime_calls : BoolFOption<"objc-convert-messages-to-runtime-calls",
3540  CodeGenOpts<"ObjCConvertMessagesToRuntimeCalls">, DefaultTrue,
3541  NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
3542  PosFlag<SetTrue>>;
3543defm objc_arc_exceptions : BoolFOption<"objc-arc-exceptions",
3544  CodeGenOpts<"ObjCAutoRefCountExceptions">, DefaultFalse,
3545  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3546          "Use EH-safe code when synthesizing retains and releases in -fobjc-arc">,
3547  NegFlag<SetFalse>>;
3548def fobjc_atdefs : Flag<["-"], "fobjc-atdefs">, Group<clang_ignored_f_Group>;
3549def fobjc_call_cxx_cdtors : Flag<["-"], "fobjc-call-cxx-cdtors">, Group<clang_ignored_f_Group>;
3550defm objc_exceptions : BoolFOption<"objc-exceptions",
3551  LangOpts<"ObjCExceptions">, DefaultFalse,
3552  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3553          "Enable Objective-C exceptions">,
3554  NegFlag<SetFalse>>;
3555defm application_extension : BoolFOption<"application-extension",
3556  LangOpts<"AppExt">, DefaultFalse,
3557  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3558          "Restrict code to those available for App Extensions">,
3559  NegFlag<SetFalse>>;
3560defm retain_subst_template_type_parm_type_ast_nodes : BoolFOption<"retain-subst-template-type-parm-type-ast-nodes",
3561  LangOpts<"RetainSubstTemplateTypeParmTypeAstNodes">, DefaultFalse,
3562  PosFlag<SetTrue, [], [CC1Option], "Enable">,
3563  NegFlag<SetFalse, [], [], "Disable">,
3564  BothFlags<[], [], " retain SubstTemplateTypeParmType nodes in the AST's representation"
3565  " of alias template specializations">>;
3566defm sized_deallocation : BoolFOption<"sized-deallocation",
3567  LangOpts<"SizedDeallocation">, Default<cpp14.KeyPath>,
3568  PosFlag<SetTrue, [], [], "Enable C++14 sized global deallocation functions">,
3569  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
3570defm aligned_allocation : BoolFOption<"aligned-allocation",
3571  LangOpts<"AlignedAllocation">, Default<cpp17.KeyPath>,
3572  PosFlag<SetTrue, [], [ClangOption], "Enable C++17 aligned allocation functions">,
3573  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
3574def fnew_alignment_EQ : Joined<["-"], "fnew-alignment=">,
3575  HelpText<"Specifies the largest alignment guaranteed by '::operator new(size_t)'">,
3576  MetaVarName<"<align>">, Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3577  MarshallingInfoInt<LangOpts<"NewAlignOverride">>;
3578def : Separate<["-"], "fnew-alignment">, Alias<fnew_alignment_EQ>;
3579def : Flag<["-"], "faligned-new">, Alias<faligned_allocation>;
3580def : Flag<["-"], "fno-aligned-new">, Alias<fno_aligned_allocation>;
3581def faligned_new_EQ : Joined<["-"], "faligned-new=">;
3582
3583def fobjc_legacy_dispatch : Flag<["-"], "fobjc-legacy-dispatch">, Group<f_Group>;
3584def fobjc_new_property : Flag<["-"], "fobjc-new-property">, Group<clang_ignored_f_Group>;
3585defm objc_infer_related_result_type : BoolFOption<"objc-infer-related-result-type",
3586  LangOpts<"ObjCInferRelatedResultType">, DefaultTrue,
3587  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3588          "do not infer Objective-C related result type based on method family">,
3589  PosFlag<SetTrue>>;
3590def fobjc_link_runtime: Flag<["-"], "fobjc-link-runtime">, Group<f_Group>;
3591def fobjc_weak : Flag<["-"], "fobjc-weak">, Group<f_Group>,
3592  Visibility<[ClangOption, CC1Option]>,
3593  HelpText<"Enable ARC-style weak references in Objective-C">;
3594
3595// Objective-C ABI options.
3596def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group<f_Group>,
3597  Visibility<[ClangOption, CC1Option, CLOption]>,
3598  HelpText<"Specify the target Objective-C runtime kind and version">;
3599def fobjc_abi_version_EQ : Joined<["-"], "fobjc-abi-version=">, Group<f_Group>;
3600def fobjc_nonfragile_abi_version_EQ : Joined<["-"], "fobjc-nonfragile-abi-version=">, Group<f_Group>;
3601def fobjc_nonfragile_abi : Flag<["-"], "fobjc-nonfragile-abi">, Group<f_Group>;
3602def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Group>;
3603
3604def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>;
3605def fobjc_disable_direct_methods_for_testing :
3606  Flag<["-"], "fobjc-disable-direct-methods-for-testing">,
3607  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
3608  HelpText<"Ignore attribute objc_direct so that direct methods can be tested">,
3609  MarshallingInfoFlag<LangOpts<"ObjCDisableDirectMethodsForTesting">>;
3610defm objc_avoid_heapify_local_blocks : BoolFOption<"objc-avoid-heapify-local-blocks",
3611  CodeGenOpts<"ObjCAvoidHeapifyLocalBlocks">, DefaultFalse,
3612  PosFlag<SetTrue, [], [ClangOption], "Try">,
3613  NegFlag<SetFalse, [], [ClangOption], "Don't try">,
3614  BothFlags<[], [CC1Option], " to avoid heapifying local blocks">>;
3615defm disable_block_signature_string : BoolFOption<"disable-block-signature-string",
3616  CodeGenOpts<"DisableBlockSignatureString">, DefaultFalse,
3617  PosFlag<SetTrue, [], [ClangOption], "Disable">,
3618  NegFlag<SetFalse, [], [ClangOption], "Don't disable">,
3619  BothFlags<[], [CC1Option], " block signature string)">>;
3620
3621def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>,
3622  Visibility<[ClangOption, FlangOption]>,
3623  HelpText<"Omit the frame pointer from functions that don't need it. "
3624  "Some stack unwinding cases, such as profilers and sanitizers, may prefer specifying -fno-omit-frame-pointer. "
3625  "On many targets, -O1 and higher omit the frame pointer by default. "
3626  "-m[no-]omit-leaf-frame-pointer takes precedence for leaf functions">;
3627def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>,
3628  Flags<[NoArgumentUnused]>,
3629  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3630  HelpText<"Parse OpenMP pragmas and generate parallel code.">;
3631def fno_openmp : Flag<["-"], "fno-openmp">, Group<f_Group>,
3632  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3633  Flags<[NoArgumentUnused]>;
3634class OpenMPVersionHelp<string program, string default> {
3635  string str = !strconcat(
3636    "Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is ",
3637    default, " for ", program);
3638}
3639def fopenmp_version_EQ : Joined<["-"], "fopenmp-version=">, Group<f_Group>,
3640  Flags<[NoArgumentUnused]>,
3641  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3642  HelpText<OpenMPVersionHelp<"Clang", "51">.str>,
3643  HelpTextForVariants<[FlangOption, FC1Option], OpenMPVersionHelp<"Flang", "11">.str>;
3644defm openmp_extensions: BoolFOption<"openmp-extensions",
3645  LangOpts<"OpenMPExtensions">, DefaultTrue,
3646  PosFlag<SetTrue, [NoArgumentUnused], [ClangOption, CC1Option],
3647          "Enable all Clang extensions for OpenMP directives and clauses">,
3648  NegFlag<SetFalse, [NoArgumentUnused], [ClangOption, CC1Option],
3649          "Disable all Clang extensions for OpenMP directives and clauses">>;
3650def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group<f_Group>,
3651  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
3652def fopenmp_use_tls : Flag<["-"], "fopenmp-use-tls">, Group<f_Group>,
3653  Flags<[NoArgumentUnused, HelpHidden]>;
3654def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group<f_Group>,
3655  Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3656def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">,
3657  Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3658  HelpText<"Specify comma-separated list of triples OpenMP offloading targets to be supported">;
3659def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">,
3660  Group<f_Group>, Flags<[NoArgumentUnused, HelpHidden]>,
3661  Visibility<[ClangOption, CC1Option]>;
3662def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">,
3663  Group<f_Group>, Flags<[NoArgumentUnused, HelpHidden]>,
3664  Visibility<[ClangOption, CC1Option]>;
3665def fopenmp_simd : Flag<["-"], "fopenmp-simd">, Group<f_Group>,
3666  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>,
3667  HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
3668def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">, Group<f_Group>,
3669  Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
3670  HelpText<"Use the experimental OpenMP-IR-Builder codegen path.">;
3671def fno_openmp_simd : Flag<["-"], "fno-openmp-simd">, Group<f_Group>,
3672  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>;
3673def fopenmp_cuda_mode : Flag<["-"], "fopenmp-cuda-mode">, Group<f_Group>,
3674  Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3675def fno_openmp_cuda_mode : Flag<["-"], "fno-openmp-cuda-mode">, Group<f_Group>,
3676  Flags<[NoArgumentUnused, HelpHidden]>;
3677def fopenmp_cuda_number_of_sm_EQ : Joined<["-"], "fopenmp-cuda-number-of-sm=">, Group<f_Group>,
3678  Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3679def fopenmp_cuda_blocks_per_sm_EQ : Joined<["-"], "fopenmp-cuda-blocks-per-sm=">, Group<f_Group>,
3680  Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3681def fopenmp_cuda_teams_reduction_recs_num_EQ : Joined<["-"], "fopenmp-cuda-teams-reduction-recs-num=">, Group<f_Group>,
3682  Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3683
3684//===----------------------------------------------------------------------===//
3685// Shared cc1 + fc1 OpenMP Target Options
3686//===----------------------------------------------------------------------===//
3687
3688let Flags = [NoArgumentUnused] in {
3689let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption] in {
3690let Group = f_Group in {
3691
3692def fopenmp_target_debug : Flag<["-"], "fopenmp-target-debug">,
3693  HelpText<"Enable debugging in the OpenMP offloading device RTL">;
3694def fno_openmp_target_debug : Flag<["-"], "fno-openmp-target-debug">;
3695
3696} // let Group = f_Group
3697} // let Visibility = [ClangOption, CC1Option, FC1Option]
3698} // let Flags = [NoArgumentUnused]
3699
3700//===----------------------------------------------------------------------===//
3701// FlangOption + FC1 + ClangOption + CC1Option
3702//===----------------------------------------------------------------------===//
3703let Visibility = [FC1Option, FlangOption, CC1Option, ClangOption] in {
3704def fopenacc : Flag<["-"], "fopenacc">, Group<f_Group>,
3705  HelpText<"Enable OpenACC">;
3706} // let Visibility = [FC1Option, FlangOption, CC1Option, ClangOption]
3707
3708//===----------------------------------------------------------------------===//
3709// Optimisation remark options
3710//===----------------------------------------------------------------------===//
3711
3712let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption] in {
3713
3714def Rpass_EQ : Joined<["-"], "Rpass=">, Group<R_value_Group>,
3715  HelpText<"Report transformations performed by optimization passes whose "
3716           "name matches the given POSIX regular expression">;
3717def Rpass_missed_EQ : Joined<["-"], "Rpass-missed=">, Group<R_value_Group>,
3718  HelpText<"Report missed transformations by optimization passes whose "
3719           "name matches the given POSIX regular expression">;
3720def Rpass_analysis_EQ : Joined<["-"], "Rpass-analysis=">, Group<R_value_Group>,
3721  HelpText<"Report transformation analysis from optimization passes whose "
3722           "name matches the given POSIX regular expression">;
3723def R_Joined : Joined<["-"], "R">, Group<R_Group>,
3724  Visibility<[ClangOption, CLOption, DXCOption]>,
3725  MetaVarName<"<remark>">, HelpText<"Enable the specified remark">;
3726
3727} // let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption]
3728
3729let Flags = [NoArgumentUnused, HelpHidden] in {
3730let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption] in {
3731let Group = f_Group in {
3732
3733def fopenmp_target_debug_EQ : Joined<["-"], "fopenmp-target-debug=">;
3734def fopenmp_assume_teams_oversubscription : Flag<["-"], "fopenmp-assume-teams-oversubscription">;
3735def fopenmp_assume_threads_oversubscription : Flag<["-"], "fopenmp-assume-threads-oversubscription">;
3736def fno_openmp_assume_teams_oversubscription : Flag<["-"], "fno-openmp-assume-teams-oversubscription">;
3737def fno_openmp_assume_threads_oversubscription : Flag<["-"], "fno-openmp-assume-threads-oversubscription">;
3738def fopenmp_assume_no_thread_state : Flag<["-"], "fopenmp-assume-no-thread-state">,
3739  HelpText<"Assert no thread in a parallel region modifies an ICV">,
3740  MarshallingInfoFlag<LangOpts<"OpenMPNoThreadState">>;
3741def fopenmp_assume_no_nested_parallelism : Flag<["-"], "fopenmp-assume-no-nested-parallelism">,
3742  HelpText<"Assert no nested parallel regions in the GPU">,
3743  MarshallingInfoFlag<LangOpts<"OpenMPNoNestedParallelism">>;
3744
3745} // let Group = f_Group
3746} // let Visibility = [ClangOption, CC1Option, FC1Option]
3747} // let Flags = [NoArgumentUnused, HelpHidden]
3748
3749def fopenmp_offload_mandatory : Flag<["-"], "fopenmp-offload-mandatory">, Group<f_Group>,
3750  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>,
3751  HelpText<"Do not create a host fallback if offloading to the device fails.">,
3752  MarshallingInfoFlag<LangOpts<"OpenMPOffloadMandatory">>;
3753def fopenmp_force_usm : Flag<["-"], "fopenmp-force-usm">, Group<f_Group>,
3754  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3755  HelpText<"Force behavior as if the user specified pragma omp requires unified_shared_memory.">,
3756  MarshallingInfoFlag<LangOpts<"OpenMPForceUSM">>;
3757def fopenmp_target_jit : Flag<["-"], "fopenmp-target-jit">, Group<f_Group>,
3758  Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption]>,
3759  HelpText<"Emit code that can be JIT compiled for OpenMP offloading. Implies -foffload-lto=full">;
3760def fno_openmp_target_jit : Flag<["-"], "fno-openmp-target-jit">, Group<f_Group>,
3761  Flags<[NoArgumentUnused, HelpHidden]>,
3762  Visibility<[ClangOption, CLOption]>;
3763def fopenmp_target_new_runtime : Flag<["-"], "fopenmp-target-new-runtime">,
3764  Group<f_Group>, Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3765def fno_openmp_target_new_runtime : Flag<["-"], "fno-openmp-target-new-runtime">,
3766  Group<f_Group>, Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
3767defm openmp_optimistic_collapse : BoolFOption<"openmp-optimistic-collapse",
3768  LangOpts<"OpenMPOptimisticCollapse">, DefaultFalse,
3769  PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
3770  NegFlag<SetFalse>, BothFlags<[NoArgumentUnused, HelpHidden], []>>;
3771def static_openmp: Flag<["-"], "static-openmp">,
3772  HelpText<"Use the static host OpenMP runtime while linking.">;
3773def fopenmp_new_driver : Flag<["-"], "fopenmp-new-driver">, Flags<[HelpHidden]>,
3774  HelpText<"Use the new driver for OpenMP offloading.">;
3775def fno_openmp_new_driver : Flag<["-"], "fno-openmp-new-driver">,
3776  Flags<[HelpHidden]>,
3777  HelpText<"Don't use the new driver for OpenMP offloading.">;
3778def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>,
3779  Visibility<[ClangOption, CC1Option]>,
3780  HelpText<"Disable tail call optimization, keeping the call stack accurate">,
3781  MarshallingInfoFlag<CodeGenOpts<"DisableTailCalls">>;
3782def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group<f_Group>;
3783defm escaping_block_tail_calls : BoolFOption<"escaping-block-tail-calls",
3784  CodeGenOpts<"NoEscapingBlockTailCalls">, DefaultFalse,
3785  NegFlag<SetTrue, [], [ClangOption, CC1Option]>,
3786  PosFlag<SetFalse>>;
3787def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">;
3788def force__flat__namespace : Flag<["-"], "force_flat_namespace">;
3789def force__load : Separate<["-"], "force_load">;
3790def force_addr : Joined<["-"], "fforce-addr">, Group<clang_ignored_f_Group>;
3791def foutput_class_dir_EQ : Joined<["-"], "foutput-class-dir=">, Group<f_Group>;
3792def fpack_struct : Flag<["-"], "fpack-struct">, Group<f_Group>;
3793def fno_pack_struct : Flag<["-"], "fno-pack-struct">, Group<f_Group>;
3794def fpack_struct_EQ : Joined<["-"], "fpack-struct=">, Group<f_Group>,
3795  Visibility<[ClangOption, CC1Option]>,
3796  HelpText<"Specify the default maximum struct packing alignment">,
3797  MarshallingInfoInt<LangOpts<"PackStruct">>;
3798def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group<f_Group>,
3799  Visibility<[ClangOption, CC1Option]>,
3800  HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">,
3801  MarshallingInfoInt<LangOpts<"MaxTypeAlign">>;
3802def fno_max_type_align : Flag<["-"], "fno-max-type-align">, Group<f_Group>;
3803defm pascal_strings : BoolFOption<"pascal-strings",
3804  LangOpts<"PascalStrings">, DefaultFalse,
3805  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3806          "Recognize and construct Pascal-style string literals">,
3807  NegFlag<SetFalse>>;
3808// Note: This flag has different semantics in the driver and in -cc1. The driver accepts -fpatchable-function-entry=M,N
3809// and forwards it to -cc1 as -fpatchable-function-entry=M and -fpatchable-function-entry-offset=N. In -cc1, both flags
3810// are treated as a single integer.
3811def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group<f_Group>,
3812  Visibility<[ClangOption, CC1Option]>,
3813  MetaVarName<"<N,M>">, HelpText<"Generate M NOPs before function entry and N-M NOPs after function entry">,
3814  MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryCount">>;
3815def fms_hotpatch : Flag<["-"], "fms-hotpatch">, Group<f_Group>,
3816  Visibility<[ClangOption, CC1Option, CLOption]>,
3817  HelpText<"Ensure that all functions can be hotpatched at runtime">,
3818  MarshallingInfoFlag<CodeGenOpts<"HotPatch">>;
3819def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>,
3820  Visibility<[ClangOption, CC1Option]>,
3821  HelpText<"Override the default ABI to return all structs on the stack">;
3822def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group<f_Group>;
3823defm pic_data_is_text_relative : SimpleMFlag<"pic-data-is-text-relative",
3824     "Assume", "Don't assume", " data segments are relative to text segment">;
3825def fdirect_access_external_data : Flag<["-"], "fdirect-access-external-data">, Group<f_Group>,
3826  Visibility<[ClangOption, CC1Option]>,
3827  HelpText<"Don't use GOT indirection to reference external data symbols">;
3828def fno_direct_access_external_data : Flag<["-"], "fno-direct-access-external-data">, Group<f_Group>,
3829  Visibility<[ClangOption, CC1Option]>,
3830  HelpText<"Use GOT indirection to reference external data symbols">;
3831defm plt : BoolFOption<"plt",
3832  CodeGenOpts<"NoPLT">, DefaultFalse,
3833  NegFlag<SetTrue, [], [ClangOption, CC1Option],
3834          "Use GOT indirection instead of PLT to make external function calls (x86 only)">,
3835  PosFlag<SetFalse>>;
3836defm ropi : BoolFOption<"ropi",
3837  LangOpts<"ROPI">, DefaultFalse,
3838  PosFlag<SetTrue, [], [ClangOption, FlangOption, CC1Option],
3839          "Generate read-only position independent code (ARM only)">,
3840  NegFlag<SetFalse, [], [ClangOption, FlangOption, CC1Option]>>;
3841defm rwpi : BoolFOption<"rwpi",
3842  LangOpts<"RWPI">, DefaultFalse,
3843  PosFlag<SetTrue, [], [ClangOption, FlangOption, CC1Option],
3844          "Generate read-write position independent code (ARM only)">,
3845  NegFlag<SetFalse, [], [ClangOption, FlangOption, CC1Option]>>;
3846def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>,
3847  Flags<[NoXarchOption, NoArgumentUnused]>, MetaVarName<"<dsopath>">,
3848  HelpText<"Load the named plugin (dynamic shared object)">;
3849def fplugin_arg : Joined<["-"], "fplugin-arg-">,
3850  MetaVarName<"<name>-<arg>">, Flags<[NoArgumentUnused]>,
3851  HelpText<"Pass <arg> to plugin <name>">;
3852def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">,
3853  Group<f_Group>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
3854  MetaVarName<"<dsopath>">, Flags<[NoArgumentUnused]>,
3855  HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">,
3856  MarshallingInfoStringVector<CodeGenOpts<"PassPlugins">>;
3857defm tocdata : BoolOption<"m","tocdata",
3858  CodeGenOpts<"AllTocData">, DefaultFalse,
3859  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3860  "All suitable variables will have the TOC data transformation applied">,
3861  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3862  "This is the default. TOC data transformation is not applied to any "
3863  "variables. Only variables specified explicitly in -mtocdata= will "
3864  "have the TOC data transformation.">,
3865  BothFlags<[TargetSpecific], [ClangOption, CLOption]>>, Group<m_Group>;
3866def mtocdata_EQ : CommaJoined<["-"], "mtocdata=">,
3867  Visibility<[ClangOption, CC1Option]>,
3868  Flags<[TargetSpecific]>, Group<m_Group>,
3869  HelpText<"Specifies a list of variables to which the TOC data transformation "
3870           "will be applied.">,
3871  MarshallingInfoStringVector<CodeGenOpts<"TocDataVarsUserSpecified">>;
3872def mno_tocdata_EQ : CommaJoined<["-"], "mno-tocdata=">,
3873  Visibility<[ClangOption, CC1Option]>,
3874  Flags<[TargetSpecific]>, Group<m_Group>,
3875  HelpText<"Specifies a list of variables to be exempt from the TOC data "
3876           "transformation.">,
3877  MarshallingInfoStringVector<CodeGenOpts<"NoTocDataVars">>;
3878defm preserve_as_comments : BoolFOption<"preserve-as-comments",
3879  CodeGenOpts<"PreserveAsmComments">, DefaultTrue,
3880  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3881          "Do not preserve comments in inline assembly">,
3882  PosFlag<SetTrue>>;
3883def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
3884def reexport_framework : Separate<["-"], "reexport_framework">, Flags<[LinkerInput]>;
3885def reexport_l : Joined<["-"], "reexport-l">, Flags<[LinkerInput]>;
3886def reexport_library : JoinedOrSeparate<["-"], "reexport_library">, Flags<[LinkerInput]>;
3887def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<clang_ignored_f_Group>;
3888def freg_struct_return : Flag<["-"], "freg-struct-return">, Group<f_Group>,
3889  Visibility<[ClangOption, CC1Option]>,
3890  HelpText<"Override the default ABI to return small structs in registers">;
3891defm rtti : BoolFOption<"rtti",
3892  LangOpts<"RTTI">, Default<cplusplus.KeyPath>,
3893  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3894          "Disable generation of rtti information">,
3895  PosFlag<SetTrue>>, ShouldParseIf<cplusplus.KeyPath>;
3896defm rtti_data : BoolFOption<"rtti-data",
3897  LangOpts<"RTTIData">, Default<frtti.KeyPath>,
3898  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3899          "Disable generation of RTTI data">,
3900  PosFlag<SetTrue>>, ShouldParseIf<frtti.KeyPath>;
3901def : Flag<["-"], "fsched-interblock">, Group<clang_ignored_f_Group>;
3902defm short_enums : BoolFOption<"short-enums",
3903  LangOpts<"ShortEnums">, DefaultFalse,
3904  PosFlag<SetTrue, [], [ClangOption, CC1Option],
3905          "Allocate to an enum type only as many bytes as it"
3906           " needs for the declared range of possible values">,
3907  NegFlag<SetFalse>>;
3908defm char8__t : BoolFOption<"char8_t",
3909  LangOpts<"Char8">, Default<cpp20.KeyPath>,
3910  PosFlag<SetTrue, [], [ClangOption], "Enable">,
3911  NegFlag<SetFalse, [], [ClangOption], "Disable">,
3912  BothFlags<[], [ClangOption, CC1Option], " C++ builtin type char8_t">>;
3913def fshort_wchar : Flag<["-"], "fshort-wchar">, Group<f_Group>,
3914  HelpText<"Force wchar_t to be a short unsigned int">;
3915def fno_short_wchar : Flag<["-"], "fno-short-wchar">, Group<f_Group>,
3916  HelpText<"Force wchar_t to be an unsigned int">;
3917def fshow_overloads_EQ : Joined<["-"], "fshow-overloads=">, Group<f_Group>,
3918  Visibility<[ClangOption, CC1Option]>,
3919  HelpText<"Which overload candidates to show when overload resolution fails. Defaults to 'all'">,
3920  Values<"best,all">,
3921  NormalizedValues<["Ovl_Best", "Ovl_All"]>,
3922  MarshallingInfoEnum<DiagnosticOpts<"ShowOverloads">, "Ovl_All">;
3923defm show_column : BoolFOption<"show-column",
3924  DiagnosticOpts<"ShowColumn">, DefaultTrue,
3925  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3926          "Do not include column number on diagnostics">,
3927  PosFlag<SetTrue>>;
3928defm show_source_location : BoolFOption<"show-source-location",
3929  DiagnosticOpts<"ShowLocation">, DefaultTrue,
3930  NegFlag<SetFalse, [], [ClangOption, CC1Option],
3931          "Do not include source location information with diagnostics">,
3932  PosFlag<SetTrue>>;
3933defm spell_checking : BoolFOption<"spell-checking",
3934  LangOpts<"SpellChecking">, DefaultTrue,
3935  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Disable spell-checking">,
3936  PosFlag<SetTrue>>;
3937def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<f_Group>,
3938  Visibility<[ClangOption, CC1Option]>,
3939  HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit)">,
3940  MarshallingInfoInt<DiagnosticOpts<"SpellCheckingLimit">, "DiagnosticOptions::DefaultSpellCheckingLimit">;
3941def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group<f_Group>;
3942defm signed_char : BoolFOption<"signed-char",
3943  LangOpts<"CharIsSigned">, DefaultTrue,
3944  NegFlag<SetFalse, [], [ClangOption, CC1Option], "char is unsigned">,
3945  PosFlag<SetTrue, [], [ClangOption], "char is signed">>,
3946  ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
3947defm split_stack : BoolFOption<"split-stack",
3948  CodeGenOpts<"EnableSegmentedStacks">, DefaultFalse,
3949  NegFlag<SetFalse, [], [ClangOption], "Wouldn't use segmented stack">,
3950  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use segmented stack">>;
3951def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
3952  HelpText<"Enable stack protectors for all functions">;
3953defm stack_clash_protection : BoolFOption<"stack-clash-protection",
3954  CodeGenOpts<"StackClashProtector">, DefaultFalse,
3955  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
3956  NegFlag<SetFalse, [], [ClangOption], "Disable">,
3957  BothFlags<[], [ClangOption], " stack clash protection">>,
3958  DocBrief<"Instrument stack allocation to prevent stack clash attacks">;
3959def fstack_protector_strong : Flag<["-"], "fstack-protector-strong">, Group<f_Group>,
3960  HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. "
3961           "Compared to -fstack-protector, this uses a stronger heuristic "
3962           "that includes functions containing arrays of any size (and any type), "
3963           "as well as any calls to alloca or the taking of an address from a local variable">;
3964def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
3965  HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. "
3966           "This uses a loose heuristic which considers functions vulnerable if they "
3967           "contain a char (or 8bit integer) array or constant sized calls to alloca "
3968           ", which are of greater size than ssp-buffer-size (default: 8 bytes). All "
3969           "variable sized calls to alloca are considered vulnerable. A function with "
3970           "a stack protector has a guard value added to the stack frame that is "
3971           "checked on function exit. The guard value must be positioned in the "
3972           "stack frame such that a buffer overflow from a vulnerable variable will "
3973           "overwrite the guard value before overwriting the function's return "
3974           "address. The reference stack guard value is stored in a global variable.">;
3975def ftrivial_auto_var_init : Joined<["-"], "ftrivial-auto-var-init=">, Group<f_Group>,
3976  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
3977  HelpText<"Initialize trivial automatic stack variables. Defaults to 'uninitialized'">,
3978  Values<"uninitialized,zero,pattern">,
3979  NormalizedValuesScope<"LangOptions::TrivialAutoVarInitKind">,
3980  NormalizedValues<["Uninitialized", "Zero", "Pattern"]>,
3981  MarshallingInfoEnum<LangOpts<"TrivialAutoVarInit">, "Uninitialized">;
3982def ftrivial_auto_var_init_stop_after : Joined<["-"], "ftrivial-auto-var-init-stop-after=">, Group<f_Group>,
3983  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
3984  HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
3985  MarshallingInfoInt<LangOpts<"TrivialAutoVarInitStopAfter">>;
3986def ftrivial_auto_var_init_max_size : Joined<["-"], "ftrivial-auto-var-init-max-size=">, Group<f_Group>,
3987  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
3988  HelpText<"Stop initializing trivial automatic stack variables if var size exceeds the specified number of instances (in bytes)">,
3989  MarshallingInfoInt<LangOpts<"TrivialAutoVarInitMaxSize">>;
3990def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>,
3991  Visibility<[ClangOption, CLOption, DXCOption]>,
3992  HelpText<"Emit full debug info for all types used by the program">;
3993def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>,
3994  Visibility<[ClangOption, CLOption, DXCOption]>,
3995  HelpText<"Limit debug information produced to reduce size of debug binary">;
3996def flimit_debug_info : Flag<["-"], "flimit-debug-info">,
3997  Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fno_standalone_debug>;
3998def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">,
3999  Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fstandalone_debug>;
4000def fdebug_macro : Flag<["-"], "fdebug-macro">, Group<f_Group>,
4001  Visibility<[ClangOption, CLOption, DXCOption]>,
4002  HelpText<"Emit macro debug information">;
4003def fno_debug_macro : Flag<["-"], "fno-debug-macro">, Group<f_Group>,
4004  Visibility<[ClangOption, CLOption, DXCOption]>,
4005  HelpText<"Do not emit macro debug information">;
4006def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group<f_Group>,
4007  Visibility<[ClangOption, CLOption, DXCOption]>,
4008  HelpText<"Enable optimizations based on strict aliasing rules">;
4009def fstrict_enums : Flag<["-"], "fstrict-enums">, Group<f_Group>,
4010  Visibility<[ClangOption, CC1Option]>,
4011  HelpText<"Enable optimizations based on the strict definition of an enum's "
4012           "value range">,
4013  MarshallingInfoFlag<CodeGenOpts<"StrictEnums">>;
4014defm strict_vtable_pointers : BoolFOption<"strict-vtable-pointers",
4015  CodeGenOpts<"StrictVTablePointers">, DefaultFalse,
4016  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4017          "Enable optimizations based on the strict rules for"
4018            " overwriting polymorphic C++ objects">,
4019  NegFlag<SetFalse>>;
4020def fstrict_overflow : Flag<["-"], "fstrict-overflow">, Group<f_Group>,
4021  Visibility<[ClangOption, FlangOption]>;
4022def fpointer_tbaa : Flag<["-"], "fpointer-tbaa">, Group<f_Group>;
4023def fdriver_only : Flag<["-"], "fdriver-only">, Flags<[NoXarchOption]>,
4024  Visibility<[ClangOption, CLOption, DXCOption]>,
4025  Group<Action_Group>, HelpText<"Only run the driver.">;
4026def fsyntax_only : Flag<["-"], "fsyntax-only">,
4027  Flags<[NoXarchOption]>,
4028  Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FC1Option, FlangOption]>,
4029  Group<Action_Group>,
4030  HelpText<"Run the preprocessor, parser and semantic analysis stages">;
4031def ftabstop_EQ : Joined<["-"], "ftabstop=">, Group<f_Group>;
4032def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group<f_Group>,
4033  Visibility<[ClangOption, CC1Option]>,
4034  HelpText<"Set the maximum depth of recursive template instantiation">,
4035  MarshallingInfoInt<LangOpts<"InstantiationDepth">, "1024">;
4036def : Joined<["-"], "ftemplate-depth-">, Group<f_Group>, Alias<ftemplate_depth_EQ>;
4037def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">, Group<f_Group>,
4038  Visibility<[ClangOption, CC1Option]>,
4039  HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit)">,
4040  MarshallingInfoInt<DiagnosticOpts<"TemplateBacktraceLimit">, "DiagnosticOptions::DefaultTemplateBacktraceLimit">;
4041def foperator_arrow_depth_EQ : Joined<["-"], "foperator-arrow-depth=">, Group<f_Group>,
4042  Visibility<[ClangOption, CC1Option]>,
4043  HelpText<"Maximum number of 'operator->'s to call for a member access">,
4044  MarshallingInfoInt<LangOpts<"ArrowDepth">, "256">;
4045
4046def fsave_optimization_record : Flag<["-"], "fsave-optimization-record">,
4047  Visibility<[ClangOption, FlangOption]>,
4048  Group<f_Group>, HelpText<"Generate a YAML optimization record file">;
4049def fsave_optimization_record_EQ : Joined<["-"], "fsave-optimization-record=">,
4050  Visibility<[ClangOption, FlangOption]>,
4051  Group<f_Group>, HelpText<"Generate an optimization record file in a specific format">,
4052  MetaVarName<"<format>">;
4053def fno_save_optimization_record : Flag<["-"], "fno-save-optimization-record">,
4054  Group<f_Group>, Flags<[NoArgumentUnused]>,
4055  Visibility<[ClangOption, FlangOption]>;
4056def foptimization_record_file_EQ : Joined<["-"], "foptimization-record-file=">,
4057  Visibility<[ClangOption, FlangOption]>,
4058  Group<f_Group>,
4059  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.">,
4060  MetaVarName<"<file>">;
4061def foptimization_record_passes_EQ : Joined<["-"], "foptimization-record-passes=">,
4062  Visibility<[ClangOption, FlangOption]>,
4063  Group<f_Group>,
4064  HelpText<"Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)">,
4065  MetaVarName<"<regex>">;
4066
4067defm assumptions : BoolFOption<"assumptions",
4068  LangOpts<"CXXAssumptions">, DefaultTrue,
4069  NegFlag<SetFalse, [], [ClangOption, CC1Option],
4070          "Disable codegen and compile-time checks for C++23's [[assume]] attribute">,
4071  PosFlag<SetTrue>>;
4072
4073def fvectorize : Flag<["-"], "fvectorize">, Group<f_Group>,
4074  HelpText<"Enable the loop vectorization passes">;
4075def fno_vectorize : Flag<["-"], "fno-vectorize">, Group<f_Group>;
4076def : Flag<["-"], "ftree-vectorize">, Alias<fvectorize>;
4077def : Flag<["-"], "fno-tree-vectorize">, Alias<fno_vectorize>;
4078def fslp_vectorize : Flag<["-"], "fslp-vectorize">, Group<f_Group>,
4079  HelpText<"Enable the superword-level parallelism vectorization passes">;
4080def fno_slp_vectorize : Flag<["-"], "fno-slp-vectorize">, Group<f_Group>;
4081def : Flag<["-"], "ftree-slp-vectorize">, Alias<fslp_vectorize>;
4082def : Flag<["-"], "fno-tree-slp-vectorize">, Alias<fno_slp_vectorize>;
4083def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">,
4084  HelpText<"Warn if a function definition returns or accepts an object larger "
4085           "in bytes than a given value">, Flags<[HelpHidden]>;
4086def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">,
4087  Visibility<[ClangOption, CC1Option]>,
4088  MarshallingInfoInt<LangOpts<"NumLargeByValueCopy">>;
4089
4090// These "special" warning flags are effectively processed as f_Group flags by the driver:
4091// Just silence warnings about -Wlarger-than for now.
4092def Wlarger_than_EQ : Joined<["-"], "Wlarger-than=">, Group<clang_ignored_f_Group>;
4093def Wlarger_than_ : Joined<["-"], "Wlarger-than-">, Alias<Wlarger_than_EQ>;
4094
4095// This is converted to -fwarn-stack-size=N and also passed through by the driver.
4096// FIXME: The driver should strip out the =<value> when passing W_value_Group through.
4097def Wframe_larger_than_EQ : Joined<["-"], "Wframe-larger-than=">, Group<W_value_Group>,
4098                            Visibility<[ClangOption, CC1Option]>;
4099def Wframe_larger_than : Flag<["-"], "Wframe-larger-than">, Alias<Wframe_larger_than_EQ>;
4100
4101def : Flag<["-"], "fterminated-vtables">, Alias<fapple_kext>;
4102defm threadsafe_statics : BoolFOption<"threadsafe-statics",
4103  LangOpts<"ThreadsafeStatics">, DefaultTrue,
4104  NegFlag<SetFalse, [], [ClangOption, CC1Option],
4105          "Do not emit code to make initialization of local statics thread safe">,
4106  PosFlag<SetTrue>>;
4107defm ms_tls_guards : BoolFOption<"ms-tls-guards",
4108  CodeGenOpts<"TlsGuards">, DefaultTrue,
4109  NegFlag<SetFalse, [], [CC1Option],
4110          "Do not emit code to perform on-demand initialization of thread-local variables">,
4111  PosFlag<SetTrue>>;
4112def ftime_report : Flag<["-"], "ftime-report">, Group<f_Group>,
4113  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
4114  MarshallingInfoFlag<CodeGenOpts<"TimePasses">>;
4115def ftime_report_EQ: Joined<["-"], "ftime-report=">, Group<f_Group>,
4116  Visibility<[ClangOption, CC1Option]>, Values<"per-pass,per-pass-run">,
4117  MarshallingInfoFlag<CodeGenOpts<"TimePassesPerRun">>,
4118  HelpText<"(For new pass manager) 'per-pass': one report for each pass; "
4119           "'per-pass-run': one report for each pass invocation">;
4120def ftime_trace : Flag<["-"], "ftime-trace">, Group<f_Group>,
4121  HelpText<"Turn on time profiler. Generates JSON file based on output filename.">,
4122  DocBrief<[{
4123Turn on time profiler. Generates JSON file based on output filename. Results
4124can be analyzed with chrome://tracing or `Speedscope App
4125<https://www.speedscope.app>`_ for flamegraph visualization.}]>,
4126  Visibility<[ClangOption, CLOption, DXCOption]>;
4127def ftime_trace_granularity_EQ : Joined<["-"], "ftime-trace-granularity=">, Group<f_Group>,
4128  HelpText<"Minimum time granularity (in microseconds) traced by time profiler">,
4129  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
4130  MarshallingInfoInt<FrontendOpts<"TimeTraceGranularity">, "500u">;
4131def ftime_trace_verbose : Joined<["-"], "ftime-trace-verbose">, Group<f_Group>,
4132  HelpText<"Make time trace capture verbose event details (e.g. source filenames). This can increase the size of the output by 2-3 times">,
4133  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
4134  MarshallingInfoFlag<FrontendOpts<"TimeTraceVerbose">>;
4135def ftime_trace_EQ : Joined<["-"], "ftime-trace=">, Group<f_Group>,
4136  HelpText<"Similar to -ftime-trace. Specify the JSON file or a directory which will contain the JSON file">,
4137  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
4138  MarshallingInfoString<FrontendOpts<"TimeTracePath">>;
4139def fproc_stat_report : Joined<["-"], "fproc-stat-report">, Group<f_Group>,
4140  HelpText<"Print subprocess statistics">;
4141def fproc_stat_report_EQ : Joined<["-"], "fproc-stat-report=">, Group<f_Group>,
4142  HelpText<"Save subprocess statistics to the given file">;
4143def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group<f_Group>,
4144  Visibility<[ClangOption, CC1Option]>,
4145  Values<"global-dynamic,local-dynamic,initial-exec,local-exec">,
4146  NormalizedValuesScope<"CodeGenOptions">,
4147  NormalizedValues<["GeneralDynamicTLSModel", "LocalDynamicTLSModel", "InitialExecTLSModel", "LocalExecTLSModel"]>,
4148  MarshallingInfoEnum<CodeGenOpts<"DefaultTLSModel">, "GeneralDynamicTLSModel">;
4149def ftrapv : Flag<["-"], "ftrapv">, Group<f_Group>,
4150  Visibility<[ClangOption, CC1Option]>,
4151  HelpText<"Trap on integer overflow">;
4152def ftrapv_handler_EQ : Joined<["-"], "ftrapv-handler=">, Group<f_Group>,
4153  MetaVarName<"<function name>">,
4154  HelpText<"Specify the function to be called on overflow">;
4155def ftrapv_handler : Separate<["-"], "ftrapv-handler">, Group<f_Group>,
4156  Visibility<[ClangOption, CC1Option]>;
4157def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>,
4158  Visibility<[ClangOption, CC1Option]>,
4159  HelpText<"Issue call to specified function rather than a trap instruction">,
4160  MarshallingInfoString<CodeGenOpts<"TrapFuncName">>;
4161def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
4162  HelpText<"Turn on loop unroller">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4163def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<f_Group>,
4164  HelpText<"Turn off loop unroller">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4165def ffinite_loops: Flag<["-"],  "ffinite-loops">, Group<f_Group>,
4166  HelpText<"Assume all non-trivial loops are finite.">, Visibility<[ClangOption, CC1Option]>;
4167def fno_finite_loops: Flag<["-"], "fno-finite-loops">, Group<f_Group>,
4168  HelpText<"Do not assume that any loop is finite.">,
4169  Visibility<[ClangOption, CC1Option]>;
4170
4171def ftrigraphs : Flag<["-"], "ftrigraphs">, Group<f_Group>,
4172  HelpText<"Process trigraph sequences">, Visibility<[ClangOption, CC1Option]>;
4173def fno_trigraphs : Flag<["-"], "fno-trigraphs">, Group<f_Group>,
4174  HelpText<"Do not process trigraph sequences">,
4175  Visibility<[ClangOption, CC1Option]>;
4176def funsigned_bitfields : Flag<["-"], "funsigned-bitfields">, Group<f_Group>;
4177def funsigned_char : Flag<["-"], "funsigned-char">, Group<f_Group>;
4178def fno_unsigned_char : Flag<["-"], "fno-unsigned-char">;
4179def funwind_tables : Flag<["-"], "funwind-tables">, Group<f_Group>;
4180defm register_global_dtors_with_atexit : BoolFOption<"register-global-dtors-with-atexit",
4181  CodeGenOpts<"RegisterGlobalDtorsWithAtExit">, DefaultFalse,
4182  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
4183  NegFlag<SetFalse, [], [ClangOption], "Don't use">,
4184  BothFlags<[], [ClangOption], " atexit or __cxa_atexit to register global destructors">>;
4185defm use_init_array : BoolFOption<"use-init-array",
4186  CodeGenOpts<"UseInitArray">, DefaultTrue,
4187  NegFlag<SetFalse, [], [ClangOption, CC1Option],
4188          "Use .ctors/.dtors instead of .init_array/.fini_array">,
4189  PosFlag<SetTrue>>;
4190def fno_var_tracking : Flag<["-"], "fno-var-tracking">, Group<clang_ignored_f_Group>;
4191def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>,
4192  HelpText<"Generate verbose assembly output">;
4193def dA : Flag<["-"], "dA">, Alias<fverbose_asm>;
4194defm visibility_from_dllstorageclass : BoolFOption<"visibility-from-dllstorageclass",
4195  LangOpts<"VisibilityFromDLLStorageClass">, DefaultFalse,
4196  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4197          "Override the visibility of globals based on their final DLL storage class.">,
4198  NegFlag<SetFalse>>;
4199class MarshallingInfoVisibilityFromDLLStorage<KeyPathAndMacro kpm, code default>
4200  : MarshallingInfoEnum<kpm, default>,
4201    Values<"keep,hidden,protected,default">,
4202    NormalizedValuesScope<"LangOptions::VisibilityFromDLLStorageClassKinds">,
4203    NormalizedValues<["Keep", "Hidden", "Protected", "Default"]> {}
4204def fvisibility_dllexport_EQ : Joined<["-"], "fvisibility-dllexport=">, Group<f_Group>,
4205  Visibility<[ClangOption, CC1Option]>,
4206  HelpText<"The visibility for dllexport definitions. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]">,
4207  MarshallingInfoVisibilityFromDLLStorage<LangOpts<"DLLExportVisibility">, "Default">,
4208  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
4209def fvisibility_nodllstorageclass_EQ : Joined<["-"], "fvisibility-nodllstorageclass=">, Group<f_Group>,
4210  Visibility<[ClangOption, CC1Option]>,
4211  HelpText<"The visibility for definitions without an explicit DLL storage class. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]">,
4212  MarshallingInfoVisibilityFromDLLStorage<LangOpts<"NoDLLStorageClassVisibility">, "Hidden">,
4213  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
4214def fvisibility_externs_dllimport_EQ : Joined<["-"], "fvisibility-externs-dllimport=">, Group<f_Group>,
4215  Visibility<[ClangOption, CC1Option]>,
4216  HelpText<"The visibility for dllimport external declarations. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]">,
4217  MarshallingInfoVisibilityFromDLLStorage<LangOpts<"ExternDeclDLLImportVisibility">, "Default">,
4218  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
4219def fvisibility_externs_nodllstorageclass_EQ : Joined<["-"], "fvisibility-externs-nodllstorageclass=">, Group<f_Group>,
4220  Visibility<[ClangOption, CC1Option]>,
4221  HelpText<"The visibility for external declarations without an explicit DLL storage class. If Keep is specified the visibility is not adjusted [-fvisibility-from-dllstorageclass]">,
4222  MarshallingInfoVisibilityFromDLLStorage<LangOpts<"ExternDeclNoDLLStorageClassVisibility">, "Hidden">,
4223  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
4224def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>,
4225  Visibility<[ClangOption, CC1Option]>,
4226  HelpText<"Set the default symbol visibility for all global definitions">,
4227  MarshallingInfoVisibility<LangOpts<"ValueVisibilityMode">, "DefaultVisibility">;
4228defm visibility_inlines_hidden : BoolFOption<"visibility-inlines-hidden",
4229  LangOpts<"InlineVisibilityHidden">, DefaultFalse,
4230  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4231          "Give inline C++ member functions hidden visibility by default">,
4232  NegFlag<SetFalse>>;
4233defm visibility_inlines_hidden_static_local_var : BoolFOption<"visibility-inlines-hidden-static-local-var",
4234  LangOpts<"VisibilityInlinesHiddenStaticLocalVar">, DefaultFalse,
4235  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4236          "When -fvisibility-inlines-hidden is enabled, static variables in"
4237            " inline C++ member functions will also be given hidden visibility by default">,
4238  NegFlag<SetFalse, [], [ClangOption], "Disables -fvisibility-inlines-hidden-static-local-var"
4239         " (this is the default on non-darwin targets)">, BothFlags<
4240                 [], [ClangOption, CC1Option]>>;
4241def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group<f_Group>,
4242  HelpText<"Give global types 'default' visibility and global functions and "
4243           "variables 'hidden' visibility by default">;
4244def fvisibility_global_new_delete_hidden : Flag<["-"], "fvisibility-global-new-delete-hidden">, Group<f_Group>,
4245  HelpText<"Give global C++ operator new and delete declarations hidden visibility">;
4246class MarshallingInfoVisibilityGlobalNewDelete<KeyPathAndMacro kpm, code default>
4247  : MarshallingInfoEnum<kpm, default>,
4248    Values<"force-default,force-protected,force-hidden,source">,
4249    NormalizedValuesScope<"LangOptions::VisibilityForcedKinds">,
4250    NormalizedValues<["ForceDefault", "ForceProtected", "ForceHidden", "Source"]> {}
4251def fvisibility_global_new_delete_EQ : Joined<["-"], "fvisibility-global-new-delete=">, Group<f_Group>,
4252  Visibility<[ClangOption, CC1Option]>,
4253  HelpText<"The visibility for global C++ operator new and delete declarations. If 'source' is specified the visibility is not adjusted">,
4254  MarshallingInfoVisibilityGlobalNewDelete<LangOpts<"GlobalAllocationFunctionVisibility">, "ForceDefault">;
4255def mdefault_visibility_export_mapping_EQ : Joined<["-"], "mdefault-visibility-export-mapping=">,
4256  Values<"none,explicit,all">,
4257  NormalizedValuesScope<"LangOptions::DefaultVisiblityExportMapping">,
4258  NormalizedValues<["None", "Explicit", "All"]>,
4259  HelpText<"Mapping between default visibility and export">,
4260  Group<m_Group>, Flags<[TargetSpecific]>,
4261  Visibility<[ClangOption, CC1Option]>,
4262  MarshallingInfoEnum<LangOpts<"DefaultVisibilityExportMapping">,"None">;
4263defm new_infallible : BoolFOption<"new-infallible",
4264  LangOpts<"NewInfallible">, DefaultFalse,
4265  PosFlag<SetTrue, [], [ClangOption], "Enable">,
4266  NegFlag<SetFalse, [], [ClangOption], "Disable">,
4267  BothFlags<[], [ClangOption, CC1Option],
4268          " treating throwing global C++ operator new as always returning valid memory "
4269  "(annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.">>;
4270defm whole_program_vtables : BoolFOption<"whole-program-vtables",
4271  CodeGenOpts<"WholeProgramVTables">, DefaultFalse,
4272  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4273          "Enables whole-program vtable optimization. Requires -flto">,
4274  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption]>>;
4275defm split_lto_unit : BoolFOption<"split-lto-unit",
4276  CodeGenOpts<"EnableSplitLTOUnit">, DefaultFalse,
4277  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4278          "Enables splitting of the LTO unit">,
4279  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption]>>;
4280defm force_emit_vtables : BoolFOption<"force-emit-vtables",
4281  CodeGenOpts<"ForceEmitVTables">, DefaultFalse,
4282  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4283          "Emits more virtual tables to improve devirtualization">,
4284  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption]>>,
4285  DocBrief<[{In order to improve devirtualization, forces emitting of vtables even in
4286modules where it isn't necessary. It causes more inline virtual functions
4287to be emitted.}]>;
4288defm virtual_function_elimination : BoolFOption<"virtual-function-elimination",
4289  CodeGenOpts<"VirtualFunctionElimination">, DefaultFalse,
4290  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4291          "Enables dead virtual function elimination optimization. Requires -flto=full">,
4292  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption]>>;
4293
4294def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>,
4295  Visibility<[ClangOption, CLOption, CC1Option, FlangOption, FC1Option]>,
4296  HelpText<"Treat signed integer overflow as two's complement">;
4297def fno_wrapv : Flag<["-"], "fno-wrapv">, Group<f_Group>,
4298  Visibility<[ClangOption, CLOption, FlangOption]>;
4299def fwrapv_pointer : Flag<["-"], "fwrapv-pointer">, Group<f_Group>,
4300  Visibility<[ClangOption, CLOption, CC1Option, FlangOption, FC1Option]>,
4301  HelpText<"Treat pointer overflow as two's complement">;
4302def fno_wrapv_pointer : Flag<["-"], "fno-wrapv-pointer">, Group<f_Group>,
4303  Visibility<[ClangOption, CLOption, FlangOption]>;
4304def fwritable_strings : Flag<["-"], "fwritable-strings">, Group<f_Group>,
4305  Visibility<[ClangOption, CC1Option]>,
4306  HelpText<"Store string literals as writable data">,
4307  MarshallingInfoFlag<LangOpts<"WritableStrings">>;
4308defm zero_initialized_in_bss : BoolFOption<"zero-initialized-in-bss",
4309  CodeGenOpts<"NoZeroInitializedInBSS">, DefaultFalse,
4310  NegFlag<SetTrue, [], [ClangOption, CC1Option],
4311          "Don't place zero initialized data in BSS">,
4312  PosFlag<SetFalse>>;
4313defm function_sections : BoolFOption<"function-sections",
4314  CodeGenOpts<"FunctionSections">, DefaultFalse,
4315  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4316          "Place each function in its own section">,
4317  NegFlag<SetFalse>>;
4318defm basic_block_address_map : BoolFOption<"basic-block-address-map",
4319  CodeGenOpts<"BBAddrMap">, DefaultFalse,
4320  PosFlag<SetTrue, [], [CC1Option], "Emit the basic block address map section.">,
4321  NegFlag<SetFalse>>;
4322def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
4323  Visibility<[ClangOption, CC1Option, CC1AsOption]>,
4324  HelpText<"Place each function's basic blocks in unique sections (ELF Only)">,
4325  DocBrief<[{Place each basic block or a subset of basic blocks in its own section.}]>,
4326  Values<"all,none,list=">,
4327  MarshallingInfoString<CodeGenOpts<"BBSections">, [{"none"}]>;
4328defm data_sections : BoolFOption<"data-sections",
4329  CodeGenOpts<"DataSections">, DefaultFalse,
4330  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4331          "Place each data in its own section">,
4332  NegFlag<SetFalse>>;
4333defm stack_size_section : BoolFOption<"stack-size-section",
4334  CodeGenOpts<"StackSizeSection">, DefaultFalse,
4335  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4336          "Emit section containing metadata on function stack sizes">,
4337  NegFlag<SetFalse>>;
4338def frealloc_lhs : Flag<["-"], "frealloc-lhs">, Group<f_Group>,
4339  Visibility<[FlangOption, FC1Option]>,
4340  HelpText<"If an allocatable left-hand side of an intrinsic assignment is unallocated or its shape/type does not match the right-hand side, then it is automatically (re)allocated">;
4341def fstack_usage : Flag<["-"], "fstack-usage">, Group<f_Group>,
4342  HelpText<"Emit .su file containing information on function stack sizes">;
4343def stack_usage_file : Separate<["-"], "stack-usage-file">,
4344  Visibility<[CC1Option]>,
4345  HelpText<"Filename (or -) to write stack usage output to">,
4346  MarshallingInfoString<CodeGenOpts<"StackUsageOutput">>;
4347def fextend_variable_liveness_EQ : Joined<["-"], "fextend-variable-liveness=">,
4348  Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
4349  HelpText<"Extend the liveness of user variables through optimizations to "
4350           "prevent stale or optimized-out variable values when debugging.">,
4351  Values<"all,this,none">,
4352  NormalizedValues<["All", "This", "None"]>,
4353  NormalizedValuesScope<"CodeGenOptions::ExtendVariableLivenessKind">,
4354  MarshallingInfoEnum<CodeGenOpts<"ExtendVariableLiveness">, "None">;
4355def fextend_variable_liveness : Flag<["-"], "fextend-variable-liveness">,
4356  Visibility<[ClangOption, CC1Option]>,
4357  Alias<fextend_variable_liveness_EQ>, AliasArgs<["all"]>,
4358  HelpText<"Alias for -fextend-variable-liveness=all.">;
4359
4360defm unique_basic_block_section_names : BoolFOption<"unique-basic-block-section-names",
4361  CodeGenOpts<"UniqueBasicBlockSectionNames">, DefaultFalse,
4362  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4363          "Use unique names for basic block sections (ELF Only)">,
4364  NegFlag<SetFalse>>;
4365defm unique_internal_linkage_names : BoolFOption<"unique-internal-linkage-names",
4366  CodeGenOpts<"UniqueInternalLinkageNames">, DefaultFalse,
4367  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4368          "Uniqueify Internal Linkage Symbol Names by appending"
4369            " the MD5 hash of the module path">,
4370  NegFlag<SetFalse>>;
4371defm unique_section_names : BoolFOption<"unique-section-names",
4372  CodeGenOpts<"UniqueSectionNames">, DefaultTrue,
4373  NegFlag<SetFalse, [], [ClangOption, CC1Option],
4374          "Don't use unique names for text and data sections">,
4375  PosFlag<SetTrue>>;
4376defm separate_named_sections : BoolFOption<"separate-named-sections",
4377  CodeGenOpts<"SeparateNamedSections">, DefaultFalse,
4378  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4379          "Use separate unique sections for named sections (ELF Only)">,
4380  NegFlag<SetFalse>>;
4381
4382defm split_machine_functions: BoolFOption<"split-machine-functions",
4383  CodeGenOpts<"SplitMachineFunctions">, DefaultFalse,
4384  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
4385  NegFlag<SetFalse, [], [ClangOption], "Disable">,
4386  BothFlags<[], [ClangOption], " late function splitting using profile information (x86 and aarch64 ELF)">>;
4387
4388defm strict_return : BoolFOption<"strict-return",
4389  CodeGenOpts<"StrictReturn">, DefaultTrue,
4390  NegFlag<SetFalse, [], [ClangOption, CC1Option],
4391          "Don't treat control flow paths that fall off the end"
4392            " of a non-void function as unreachable">,
4393  PosFlag<SetTrue>>;
4394
4395let Flags = [TargetSpecific] in {
4396defm ptrauth_intrinsics : OptInCC1FFlag<"ptrauth-intrinsics", "Enable pointer authentication intrinsics">;
4397defm ptrauth_calls : OptInCC1FFlag<"ptrauth-calls", "Enable signing and authentication of all indirect calls">;
4398defm ptrauth_returns : OptInCC1FFlag<"ptrauth-returns", "Enable signing and authentication of return addresses">;
4399defm ptrauth_auth_traps : OptInCC1FFlag<"ptrauth-auth-traps", "Enable traps on authentication failures">;
4400defm ptrauth_vtable_pointer_address_discrimination :
4401  OptInCC1FFlag<"ptrauth-vtable-pointer-address-discrimination", "Enable address discrimination of vtable pointers">;
4402defm ptrauth_vtable_pointer_type_discrimination :
4403  OptInCC1FFlag<"ptrauth-vtable-pointer-type-discrimination", "Enable type discrimination of vtable pointers">;
4404defm ptrauth_type_info_vtable_pointer_discrimination :
4405  OptInCC1FFlag<"ptrauth-type-info-vtable-pointer-discrimination", "Enable type and address discrimination of vtable pointer of std::type_info">;
4406defm ptrauth_function_pointer_type_discrimination : OptInCC1FFlag<"ptrauth-function-pointer-type-discrimination",
4407  "Enable type discrimination on C function pointers">;
4408defm ptrauth_indirect_gotos : OptInCC1FFlag<"ptrauth-indirect-gotos",
4409  "Enable signing and authentication of indirect goto targets">;
4410defm ptrauth_init_fini : OptInCC1FFlag<"ptrauth-init-fini", "Enable signing of function pointers in init/fini arrays">;
4411defm ptrauth_init_fini_address_discrimination : OptInCC1FFlag<"ptrauth-init-fini-address-discrimination",
4412  "Enable address discrimination of function pointers in init/fini arrays">;
4413defm ptrauth_elf_got : OptInCC1FFlag<"ptrauth-elf-got", "Enable authentication of pointers from GOT (ELF only)">;
4414defm aarch64_jump_table_hardening: OptInCC1FFlag<"aarch64-jump-table-hardening", "Use hardened lowering for jump-table dispatch">;
4415}
4416
4417def fenable_matrix : Flag<["-"], "fenable-matrix">, Group<f_Group>,
4418    Visibility<[ClangOption, CC1Option]>,
4419    HelpText<"Enable matrix data type and related builtin functions">,
4420    MarshallingInfoFlag<LangOpts<"MatrixTypes">>;
4421
4422defm raw_string_literals : BoolFOption<"raw-string-literals",
4423    LangOpts<"RawStringLiterals">, Default<std#".hasRawStringLiterals()">,
4424    PosFlag<SetTrue, [], [], "Enable">,
4425    NegFlag<SetFalse, [], [], "Disable">,
4426    BothFlags<[], [ClangOption, CC1Option], " raw string literals">>;
4427
4428def fzero_call_used_regs_EQ
4429    : Joined<["-"], "fzero-call-used-regs=">, Group<f_Group>,
4430    Visibility<[ClangOption, CC1Option]>,
4431      HelpText<"Clear call-used registers upon function return (AArch64/x86 only)">,
4432      Values<"skip,used-gpr-arg,used-gpr,used-arg,used,all-gpr-arg,all-gpr,all-arg,all">,
4433      NormalizedValues<["Skip", "UsedGPRArg", "UsedGPR", "UsedArg", "Used",
4434                        "AllGPRArg", "AllGPR", "AllArg", "All"]>,
4435      NormalizedValuesScope<"llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind">,
4436      MarshallingInfoEnum<CodeGenOpts<"ZeroCallUsedRegs">, "Skip">;
4437
4438def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
4439  HelpText<"Place debug types in their own section (ELF Only)">;
4440def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group<f_Group>;
4441defm debug_ranges_base_address : BoolFOption<"debug-ranges-base-address",
4442  CodeGenOpts<"DebugRangesBaseAddress">, DefaultFalse,
4443  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4444          "Use DWARF base address selection entries in .debug_ranges">,
4445  NegFlag<SetFalse>>;
4446defm split_dwarf_inlining : BoolFOption<"split-dwarf-inlining",
4447  CodeGenOpts<"SplitDwarfInlining">, DefaultFalse,
4448  NegFlag<SetFalse, [], [ClangOption]>,
4449  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4450          "Provide minimal debug info in the object/executable"
4451          " to facilitate online symbolication/stack traces in the absence of"
4452          " .dwo/.dwp files when using Split DWARF">>;
4453def fdebug_default_version: Joined<["-"], "fdebug-default-version=">, Group<f_Group>,
4454  HelpText<"Default DWARF version to use, if a -g option caused DWARF debug info to be produced">;
4455def fdebug_prefix_map_EQ
4456  : Joined<["-"], "fdebug-prefix-map=">, Group<f_Group>,
4457    Visibility<[ClangOption, CC1Option, CC1AsOption]>,
4458    MetaVarName<"<old>=<new>">,
4459    HelpText<"For paths in debug info, remap directory <old> to <new>. If multiple options match a path, the last option wins">;
4460def fcoverage_prefix_map_EQ
4461  : Joined<["-"], "fcoverage-prefix-map=">, Group<f_Group>,
4462    Visibility<[ClangOption, CC1Option]>,
4463    MetaVarName<"<old>=<new>">,
4464    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">;
4465def ffile_prefix_map_EQ
4466  : Joined<["-"], "ffile-prefix-map=">, Group<f_Group>,
4467    HelpText<"remap file source paths in debug info, coverage mapping, predefined preprocessor "
4468             "macros and __builtin_FILE(). Implies -ffile-reproducible.">;
4469def fmacro_prefix_map_EQ
4470  : Joined<["-"], "fmacro-prefix-map=">, Group<f_Group>,
4471  Visibility<[ClangOption, CC1Option]>,
4472    HelpText<"remap file source paths in predefined preprocessor macros and "
4473             "__builtin_FILE(). Implies -ffile-reproducible.">;
4474defm force_dwarf_frame : BoolFOption<"force-dwarf-frame",
4475  CodeGenOpts<"ForceDwarfFrameSection">, DefaultFalse,
4476  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4477          "Always emit a debug frame section">,
4478  NegFlag<SetFalse>>;
4479def femit_dwarf_unwind_EQ : Joined<["-"], "femit-dwarf-unwind=">,
4480  Group<f_Group>, Visibility<[ClangOption, CC1Option, CC1AsOption]>,
4481  HelpText<"When to emit DWARF unwind (EH frame) info">,
4482  Values<"always,no-compact-unwind,default">,
4483  NormalizedValues<["Always", "NoCompactUnwind", "Default"]>,
4484  NormalizedValuesScope<"llvm::EmitDwarfUnwindType">,
4485  MarshallingInfoEnum<CodeGenOpts<"EmitDwarfUnwind">, "Default">;
4486defm emit_compact_unwind_non_canonical : BoolFOption<"emit-compact-unwind-non-canonical",
4487  CodeGenOpts<"EmitCompactUnwindNonCanonical">, DefaultFalse,
4488  PosFlag<SetTrue, [], [ClangOption, CC1Option, CC1AsOption],
4489          "Try emitting Compact-Unwind for non-canonical entries. Maybe overridden by other constraints">,
4490  NegFlag<SetFalse>>;
4491def g_Flag : Flag<["-"], "g">, Group<g_Group>,
4492    Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
4493    HelpText<"Generate source-level debug information">;
4494def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<gN_Group>,
4495  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
4496  HelpText<"Emit debug line number tables only">;
4497def gline_directives_only : Flag<["-"], "gline-directives-only">, Group<gN_Group>,
4498  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
4499  HelpText<"Emit debug line info directives only">;
4500def gmlt : Flag<["-"], "gmlt">, Alias<gline_tables_only>;
4501def g0 : Flag<["-"], "g0">, Group<gN_Group>, Visibility<[ClangOption, FlangOption]>;
4502def g1 : Flag<["-"], "g1">, Group<gN_Group>, Visibility<[ClangOption, FlangOption]>, Alias<gline_tables_only>;
4503def g2 : Flag<["-"], "g2">, Group<gN_Group>, Visibility<[ClangOption, FlangOption]>;
4504def g3 : Flag<["-"], "g3">, Group<gN_Group>, Visibility<[ClangOption, FlangOption]>;
4505def ggdb : Flag<["-"], "ggdb">, Group<gTune_Group>;
4506def ggdb0 : Flag<["-"], "ggdb0">, Group<ggdbN_Group>;
4507def ggdb1 : Flag<["-"], "ggdb1">, Group<ggdbN_Group>;
4508def ggdb2 : Flag<["-"], "ggdb2">, Group<ggdbN_Group>;
4509def ggdb3 : Flag<["-"], "ggdb3">, Group<ggdbN_Group>;
4510def glldb : Flag<["-"], "glldb">, Group<gTune_Group>;
4511def gsce : Flag<["-"], "gsce">, Group<gTune_Group>;
4512def gdbx : Flag<["-"], "gdbx">, Group<gTune_Group>;
4513// Equivalent to our default dwarf version. Forces usual dwarf emission when
4514// CodeView is enabled.
4515def gdwarf : Flag<["-"], "gdwarf">, Group<g_Group>,
4516  Visibility<[ClangOption, CLOption, DXCOption]>,
4517  HelpText<"Generate source-level debug information with the default dwarf version">;
4518def gdwarf_2 : Flag<["-"], "gdwarf-2">, Group<g_Group>,
4519  HelpText<"Generate source-level debug information with dwarf version 2">;
4520def gdwarf_3 : Flag<["-"], "gdwarf-3">, Group<g_Group>,
4521  HelpText<"Generate source-level debug information with dwarf version 3">;
4522def gdwarf_4 : Flag<["-"], "gdwarf-4">, Group<g_Group>,
4523  HelpText<"Generate source-level debug information with dwarf version 4">;
4524def gdwarf_5 : Flag<["-"], "gdwarf-5">, Group<g_Group>,
4525  HelpText<"Generate source-level debug information with dwarf version 5">;
4526def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>,
4527  Visibility<[ClangOption, CC1Option, CC1AsOption]>,
4528  HelpText<"Enables DWARF64 format for ELF binaries, if debug information emission is enabled.">,
4529  MarshallingInfoFlag<CodeGenOpts<"Dwarf64">>;
4530def gdwarf32 : Flag<["-"], "gdwarf32">, Group<g_Group>,
4531  Visibility<[ClangOption, CC1Option, CC1AsOption]>,
4532  HelpText<"Enables DWARF32 format for ELF binaries, if debug information emission is enabled.">;
4533
4534def gcodeview : Flag<["-"], "gcodeview">,
4535  HelpText<"Generate CodeView debug information">,
4536  Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
4537  MarshallingInfoFlag<CodeGenOpts<"EmitCodeView">>;
4538defm codeview_ghash : BoolOption<"g", "codeview-ghash",
4539  CodeGenOpts<"CodeViewGHash">, DefaultFalse,
4540  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4541          "Emit type record hashes in a .debug$H section">,
4542  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
4543defm codeview_command_line : BoolOption<"g", "codeview-command-line",
4544  CodeGenOpts<"CodeViewCommandLine">, DefaultTrue,
4545  PosFlag<SetTrue, [], [ClangOption], "Emit compiler path and command line into CodeView debug information">,
4546  NegFlag<SetFalse, [], [ClangOption], "Don't emit compiler path and command line into CodeView debug information">,
4547  BothFlags<[], [ClangOption, CLOption, DXCOption, CC1Option]>>;
4548defm inline_line_tables : BoolGOption<"inline-line-tables",
4549  CodeGenOpts<"NoInlineLineTables">, DefaultFalse,
4550  NegFlag<SetTrue, [], [ClangOption, CC1Option],
4551          "Don't emit inline line tables.">,
4552  PosFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
4553
4554def gfull : Flag<["-"], "gfull">, Group<g_Group>;
4555def gused : Flag<["-"], "gused">, Group<g_Group>;
4556def gstabs : Joined<["-"], "gstabs">, Group<g_Group>, Flags<[Unsupported]>;
4557def gcoff : Joined<["-"], "gcoff">, Group<g_Group>, Flags<[Unsupported]>;
4558def gxcoff : Joined<["-"], "gxcoff">, Group<g_Group>, Flags<[Unsupported]>;
4559def gvms : Joined<["-"], "gvms">, Group<g_Group>, Flags<[Unsupported]>;
4560def gtoggle : Flag<["-"], "gtoggle">, Group<g_flags_Group>, Flags<[Unsupported]>;
4561def grecord_command_line : Flag<["-"], "grecord-command-line">,
4562  Group<g_flags_Group>;
4563def gno_record_command_line : Flag<["-"], "gno-record-command-line">,
4564  Group<g_flags_Group>;
4565def : Flag<["-"], "grecord-gcc-switches">, Alias<grecord_command_line>;
4566def : Flag<["-"], "gno-record-gcc-switches">, Alias<gno_record_command_line>;
4567defm strict_dwarf : BoolOption<"g", "strict-dwarf",
4568  CodeGenOpts<"DebugStrictDwarf">, DefaultFalse,
4569  PosFlag<SetTrue, [], [ClangOption, CC1Option],
4570          "Restrict DWARF features to those defined in "
4571          "the specified version, avoiding features from later versions.">,
4572  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
4573  Group<g_flags_Group>;
4574defm omit_unreferenced_methods : BoolGOption<"omit-unreferenced-methods",
4575  CodeGenOpts<"DebugOmitUnreferencedMethods">, DefaultFalse,
4576  NegFlag<SetFalse>,
4577  PosFlag<SetTrue, [], [CC1Option]>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
4578defm column_info : BoolOption<"g", "column-info",
4579  CodeGenOpts<"DebugColumnInfo">, DefaultTrue,
4580  NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
4581  PosFlag<SetTrue>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
4582  Group<g_flags_Group>;
4583def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>,
4584  Visibility<[ClangOption, CLOption, DXCOption]>;
4585def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group<g_flags_Group>,
4586  Visibility<[ClangOption, CLOption, DXCOption]>,
4587  HelpText<"Set DWARF fission mode">,
4588  Values<"split,single">;
4589def gno_split_dwarf : Flag<["-"], "gno-split-dwarf">, Group<g_flags_Group>,
4590  Visibility<[ClangOption, CLOption, DXCOption]>;
4591def gtemplate_alias : Flag<["-"], "gtemplate-alias">, Group<g_flags_Group>, Visibility<[ClangOption, CC1Option]>;
4592def gno_template_alias : Flag<["-"], "gno-template-alias">, Group<g_flags_Group>, Visibility<[ClangOption]>;
4593def gsimple_template_names : Flag<["-"], "gsimple-template-names">, Group<g_flags_Group>;
4594def gsimple_template_names_EQ
4595    : Joined<["-"], "gsimple-template-names=">,
4596      HelpText<"Use simple template names in DWARF, or include the full "
4597               "template name with a modified prefix for validation">,
4598      Values<"simple,mangled">, Visibility<[CC1Option]>;
4599def gsrc_hash_EQ : Joined<["-"], "gsrc-hash=">,
4600  Group<g_flags_Group>, Visibility<[CC1Option]>,
4601  Values<"md5,sha1,sha256">,
4602  NormalizedValues<["DSH_MD5", "DSH_SHA1", "DSH_SHA256"]>,
4603  NormalizedValuesScope<"CodeGenOptions">,
4604  MarshallingInfoEnum<CodeGenOpts<"DebugSrcHash">, "DSH_MD5">;
4605def gno_simple_template_names : Flag<["-"], "gno-simple-template-names">,
4606                                Group<g_flags_Group>;
4607def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>,
4608  Visibility<[ClangOption, CC1Option]>;
4609def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>;
4610def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>,
4611  Visibility<[ClangOption, CC1Option]>;
4612def gno_pubnames : Flag<["-"], "gno-pubnames">, Group<g_flags_Group>;
4613def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group<g_flags_Group>;
4614def gmodules : Flag <["-"], "gmodules">, Group<gN_Group>,
4615  HelpText<"Generate debug info with external references to clang modules"
4616           " or precompiled headers">;
4617def gno_modules : Flag <["-"], "gno-modules">, Group<g_flags_Group>;
4618def gz_EQ : Joined<["-"], "gz=">, Group<g_flags_Group>,
4619    HelpText<"DWARF debug sections compression type">;
4620def gz : Flag<["-"], "gz">, Alias<gz_EQ>, AliasArgs<["zlib"]>, Group<g_flags_Group>;
4621def gembed_source : Flag<["-"], "gembed-source">, Group<g_flags_Group>,
4622  Visibility<[ClangOption, CC1Option]>,
4623    HelpText<"Embed source text in DWARF debug sections">,
4624    MarshallingInfoFlag<CodeGenOpts<"EmbedSource">>;
4625def gno_embed_source : Flag<["-"], "gno-embed-source">, Group<g_flags_Group>,
4626    Flags<[NoXarchOption]>,
4627    HelpText<"Restore the default behavior of not embedding source text in DWARF debug sections">;
4628def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">;
4629def help : Flag<["-", "--"], "help">,
4630    Visibility<[ClangOption, CC1Option, CC1AsOption,
4631                FC1Option, FlangOption, DXCOption]>,
4632    HelpText<"Display available options">,
4633    MarshallingInfoFlag<FrontendOpts<"ShowHelp">>;
4634def ibuiltininc : Flag<["-"], "ibuiltininc">, Group<clang_i_Group>,
4635  HelpText<"Enable builtin #include directories even when -nostdinc is used "
4636           "before or after -ibuiltininc. "
4637           "Using -nobuiltininc after the option disables it">;
4638def iapinotes_modules : JoinedOrSeparate<["-"], "iapinotes-modules">, Group<clang_i_Group>,
4639  Visibility<[ClangOption, CC1Option]>,
4640  HelpText<"Add directory to the API notes search path referenced by module name">, MetaVarName<"<directory>">;
4641def idirafter : JoinedOrSeparate<["-"], "idirafter">, Group<clang_i_Group>,
4642  Visibility<[ClangOption, CC1Option]>,
4643  HelpText<"Add directory to AFTER include search path">;
4644def iframework : JoinedOrSeparate<["-"], "iframework">, Group<clang_i_Group>,
4645  Visibility<[ClangOption, CC1Option]>,
4646  HelpText<"Add directory to SYSTEM framework search path">;
4647def iframeworkwithsysroot : JoinedOrSeparate<["-"], "iframeworkwithsysroot">,
4648  Group<clang_i_Group>,
4649  HelpText<"Add directory to SYSTEM framework search path, "
4650           "absolute paths are relative to -isysroot">,
4651  MetaVarName<"<directory>">, Visibility<[ClangOption, CC1Option]>;
4652def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>,
4653  Visibility<[ClangOption, CC1Option]>,
4654  HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">,
4655  MarshallingInfoStringVector<PreprocessorOpts<"MacroIncludes">>;
4656def image__base : Separate<["-"], "image_base">;
4657def include_ : JoinedOrSeparate<["-", "--"], "include">, Group<clang_i_Group>, EnumName<"include">,
4658    MetaVarName<"<file>">, HelpText<"Include file before parsing">,
4659    Visibility<[ClangOption, CC1Option]>;
4660def include_pch : Separate<["-"], "include-pch">, Group<clang_i_Group>,
4661  Visibility<[ClangOption, CC1Option]>,
4662  HelpText<"Include precompiled header file">, MetaVarName<"<file>">,
4663  MarshallingInfoString<PreprocessorOpts<"ImplicitPCHInclude">>;
4664def relocatable_pch : Flag<["-", "--"], "relocatable-pch">,
4665  Visibility<[ClangOption, CC1Option]>,
4666  HelpText<"Whether to build a relocatable precompiled header">,
4667  MarshallingInfoFlag<FrontendOpts<"RelocatablePCH">>;
4668def verify_pch : Flag<["-"], "verify-pch">, Group<Action_Group>,
4669  Visibility<[ClangOption, CC1Option]>,
4670  HelpText<"Load and verify that a pre-compiled header file is not stale">;
4671def init : Separate<["-"], "init">;
4672def install__name : Separate<["-"], "install_name">;
4673def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>,
4674  Visibility<[ClangOption, CC1Option]>,
4675  HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"<dir>">;
4676def iquote : JoinedOrSeparate<["-"], "iquote">, Group<clang_i_Group>,
4677  Visibility<[ClangOption, CC1Option]>,
4678  HelpText<"Add directory to QUOTE include search path">, MetaVarName<"<directory>">;
4679def isysroot : JoinedOrSeparate<["-"], "isysroot">, Group<clang_i_Group>,
4680  Visibility<[ClangOption, CC1Option, FlangOption]>,
4681  HelpText<"Set the system root directory (usually /)">, MetaVarName<"<dir>">,
4682  MarshallingInfoString<HeaderSearchOpts<"Sysroot">, [{"/"}]>;
4683def isystem : JoinedOrSeparate<["-"], "isystem">, Group<clang_i_Group>,
4684  Visibility<[ClangOption, CC1Option]>,
4685  HelpText<"Add directory to SYSTEM include search path">, MetaVarName<"<directory>">;
4686def isystem_after : JoinedOrSeparate<["-"], "isystem-after">,
4687  Group<clang_i_Group>, Flags<[NoXarchOption]>, MetaVarName<"<directory>">,
4688  HelpText<"Add directory to end of the SYSTEM include search path">;
4689def iwithprefixbefore : JoinedOrSeparate<["-"], "iwithprefixbefore">, Group<clang_i_Group>,
4690  HelpText<"Set directory to include search path with prefix">, MetaVarName<"<dir>">,
4691  Visibility<[ClangOption, CC1Option]>;
4692def iwithprefix : JoinedOrSeparate<["-"], "iwithprefix">, Group<clang_i_Group>,
4693  Visibility<[ClangOption, CC1Option]>,
4694  HelpText<"Set directory to SYSTEM include search path with prefix">, MetaVarName<"<dir>">;
4695def iwithsysroot : JoinedOrSeparate<["-"], "iwithsysroot">, Group<clang_i_Group>,
4696  HelpText<"Add directory to SYSTEM include search path, "
4697           "absolute paths are relative to -isysroot">, MetaVarName<"<directory>">,
4698  Visibility<[ClangOption, CC1Option]>;
4699def ivfsoverlay : JoinedOrSeparate<["-"], "ivfsoverlay">, Group<clang_i_Group>,
4700  Visibility<[ClangOption, CC1Option]>,
4701  HelpText<"Overlay the virtual filesystem described by file over the real file system">;
4702def vfsoverlay : JoinedOrSeparate<["-", "--"], "vfsoverlay">,
4703  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
4704  HelpText<"Overlay the virtual filesystem described by file over the real file system. "
4705           "Additionally, pass this overlay file to the linker if it supports it">;
4706def imultilib : Separate<["-"], "imultilib">, Group<gfortran_Group>;
4707def K : Flag<["-"], "K">, Flags<[LinkerInput]>;
4708def keep__private__externs : Flag<["-"], "keep_private_externs">;
4709def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>,
4710        Visibility<[ClangOption, FlangOption]>, Group<Link_Group>;
4711def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>;
4712def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>;
4713def mlittle_endian : Flag<["-"], "mlittle-endian">, Group<m_Group>,
4714  Flags<[NoXarchOption, TargetSpecific]>;
4715def EL : Flag<["-"], "EL">, Alias<mlittle_endian>;
4716def mbig_endian : Flag<["-"], "mbig-endian">, Group<m_Group>,
4717  Flags<[NoXarchOption, TargetSpecific]>;
4718def EB : Flag<["-"], "EB">, Alias<mbig_endian>;
4719def m16 : Flag<["-"], "m16">, Group<m_Group>, Flags<[NoXarchOption]>,
4720  Visibility<[ClangOption, CLOption, DXCOption]>;
4721def m32 : Flag<["-"], "m32">, Group<m_Group>, Flags<[NoXarchOption]>,
4722  Visibility<[ClangOption, CLOption, DXCOption]>;
4723def maix32 : Flag<["-"], "maix32">, Group<m_Group>, Flags<[NoXarchOption]>;
4724def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group<m_Group>,
4725  Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
4726  HelpText<"Enable hexagon-qdsp6 backward compatibility">,
4727  MarshallingInfoFlag<LangOpts<"HexagonQdsp6Compat">>;
4728def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[NoXarchOption]>,
4729  Visibility<[ClangOption, CLOption, DXCOption]>;
4730def maix64 : Flag<["-"], "maix64">, Group<m_Group>, Flags<[NoXarchOption]>;
4731def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[NoXarchOption]>,
4732  Visibility<[ClangOption, CLOption, DXCOption]>;
4733def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[NoXarchOption]>,
4734  Visibility<[ClangOption, CLOption]>,
4735  HelpText<"Use Intel MCU ABI">;
4736def mno_iamcu : Flag<["-"], "mno-iamcu">, Group<m_Group>,
4737  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption]>;
4738def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group<clang_ignored_m_Group>;
4739def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group<clang_ignored_m_Group>;
4740def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group<clang_ignored_m_Group>;
4741
4742let Flags = [TargetSpecific] in {
4743def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>,
4744  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4745def malign_branch_EQ : CommaJoined<["-"], "malign-branch=">, Group<m_Group>,
4746  HelpText<"Specify types of branches to align">;
4747def malign_branch_boundary_EQ : Joined<["-"], "malign-branch-boundary=">, Group<m_Group>,
4748  HelpText<"Specify the boundary's size to align branches">;
4749def mpad_max_prefix_size_EQ : Joined<["-"], "mpad-max-prefix-size=">, Group<m_Group>,
4750  HelpText<"Specify maximum number of prefixes to use for padding">;
4751def mbranches_within_32B_boundaries : Flag<["-"], "mbranches-within-32B-boundaries">, Group<m_Group>,
4752  HelpText<"Align selected branches (fused, jcc, jmp) within 32-byte boundary">;
4753def mfancy_math_387 : Flag<["-"], "mfancy-math-387">, Group<clang_ignored_m_Group>;
4754def mlong_calls : Flag<["-"], "mlong-calls">, Group<m_Group>,
4755  HelpText<"Generate branches with extended addressability, usually via indirect jumps.">;
4756} // let Flags = [TargetSpecific]
4757def mdouble_EQ : Joined<["-"], "mdouble=">, Group<m_Group>,
4758  MetaVarName<"<n">, Values<"32,64">, Visibility<[ClangOption, CC1Option]>,
4759  HelpText<"Force double to be <n> bits">,
4760  MarshallingInfoInt<LangOpts<"DoubleSize">, "0">;
4761def mlong_double_64 : Flag<["-"], "mlong-double-64">, Group<LongDouble_Group>,
4762  Visibility<[ClangOption, CC1Option]>,
4763  HelpText<"Force long double to be 64 bits">;
4764def mlong_double_80 : Flag<["-"], "mlong-double-80">, Group<LongDouble_Group>,
4765  Visibility<[ClangOption, CC1Option]>,
4766  HelpText<"Force long double to be 80 bits, padded to 128 bits for storage">;
4767def mlong_double_128 : Flag<["-"], "mlong-double-128">, Group<LongDouble_Group>,
4768  Visibility<[ClangOption, CC1Option]>,
4769  HelpText<"Force long double to be 128 bits">;
4770let Flags = [TargetSpecific] in {
4771def mno_long_calls : Flag<["-"], "mno-long-calls">, Group<m_Group>,
4772  HelpText<"Restore the default behaviour of not generating long calls">;
4773} // let Flags = [TargetSpecific]
4774def mexecute_only : Flag<["-"], "mexecute-only">, Group<m_arm_Features_Group>,
4775  HelpText<"Disallow generation of data access to code sections (ARM only)">;
4776def mno_execute_only : Flag<["-"], "mno-execute-only">, Group<m_arm_Features_Group>,
4777  HelpText<"Allow generation of data access to code sections (ARM only)">;
4778let Flags = [TargetSpecific] in {
4779def 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">,
4780  HelpText<"Thread pointer access method. "
4781           "For AArch32: 'soft' uses a function call, or 'tpidrurw', 'tpidruro' or 'tpidrprw' use the three CP15 registers. 'cp15' is an alias for 'tpidruro'. "
4782           "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'.">;
4783def mpure_code : Flag<["-"], "mpure-code">, Alias<mexecute_only>; // Alias for GCC compatibility
4784def mno_pure_code : Flag<["-"], "mno-pure-code">, Alias<mno_execute_only>;
4785def mtvos_version_min_EQ : Joined<["-"], "mtvos-version-min=">, Group<m_Group>;
4786def mappletvos_version_min_EQ : Joined<["-"], "mappletvos-version-min=">, Alias<mtvos_version_min_EQ>;
4787def mtvos_simulator_version_min_EQ : Joined<["-"], "mtvos-simulator-version-min=">;
4788def mappletvsimulator_version_min_EQ : Joined<["-"], "mappletvsimulator-version-min=">, Alias<mtvos_simulator_version_min_EQ>;
4789def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, Group<m_Group>;
4790def mwatchos_simulator_version_min_EQ : Joined<["-"], "mwatchos-simulator-version-min=">, Group<m_Group>;
4791def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias<mwatchos_simulator_version_min_EQ>;
4792} // let Flags = [TargetSpecific]
4793def march_EQ : Joined<["-"], "march=">, Group<m_Group>,
4794  Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
4795  HelpText<"For a list of available architectures for the target use '-mcpu=help'">;
4796def masm_EQ : Joined<["-"], "masm=">, Group<m_Group>, Visibility<[ClangOption, FlangOption]>;
4797def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group<m_Group>,
4798  Visibility<[ClangOption, CC1Option]>,
4799  Values<"att,intel">,
4800  NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["IAD_ATT", "IAD_Intel"]>,
4801  MarshallingInfoEnum<CodeGenOpts<"InlineAsmDialect">, "IAD_ATT">;
4802def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>,
4803  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
4804  MarshallingInfoString<TargetOpts<"CodeModel">, [{"default"}]>;
4805def mlarge_data_threshold_EQ : Joined<["-"], "mlarge-data-threshold=">, Group<m_Group>,
4806  Flags<[TargetSpecific]>, Visibility<[ClangOption, CC1Option,FlangOption, FC1Option]>,
4807  MarshallingInfoInt<TargetOpts<"LargeDataThreshold">, "0">;
4808def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>,
4809  Visibility<[ClangOption, CC1Option]>,
4810  HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
4811           "12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">,
4812  MarshallingInfoInt<CodeGenOpts<"TLSSize">>;
4813def mtls_dialect_EQ : Joined<["-"], "mtls-dialect=">, Group<m_Group>,
4814  Flags<[TargetSpecific]>, HelpText<"Which thread-local storage dialect to use for dynamic accesses of TLS variables">;
4815def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group<m_Group>;
4816def mdefault_build_attributes : Joined<["-"], "mdefault-build-attributes">, Group<m_Group>;
4817def mno_default_build_attributes : Joined<["-"], "mno-default-build-attributes">, Group<m_Group>;
4818let Flags = [TargetSpecific] in {
4819def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group<clang_ignored_m_Group>;
4820def mconsole : Joined<["-"], "mconsole">, Group<m_Group>;
4821def mwindows : Joined<["-"], "mwindows">, Group<m_Group>;
4822def mdll : Joined<["-"], "mdll">, Group<m_Group>;
4823def municode : Joined<["-"], "municode">, Group<m_Group>;
4824def mthreads : Joined<["-"], "mthreads">, Group<m_Group>;
4825def marm64x : Joined<["-"], "marm64x">, Group<m_Group>,
4826  Visibility<[ClangOption, CLOption]>,
4827  HelpText<"Link as a hybrid ARM64X image">;
4828def mguard_EQ : Joined<["-"], "mguard=">, Group<m_Group>,
4829  HelpText<"Enable or disable Control Flow Guard checks and guard tables emission">,
4830  Values<"none,cf,cf-nochecks">;
4831def mmcu_EQ : Joined<["-"], "mmcu=">, Group<m_Group>;
4832def msim : Flag<["-"], "msim">, Group<m_Group>;
4833def mfix_and_continue : Flag<["-"], "mfix-and-continue">, Group<clang_ignored_m_Group>;
4834def mieee_fp : Flag<["-"], "mieee-fp">, Group<clang_ignored_m_Group>;
4835def minline_all_stringops : Flag<["-"], "minline-all-stringops">, Group<clang_ignored_m_Group>;
4836def mno_inline_all_stringops : Flag<["-"], "mno-inline-all-stringops">, Group<clang_ignored_m_Group>;
4837} // let Flags = [TargetSpecific]
4838def malign_double : Flag<["-"], "malign-double">, Group<m_Group>,
4839  Visibility<[ClangOption, CC1Option]>,
4840  HelpText<"Align doubles to two words in structs (x86 only)">,
4841  MarshallingInfoFlag<LangOpts<"AlignDouble">>;
4842let Flags = [TargetSpecific] in {
4843def mfloat_abi_EQ : Joined<["-"], "mfloat-abi=">, Group<m_Group>, Values<"soft,softfp,hard">;
4844def mfpmath_EQ : Joined<["-"], "mfpmath=">, Group<m_Group>;
4845def mfpu_EQ : Joined<["-"], "mfpu=">, Group<m_Group>;
4846def mhwdiv_EQ : Joined<["-"], "mhwdiv=">, Group<m_Group>;
4847def mhwmult_EQ : Joined<["-"], "mhwmult=">, Group<m_Group>;
4848} // let Flags = [TargetSpecific]
4849def mglobal_merge : Flag<["-"], "mglobal-merge">, Group<m_Group>,
4850  Visibility<[ClangOption, CC1Option]>,
4851  HelpText<"Enable merging of globals">;
4852let Flags = [TargetSpecific] in {
4853def mhard_float : Flag<["-"], "mhard-float">, Group<m_Group>;
4854def mios_version_min_EQ : Joined<["-"], "mios-version-min=">,
4855  Group<m_Group>, HelpText<"Set iOS deployment target">;
4856def : Joined<["-"], "miphoneos-version-min=">,
4857  Group<m_Group>, Alias<mios_version_min_EQ>;
4858def mios_simulator_version_min_EQ : Joined<["-"], "mios-simulator-version-min=">, Group<m_Group>;
4859def : Joined<["-"], "miphonesimulator-version-min=">, Alias<mios_simulator_version_min_EQ>;
4860def mkernel : Flag<["-"], "mkernel">, Group<m_Group>;
4861def mlinker_version_EQ : Joined<["-"], "mlinker-version=">, Group<m_Group>,
4862  Flags<[NoXarchOption]>;
4863} // let Flags = [TargetSpecific]
4864def mllvm : Separate<["-"], "mllvm">,
4865  Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption, FC1Option, FlangOption]>,
4866  HelpText<"Additional arguments to forward to LLVM's option processing">,
4867  MarshallingInfoStringVector<FrontendOpts<"LLVMArgs">>;
4868def : Joined<["-"], "mllvm=">,
4869  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, Alias<mllvm>,
4870  HelpText<"Alias for -mllvm">, MetaVarName<"<arg>">;
4871def mmlir : Separate<["-"], "mmlir">,
4872  Visibility<[ClangOption, CLOption, FC1Option, FlangOption]>,
4873  HelpText<"Additional arguments to forward to MLIR's option processing">;
4874def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">,
4875  Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
4876  HelpText<"Set Fuchsia API level">,
4877  MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>;
4878def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
4879  Group<m_Group>, HelpText<"Set macOS deployment target">;
4880def : Joined<["-"], "mmacosx-version-min=">,
4881  Group<m_Group>, Alias<mmacos_version_min_EQ>;
4882def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>,
4883  Visibility<[ClangOption, CC1Option]>,
4884  HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">,
4885  MarshallingInfoFlag<LangOpts<"MSBitfields">>;
4886def moutline : Flag<["-"], "moutline">, Group<f_clang_Group>,
4887  Visibility<[ClangOption, CC1Option]>,
4888    HelpText<"Enable function outlining (AArch64 only)">;
4889def mno_outline : Flag<["-"], "mno-outline">, Group<f_clang_Group>,
4890  Visibility<[ClangOption, CC1Option]>,
4891    HelpText<"Disable function outlining (AArch64 only)">;
4892def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
4893  HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">;
4894def mskip_rax_setup : Flag<["-"], "mskip-rax-setup">, Group<m_Group>,
4895  Visibility<[ClangOption, CC1Option]>,
4896  HelpText<"Skip setting up RAX register when passing variable arguments (x86 only)">,
4897  MarshallingInfoFlag<CodeGenOpts<"SkipRaxSetup">>;
4898def mno_skip_rax_setup : Flag<["-"], "mno-skip-rax-setup">, Group<m_Group>,
4899  Visibility<[ClangOption, CC1Option]>;
4900def mstackrealign : Flag<["-"], "mstackrealign">, Group<m_Group>,
4901  Visibility<[ClangOption, CC1Option]>,
4902  HelpText<"Force realign the stack at entry to every function">,
4903  MarshallingInfoFlag<CodeGenOpts<"StackRealignment">>;
4904def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group<m_Group>,
4905  Visibility<[ClangOption, CC1Option]>,
4906  HelpText<"Set the stack alignment">,
4907  MarshallingInfoInt<CodeGenOpts<"StackAlignment">>;
4908def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group<m_Group>,
4909  Visibility<[ClangOption, CC1Option]>,
4910  HelpText<"Set the stack probe size">,
4911  MarshallingInfoInt<CodeGenOpts<"StackProbeSize">, "4096">;
4912def mstack_arg_probe : Flag<["-"], "mstack-arg-probe">, Group<m_Group>,
4913  HelpText<"Enable stack probes">;
4914def mzos_sys_include_EQ : Joined<["-"], "mzos-sys-include=">, MetaVarName<"<SysInclude>">,
4915    HelpText<"Path to system headers on z/OS">;
4916def mno_stack_arg_probe : Flag<["-"], "mno-stack-arg-probe">, Group<m_Group>,
4917  Visibility<[ClangOption, CC1Option]>,
4918  HelpText<"Disable stack probes which are enabled by default">,
4919  MarshallingInfoFlag<CodeGenOpts<"NoStackArgProbe">>;
4920def mthread_model : Separate<["-"], "mthread-model">, Group<m_Group>,
4921  Visibility<[ClangOption, CC1Option]>,
4922  HelpText<"The thread model to use. Defaults to 'posix')">, Values<"posix,single">,
4923  NormalizedValues<["POSIX", "Single"]>, NormalizedValuesScope<"LangOptions::ThreadModelKind">,
4924  MarshallingInfoEnum<LangOpts<"ThreadModel">, "POSIX">;
4925def meabi : Separate<["-"], "meabi">, Group<m_Group>,
4926  Visibility<[ClangOption, CC1Option]>,
4927  HelpText<"Set EABI type. Default depends on triple)">, Values<"default,4,5,gnu">,
4928  MarshallingInfoEnum<TargetOpts<"EABIVersion">, "Default">,
4929  NormalizedValuesScope<"llvm::EABI">,
4930  NormalizedValues<["Default", "EABI4", "EABI5", "GNU"]>;
4931def mtargetos_EQ : Joined<["-"], "mtargetos=">, Group<m_Group>,
4932  HelpText<"Set the deployment target to be the specified OS and OS version">;
4933def mzos_hlq_le_EQ : Joined<["-"], "mzos-hlq-le=">, MetaVarName<"<LeHLQ>">,
4934  HelpText<"High level qualifier for z/OS Language Environment datasets">;
4935def mzos_hlq_clang_EQ : Joined<["-"], "mzos-hlq-clang=">, MetaVarName<"<ClangHLQ>">,
4936  HelpText<"High level qualifier for z/OS C++RT side deck datasets">;
4937def mzos_hlq_csslib_EQ : Joined<["-"], "mzos-hlq-csslib=">, MetaVarName<"<CsslibHLQ>">,
4938  HelpText<"High level qualifier for z/OS CSSLIB dataset">;
4939
4940def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group<m_Group>;
4941def mno_global_merge : Flag<["-"], "mno-global-merge">, Group<m_Group>,
4942  Visibility<[ClangOption, CC1Option]>,
4943  HelpText<"Disable merging of globals">;
4944def mno_pascal_strings : Flag<["-"], "mno-pascal-strings">,
4945  Alias<fno_pascal_strings>;
4946def mno_red_zone : Flag<["-"], "mno-red-zone">, Group<m_Group>;
4947def mno_tls_direct_seg_refs : Flag<["-"], "mno-tls-direct-seg-refs">, Group<m_Group>,
4948  Visibility<[ClangOption, CC1Option]>,
4949  HelpText<"Disable direct TLS access through segment registers">,
4950  MarshallingInfoFlag<CodeGenOpts<"IndirectTlsSegRefs">>;
4951def mno_relax_all : Flag<["-"], "mno-relax-all">, Group<m_Group>;
4952let Flags = [TargetSpecific] in {
4953def mno_rtd: Flag<["-"], "mno-rtd">, Group<m_Group>;
4954def mno_soft_float : Flag<["-"], "mno-soft-float">, Group<m_Group>;
4955def mno_stackrealign : Flag<["-"], "mno-stackrealign">, Group<m_Group>;
4956} // let Flags = [TargetSpecific]
4957
4958def mretpoline : Flag<["-"], "mretpoline">, Group<m_Group>,
4959  Visibility<[ClangOption, CLOption]>;
4960def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_Group>,
4961  Visibility<[ClangOption, CLOption]>;
4962defm speculative_load_hardening : BoolMOption<"speculative-load-hardening",
4963  CodeGenOpts<"SpeculativeLoadHardening">, DefaultFalse,
4964  PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
4965  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption]>>;
4966def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group<m_Group>,
4967  Visibility<[ClangOption, CLOption]>,
4968  HelpText<"Enable all mitigations for Load Value Injection (LVI)">;
4969def mno_lvi_hardening : Flag<["-"], "mno-lvi-hardening">, Group<m_Group>,
4970  Visibility<[ClangOption, CLOption]>,
4971  HelpText<"Disable mitigations for Load Value Injection (LVI)">;
4972def mlvi_cfi : Flag<["-"], "mlvi-cfi">, Group<m_Group>, Flags<[NoXarchOption]>,
4973  Visibility<[ClangOption, CLOption]>,
4974  HelpText<"Enable only control-flow mitigations for Load Value Injection (LVI)">;
4975def mno_lvi_cfi : Flag<["-"], "mno-lvi-cfi">, Group<m_Group>,
4976  Visibility<[ClangOption, CLOption]>,
4977  HelpText<"Disable control-flow mitigations for Load Value Injection (LVI)">;
4978def m_seses : Flag<["-"], "mseses">, Group<m_Group>, Flags<[NoXarchOption]>,
4979  Visibility<[ClangOption, CLOption]>,
4980  HelpText<"Enable speculative execution side effect suppression (SESES). "
4981    "Includes LVI control flow integrity mitigations">;
4982def mno_seses : Flag<["-"], "mno-seses">, Group<m_Group>,
4983  Visibility<[ClangOption, CLOption]>,
4984  HelpText<"Disable speculative execution side effect suppression (SESES)">;
4985
4986def mrelax : Flag<["-"], "mrelax">, Group<m_Group>,
4987  HelpText<"Enable linker relaxation">;
4988def mno_relax : Flag<["-"], "mno-relax">, Group<m_Group>,
4989  HelpText<"Disable linker relaxation">;
4990def msmall_data_limit_EQ : Joined<["-"], "msmall-data-limit=">, Group<m_Group>,
4991  Alias<G>,
4992  HelpText<"Put global and static data smaller than the limit into a special section">;
4993let Flags = [TargetSpecific] in {
4994def msave_restore : Flag<["-"], "msave-restore">, Group<m_riscv_Features_Group>,
4995  HelpText<"Enable using library calls for save and restore">;
4996def mno_save_restore : Flag<["-"], "mno-save-restore">, Group<m_riscv_Features_Group>,
4997  HelpText<"Disable using library calls for save and restore">;
4998} // let Flags = [TargetSpecific]
4999let Flags = [TargetSpecific] in {
5000def menable_experimental_extensions : Flag<["-"], "menable-experimental-extensions">, Group<m_Group>,
5001  HelpText<"Enable use of experimental RISC-V extensions.">;
5002def mrvv_vector_bits_EQ : Joined<["-"], "mrvv-vector-bits=">, Group<m_Group>,
5003  Visibility<[ClangOption, FlangOption]>,
5004  HelpText<"Specify the size in bits of an RVV vector register">,
5005  DocBrief<!strconcat(
5006    "Defaults to the vector length agnostic value of \"scalable\". "
5007    "Accepts power of 2 values between 64 and 65536. Also accepts "
5008    "\"zvl\" to use the value implied by -march/-mcpu.",
5009    !cond(
5010      // Flang does not set the preprocessor define.
5011      !eq(GlobalDocumentation.Program, "Flang") : "",
5012      true: " The value will be reflected in __riscv_v_fixed_vlen preprocessor define"),
5013    " (RISC-V only)")>;
5014
5015def munaligned_access : Flag<["-"], "munaligned-access">, Group<m_Group>,
5016  HelpText<"Allow memory accesses to be unaligned (AArch32/MIPSr6 only)">;
5017def mno_unaligned_access : Flag<["-"], "mno-unaligned-access">, Group<m_Group>,
5018  HelpText<"Force all memory accesses to be aligned (AArch32/MIPSr6 only)">;
5019def munaligned_symbols : Flag<["-"], "munaligned-symbols">, Group<m_Group>,
5020  HelpText<"Expect external char-aligned symbols to be without ABI alignment (SystemZ only)">;
5021def mno_unaligned_symbols : Flag<["-"], "mno-unaligned-symbols">, Group<m_Group>,
5022  HelpText<"Expect external char-aligned symbols to be without ABI alignment (SystemZ only)">;
5023def mstrict_align : Flag<["-"], "mstrict-align">, Group<m_Group>,
5024  HelpText<"Force all memory accesses to be aligned (AArch64/LoongArch/RISC-V only)">;
5025def mno_strict_align : Flag<["-"], "mno-strict-align">, Group<m_Group>,
5026  HelpText<"Allow memory accesses to be unaligned (AArch64/LoongArch/RISC-V only)">;
5027def mscalar_strict_align : Flag<["-"], "mscalar-strict-align">, Group<m_Group>,
5028  HelpText<"Force all scalar memory accesses to be aligned (RISC-V only)">;
5029def mno_scalar_strict_align : Flag<["-"], "mno-scalar-strict-align">, Group<m_Group>,
5030  HelpText<"Allow scalar memory accesses to be unaligned (RISC-V only)">;
5031def mvector_strict_align : Flag<["-"], "mvector-strict-align">, Group<m_Group>,
5032  HelpText<"Force all vector memory accesses to be aligned (RISC-V only)">;
5033def mno_vector_strict_align : Flag<["-"], "mno-vector-strict-align">, Group<m_Group>,
5034  HelpText<"Allow vector memory accesses to be unaligned (RISC-V only)">;
5035def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_arm_Features_Group>;
5036def mrestrict_it: Flag<["-"], "mrestrict-it">, Group<m_arm_Features_Group>,
5037  HelpText<"Disallow generation of complex IT blocks. It is off by default.">;
5038def mno_restrict_it: Flag<["-"], "mno-restrict-it">, Group<m_arm_Features_Group>,
5039  HelpText<"Allow generation of complex IT blocks.">;
5040def marm : Flag<["-"], "marm">, Alias<mno_thumb>;
5041def ffixed_r9 : Flag<["-"], "ffixed-r9">, Group<m_arm_Features_Group>,
5042  HelpText<"Reserve the r9 register (ARM only)">;
5043def mno_movt : Flag<["-"], "mno-movt">, Group<m_arm_Features_Group>,
5044  HelpText<"Disallow use of movt/movw pairs (ARM only)">;
5045def mcrc : Flag<["-"], "mcrc">, Group<m_Group>,
5046  HelpText<"Allow use of CRC instructions (ARM/Mips only)">;
5047def mnocrc : Flag<["-"], "mnocrc">, Group<m_arm_Features_Group>,
5048  HelpText<"Disallow use of CRC instructions (ARM only)">;
5049def mno_neg_immediates: Flag<["-"], "mno-neg-immediates">, Group<m_arm_Features_Group>,
5050  HelpText<"Disallow converting instructions with negative immediates to their negation or inversion.">;
5051} // let Flags = [TargetSpecific]
5052def mcmse : Flag<["-"], "mcmse">, Group<m_arm_Features_Group>,
5053  Visibility<[ClangOption, CC1Option]>,
5054  HelpText<"Allow use of CMSE (Armv8-M Security Extensions)">,
5055  MarshallingInfoFlag<LangOpts<"Cmse">>;
5056def ForceAAPCSBitfieldLoad : Flag<["-"], "faapcs-bitfield-load">, Group<m_arm_Features_Group>,
5057  Visibility<[ClangOption, CC1Option]>,
5058  HelpText<"Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).">,
5059  MarshallingInfoFlag<CodeGenOpts<"ForceAAPCSBitfieldLoad">>;
5060defm aapcs_bitfield_width : BoolOption<"f", "aapcs-bitfield-width",
5061  CodeGenOpts<"AAPCSBitfieldWidth">, DefaultTrue,
5062  NegFlag<SetFalse, [], [ClangOption], "Do not follow">,
5063  PosFlag<SetTrue, [], [ClangOption], "Follow">,
5064  BothFlags<[], [ClangOption, CC1Option],
5065          " the AAPCS standard requirement stating that"
5066            " volatile bit-field width is dictated by the field container type. (ARM only).">>,
5067  Group<m_arm_Features_Group>;
5068let Flags = [TargetSpecific] in {
5069def mframe_chain : Joined<["-"], "mframe-chain=">,
5070  Group<m_arm_Features_Group>, Values<"none,aapcs,aapcs+leaf">,
5071  HelpText<"Select the frame chain model used to emit frame records (Arm only).">;
5072def mgeneral_regs_only : Flag<["-"], "mgeneral-regs-only">, Group<m_Group>,
5073  HelpText<"Generate code which only uses the general purpose registers (AArch64/x86 only)">;
5074def mfix_cmse_cve_2021_35465 : Flag<["-"], "mfix-cmse-cve-2021-35465">,
5075  Group<m_arm_Features_Group>,
5076  HelpText<"Work around VLLDM erratum CVE-2021-35465 (ARM only)">;
5077def mno_fix_cmse_cve_2021_35465 : Flag<["-"], "mno-fix-cmse-cve-2021-35465">,
5078  Group<m_arm_Features_Group>,
5079  HelpText<"Don't work around VLLDM erratum CVE-2021-35465 (ARM only)">;
5080def mfix_cortex_a57_aes_1742098 : Flag<["-"], "mfix-cortex-a57-aes-1742098">,
5081  Group<m_arm_Features_Group>,
5082  HelpText<"Work around Cortex-A57 Erratum 1742098 (ARM only)">;
5083def mno_fix_cortex_a57_aes_1742098 : Flag<["-"], "mno-fix-cortex-a57-aes-1742098">,
5084  Group<m_arm_Features_Group>,
5085  HelpText<"Don't work around Cortex-A57 Erratum 1742098 (ARM only)">;
5086def mfix_cortex_a72_aes_1655431 : Flag<["-"], "mfix-cortex-a72-aes-1655431">,
5087  Group<m_arm_Features_Group>,
5088  HelpText<"Work around Cortex-A72 Erratum 1655431 (ARM only)">,
5089  Alias<mfix_cortex_a57_aes_1742098>;
5090def mno_fix_cortex_a72_aes_1655431 : Flag<["-"], "mno-fix-cortex-a72-aes-1655431">,
5091  Group<m_arm_Features_Group>,
5092  HelpText<"Don't work around Cortex-A72 Erratum 1655431 (ARM only)">,
5093  Alias<mno_fix_cortex_a57_aes_1742098>;
5094def mfix_cortex_a53_835769 : Flag<["-"], "mfix-cortex-a53-835769">,
5095  Group<m_aarch64_Features_Group>,
5096  HelpText<"Workaround Cortex-A53 erratum 835769 (AArch64 only)">;
5097def mno_fix_cortex_a53_835769 : Flag<["-"], "mno-fix-cortex-a53-835769">,
5098  Group<m_aarch64_Features_Group>,
5099  HelpText<"Don't workaround Cortex-A53 erratum 835769 (AArch64 only)">;
5100def mmark_bti_property : Flag<["-"], "mmark-bti-property">,
5101  Group<m_aarch64_Features_Group>,
5102  HelpText<"Add .note.gnu.property with BTI to assembly files (AArch64 only)">;
5103def mno_bti_at_return_twice : Flag<["-"], "mno-bti-at-return-twice">,
5104  Group<m_arm_Features_Group>,
5105  HelpText<"Do not add a BTI instruction after a setjmp or other"
5106           " return-twice construct (Arm/AArch64 only)">;
5107
5108foreach i = {1-31} in
5109  def ffixed_x#i : Flag<["-"], "ffixed-x"#i>, Group<m_Group>,
5110    HelpText<"Reserve the x"#i#" register (AArch64/RISC-V only)">;
5111
5112def mlr_for_calls_only : Flag<["-"], "mlr-for-calls-only">, Group<m_aarch64_Features_Group>,
5113  HelpText<"Do not allocate the LR register for general purpose usage, only for calls. (AArch64 only)">;
5114
5115foreach i = {8-15,18} in
5116  def fcall_saved_x#i : Flag<["-"], "fcall-saved-x"#i>, Group<m_aarch64_Features_Group>,
5117    HelpText<"Make the x"#i#" register call-saved (AArch64 only)">;
5118
5119def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">, Group<m_aarch64_Features_Group>,
5120  Visibility<[ClangOption, FlangOption]>,
5121  HelpText<"Specify the size in bits of an SVE vector register. Defaults to the"
5122           " vector length agnostic value of \"scalable\". (AArch64 only)">;
5123} // let Flags = [TargetSpecific]
5124
5125def mvscale_min_EQ : Joined<["-"], "mvscale-min=">,
5126  Visibility<[CC1Option, FC1Option]>,
5127  HelpText<"Specify the vscale minimum. Defaults to \"1\". (AArch64/RISC-V only)">,
5128  MarshallingInfoInt<LangOpts<"VScaleMin">>;
5129def mvscale_max_EQ : Joined<["-"], "mvscale-max=">,
5130  Visibility<[CC1Option, FC1Option]>,
5131  HelpText<"Specify the vscale maximum. Defaults to the"
5132           " vector length agnostic value of \"0\". (AArch64/RISC-V only)">,
5133  MarshallingInfoInt<LangOpts<"VScaleMax">>;
5134
5135def msign_return_address_EQ : Joined<["-"], "msign-return-address=">,
5136  Visibility<[ClangOption, CC1Option]>,
5137  Group<m_Group>, Values<"none,all,non-leaf">,
5138  HelpText<"Select return address signing scope">;
5139let Flags = [TargetSpecific] in {
5140def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">,
5141  Group<m_Group>,
5142  HelpText<"Enforce targets of indirect branches and function returns">;
5143
5144def mharden_sls_EQ : Joined<["-"], "mharden-sls=">, Group<m_Group>,
5145  HelpText<"Select straight-line speculation hardening scope (ARM/AArch64/X86"
5146           " only). <arg> must be: all, none, retbr(ARM/AArch64),"
5147           " blr(ARM/AArch64), comdat(ARM/AArch64), nocomdat(ARM/AArch64),"
5148           " return(X86), indirect-jmp(X86)">;
5149
5150def matomics : Flag<["-"], "matomics">, Group<m_wasm_Features_Group>;
5151def mno_atomics : Flag<["-"], "mno-atomics">, Group<m_wasm_Features_Group>;
5152def mbulk_memory : Flag<["-"], "mbulk-memory">, Group<m_wasm_Features_Group>;
5153def mno_bulk_memory : Flag<["-"], "mno-bulk-memory">, Group<m_wasm_Features_Group>;
5154def mbulk_memory_opt : Flag<["-"], "mbulk-memory-opt">, Group<m_wasm_Features_Group>;
5155def mno_bulk_memory_opt : Flag<["-"], "mno-bulk-memory-opt">, Group<m_wasm_Features_Group>;
5156def mcall_indirect_overlong : Flag<["-"], "mcall-indirect-overlong">, Group<m_wasm_Features_Group>;
5157def mno_call_indirect_overlong : Flag<["-"], "mno-call-indirect-overlong">, Group<m_wasm_Features_Group>;
5158def mexception_handing : Flag<["-"], "mexception-handling">, Group<m_wasm_Features_Group>;
5159def mno_exception_handing : Flag<["-"], "mno-exception-handling">, Group<m_wasm_Features_Group>;
5160def mextended_const : Flag<["-"], "mextended-const">, Group<m_wasm_Features_Group>;
5161def mno_extended_const : Flag<["-"], "mno-extended-const">, Group<m_wasm_Features_Group>;
5162def mfp16 : Flag<["-"], "mfp16">, Group<m_wasm_Features_Group>;
5163def mno_fp16 : Flag<["-"], "mno-fp16">, Group<m_wasm_Features_Group>;
5164def mmultimemory : Flag<["-"], "mmultimemory">, Group<m_wasm_Features_Group>;
5165def mno_multimemory : Flag<["-"], "mno-multimemory">, Group<m_wasm_Features_Group>;
5166def mmultivalue : Flag<["-"], "mmultivalue">, Group<m_wasm_Features_Group>;
5167def mno_multivalue : Flag<["-"], "mno-multivalue">, Group<m_wasm_Features_Group>;
5168def mmutable_globals : Flag<["-"], "mmutable-globals">, Group<m_wasm_Features_Group>;
5169def mno_mutable_globals : Flag<["-"], "mno-mutable-globals">, Group<m_wasm_Features_Group>;
5170def mnontrapping_fptoint : Flag<["-"], "mnontrapping-fptoint">, Group<m_wasm_Features_Group>;
5171def mno_nontrapping_fptoint : Flag<["-"], "mno-nontrapping-fptoint">, Group<m_wasm_Features_Group>;
5172def mreference_types : Flag<["-"], "mreference-types">, Group<m_wasm_Features_Group>;
5173def mno_reference_types : Flag<["-"], "mno-reference-types">, Group<m_wasm_Features_Group>;
5174def mrelaxed_simd : Flag<["-"], "mrelaxed-simd">, Group<m_wasm_Features_Group>;
5175def mno_relaxed_simd : Flag<["-"], "mno-relaxed-simd">, Group<m_wasm_Features_Group>;
5176def msign_ext : Flag<["-"], "msign-ext">, Group<m_wasm_Features_Group>;
5177def mno_sign_ext : Flag<["-"], "mno-sign-ext">, Group<m_wasm_Features_Group>;
5178def msimd128 : Flag<["-"], "msimd128">, Group<m_wasm_Features_Group>;
5179def mno_simd128 : Flag<["-"], "mno-simd128">, Group<m_wasm_Features_Group>;
5180def mtail_call : Flag<["-"], "mtail-call">, Group<m_wasm_Features_Group>;
5181def mno_tail_call : Flag<["-"], "mno-tail-call">, Group<m_wasm_Features_Group>;
5182def mwide_arithmetic : Flag<["-"], "mwide-arithmetic">, Group<m_wasm_Features_Group>;
5183def mno_wide_arithmetic : Flag<["-"], "mno-wide-arithmetic">, Group<m_wasm_Features_Group>;
5184def mexec_model_EQ : Joined<["-"], "mexec-model=">, Group<m_wasm_Features_Driver_Group>,
5185                     Values<"command,reactor">,
5186                     HelpText<"Execution model (WebAssembly only)">,
5187  DocBrief<"Select between \"command\" and \"reactor\" executable models. "
5188           "Commands have a main-function which scopes the lifetime of the "
5189           "program. Reactors are activated and remain active until "
5190           "explicitly terminated.">;
5191} // let Flags = [TargetSpecific]
5192
5193defm amdgpu_ieee : BoolMOption<"amdgpu-ieee",
5194  CodeGenOpts<"EmitIEEENaNCompliantInsts">, DefaultTrue,
5195  PosFlag<SetTrue, [], [ClangOption], "Sets the IEEE bit in the expected default floating point "
5196  " mode register. Floating point opcodes that support exception flag "
5197  "gathering quiet and propagate signaling NaN inputs per IEEE 754-2008. "
5198  "This option changes the ABI. (AMDGPU only)">,
5199  NegFlag<SetFalse, [], [ClangOption, CC1Option]>>;
5200
5201def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
5202  HelpText<"Specify code object ABI version. Defaults to 5. (AMDGPU only)">,
5203  Visibility<[ClangOption, FlangOption, CC1Option, FC1Option]>,
5204  Values<"none,4,5,6">,
5205  NormalizedValuesScope<"llvm::CodeObjectVersionKind">,
5206  NormalizedValues<["COV_None", "COV_4", "COV_5", "COV_6"]>,
5207  MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_5">;
5208
5209defm cumode : SimpleMFlag<"cumode",
5210  "Specify CU wavefront", "Specify WGP wavefront",
5211  " execution mode (AMDGPU only)", m_amdgpu_Features_Group>;
5212defm tgsplit : SimpleMFlag<"tgsplit", "Enable", "Disable",
5213  " threadgroup split execution mode (AMDGPU only)", m_amdgpu_Features_Group>;
5214defm wavefrontsize64 : SimpleMFlag<"wavefrontsize64",
5215  "Specify wavefront size 64", "Specify wavefront size 32",
5216  " mode (AMDGPU only)">;
5217defm amdgpu_precise_memory_op
5218    : SimpleMFlag<"amdgpu-precise-memory-op", "Enable", "Disable",
5219                  " precise memory mode (AMDGPU only)">;
5220
5221defm unsafe_fp_atomics : BoolMOption<"unsafe-fp-atomics",
5222  TargetOpts<"AllowAMDGPUUnsafeFPAtomics">, DefaultFalse,
5223  PosFlag<SetTrue, [], [ClangOption, CC1Option],
5224          "Enable generation of unsafe floating point "
5225          "atomic instructions. May generate more efficient code, but may not "
5226          "respect rounding and denormal modes, and may give incorrect results "
5227          "for certain memory destinations. (AMDGPU only)">,
5228  NegFlag<SetFalse>>;
5229
5230def faltivec : Flag<["-"], "faltivec">, Group<f_Group>;
5231def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>;
5232let Flags = [TargetSpecific] in {
5233def maltivec : Flag<["-"], "maltivec">, Group<m_ppc_Features_Group>,
5234  HelpText<"Enable AltiVec vector initializer syntax">;
5235def mno_altivec : Flag<["-"], "mno-altivec">, Group<m_ppc_Features_Group>;
5236def mpcrel: Flag<["-"], "mpcrel">, Group<m_ppc_Features_Group>;
5237def mno_pcrel: Flag<["-"], "mno-pcrel">, Group<m_ppc_Features_Group>;
5238def mprefixed: Flag<["-"], "mprefixed">, Group<m_ppc_Features_Group>;
5239def mno_prefixed: Flag<["-"], "mno-prefixed">, Group<m_ppc_Features_Group>;
5240def mspe : Flag<["-"], "mspe">, Group<m_ppc_Features_Group>;
5241def mno_spe : Flag<["-"], "mno-spe">, Group<m_ppc_Features_Group>;
5242def mefpu2 : Flag<["-"], "mefpu2">, Group<m_ppc_Features_Group>;
5243} // let Flags = [TargetSpecific]
5244def msave_reg_params : Flag<["-"], "msave-reg-params">, Group<m_Group>,
5245  Flags<[TargetSpecific]>,
5246  Visibility<[ClangOption, CC1Option]>,
5247  HelpText<"Save arguments passed by registers to ABI-defined stack positions">,
5248  MarshallingInfoFlag<CodeGenOpts<"SaveRegParams">>;
5249def mabi_EQ_quadword_atomics : Flag<["-"], "mabi=quadword-atomics">,
5250  Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
5251  HelpText<"Enable quadword atomics ABI on AIX (AIX PPC64 only). Uses lqarx/stqcx. instructions.">,
5252  MarshallingInfoFlag<LangOpts<"EnableAIXQuadwordAtomicsABI">>;
5253let Flags = [TargetSpecific] in {
5254def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>;
5255def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>;
5256def msecure_plt : Flag<["-"], "msecure-plt">, Group<m_ppc_Features_Group>;
5257def mpower8_vector : Flag<["-"], "mpower8-vector">,
5258    Group<m_ppc_Features_Group>;
5259def mno_power8_vector : Flag<["-"], "mno-power8-vector">,
5260    Group<m_ppc_Features_Group>;
5261def mpower9_vector : Flag<["-"], "mpower9-vector">,
5262    Group<m_ppc_Features_Group>;
5263def mno_power9_vector : Flag<["-"], "mno-power9-vector">,
5264    Group<m_ppc_Features_Group>;
5265def mpower10_vector : Flag<["-"], "mpower10-vector">,
5266    Group<m_ppc_Features_Group>;
5267def mno_power10_vector : Flag<["-"], "mno-power10-vector">,
5268    Group<m_ppc_Features_Group>;
5269def mpower8_crypto : Flag<["-"], "mcrypto">,
5270    Group<m_ppc_Features_Group>;
5271def mnopower8_crypto : Flag<["-"], "mno-crypto">,
5272    Group<m_ppc_Features_Group>;
5273def mdirect_move : Flag<["-"], "mdirect-move">,
5274    Group<m_ppc_Features_Group>;
5275def mnodirect_move : Flag<["-"], "mno-direct-move">,
5276    Group<m_ppc_Features_Group>;
5277def mpaired_vector_memops: Flag<["-"], "mpaired-vector-memops">,
5278    Group<m_ppc_Features_Group>;
5279def mnopaired_vector_memops: Flag<["-"], "mno-paired-vector-memops">,
5280    Group<m_ppc_Features_Group>;
5281def mhtm : Flag<["-"], "mhtm">, Group<m_ppc_Features_Group>;
5282def mno_htm : Flag<["-"], "mno-htm">, Group<m_ppc_Features_Group>;
5283def mfprnd : Flag<["-"], "mfprnd">, Group<m_ppc_Features_Group>;
5284def mno_fprnd : Flag<["-"], "mno-fprnd">, Group<m_ppc_Features_Group>;
5285def mcmpb : Flag<["-"], "mcmpb">, Group<m_ppc_Features_Group>;
5286def mno_cmpb : Flag<["-"], "mno-cmpb">, Group<m_ppc_Features_Group>;
5287def misel : Flag<["-"], "misel">, Group<m_ppc_Features_Group>;
5288def mno_isel : Flag<["-"], "mno-isel">, Group<m_ppc_Features_Group>;
5289def mmfocrf : Flag<["-"], "mmfocrf">, Group<m_ppc_Features_Group>;
5290def mmfcrf : Flag<["-"], "mmfcrf">, Alias<mmfocrf>;
5291def mno_mfocrf : Flag<["-"], "mno-mfocrf">, Group<m_ppc_Features_Group>;
5292def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Alias<mno_mfocrf>;
5293def mpopcntd : Flag<["-"], "mpopcntd">, Group<m_ppc_Features_Group>;
5294def mno_popcntd : Flag<["-"], "mno-popcntd">, Group<m_ppc_Features_Group>;
5295def mcrbits : Flag<["-"], "mcrbits">, Group<m_ppc_Features_Group>,
5296    HelpText<"Control the CR-bit tracking feature on PowerPC. ``-mcrbits`` "
5297             "(the enablement of CR-bit tracking support) is the default for "
5298             "POWER8 and above, as well as for all other CPUs when "
5299             "optimization is applied (-O2 and above).">;
5300def mno_crbits : Flag<["-"], "mno-crbits">, Group<m_ppc_Features_Group>;
5301def minvariant_function_descriptors :
5302  Flag<["-"], "minvariant-function-descriptors">, Group<m_ppc_Features_Group>;
5303def mno_invariant_function_descriptors :
5304  Flag<["-"], "mno-invariant-function-descriptors">,
5305  Group<m_ppc_Features_Group>;
5306def mfloat128: Flag<["-"], "mfloat128">,
5307    Group<m_ppc_Features_Group>;
5308def mno_float128 : Flag<["-"], "mno-float128">,
5309    Group<m_ppc_Features_Group>;
5310def mlongcall: Flag<["-"], "mlongcall">,
5311    Group<m_ppc_Features_Group>;
5312def mno_longcall : Flag<["-"], "mno-longcall">,
5313    Group<m_ppc_Features_Group>;
5314def mmma: Flag<["-"], "mmma">, Group<m_ppc_Features_Group>;
5315def mno_mma: Flag<["-"], "mno-mma">, Group<m_ppc_Features_Group>;
5316def mrop_protect : Flag<["-"], "mrop-protect">,
5317    Group<m_ppc_Features_Group>;
5318def mprivileged : Flag<["-"], "mprivileged">,
5319    Group<m_ppc_Features_Group>;
5320
5321defm regnames : BoolMOption<"regnames",
5322  CodeGenOpts<"PPCUseFullRegisterNames">, DefaultFalse,
5323  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use full register names when writing assembly output">,
5324  NegFlag<SetFalse, [], [ClangOption], "Use only register numbers when writing assembly output">>;
5325} // let Flags = [TargetSpecific]
5326def maix_small_local_exec_tls : Flag<["-"], "maix-small-local-exec-tls">,
5327  Group<m_ppc_Features_Group>,
5328  HelpText<"Produce a faster access sequence for local-exec TLS variables "
5329           "where the offset from the TLS base is encoded as an "
5330           "immediate operand (AIX 64-bit only). "
5331           "This access sequence is not used for variables larger than 32KB.">;
5332def maix_small_local_dynamic_tls : Flag<["-"], "maix-small-local-dynamic-tls">,
5333  Group<m_ppc_Features_Group>,
5334  HelpText<"Produce a faster access sequence for local-dynamic TLS variables "
5335           "where the offset from the TLS base is encoded as an "
5336           "immediate operand (AIX 64-bit only). "
5337           "This access sequence is not used for variables larger than 32KB.">;
5338def maix_shared_lib_tls_model_opt : Flag<["-"], "maix-shared-lib-tls-model-opt">,
5339  Group<m_ppc_Features_Group>,
5340  HelpText<"For shared library loaded with the main program, change local-dynamic access(es) "
5341           "to initial-exec access(es) at the function level (AIX 64-bit only).">;
5342def maix_struct_return : Flag<["-"], "maix-struct-return">,
5343  Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
5344  HelpText<"Return all structs in memory (PPC32 only)">,
5345  DocBrief<"Override the default ABI for 32-bit targets to return all "
5346           "structs in memory, as in the Power 32-bit ABI for Linux (2011), "
5347           "and on AIX and Darwin.">;
5348def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">,
5349  Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
5350  HelpText<"Return small structs in registers (PPC32 only)">,
5351  DocBrief<"Override the default ABI for 32-bit targets to return small "
5352           "structs in registers, as in the System V ABI (1995).">;
5353def mxcoff_roptr : Flag<["-"], "mxcoff-roptr">, Group<m_Group>,
5354  Flags<[TargetSpecific]>, Visibility<[ClangOption, CC1Option]>,
5355  HelpText<"Place constant objects with relocatable address values in the RO data section and add -bforceimprw to the linker flags (AIX only)">;
5356def mno_xcoff_roptr : Flag<["-"], "mno-xcoff-roptr">, Group<m_Group>, TargetSpecific;
5357
5358let Flags = [TargetSpecific] in {
5359def mvx : Flag<["-"], "mvx">, Group<m_Group>;
5360def mno_vx : Flag<["-"], "mno-vx">, Group<m_Group>;
5361} // let Flags = [TargetSpecific]
5362
5363let Flags = [TargetSpecific] in {
5364def msse2avx : Flag<["-"], "msse2avx">, Group<m_Group>,
5365  Visibility<[ClangOption, CC1Option, CC1AsOption]>,
5366  HelpText<"Specify that the assembler should encode SSE instructions with VEX prefix">,
5367  MarshallingInfoFlag<CodeGenOpts<"X86Sse2Avx">>;
5368} // let Flags = [TargetSpecific]
5369
5370defm zvector : BoolFOption<"zvector",
5371  LangOpts<"ZVector">, DefaultFalse,
5372  PosFlag<SetTrue, [], [ClangOption, CC1Option],
5373          "Enable System z vector language extension">,
5374  NegFlag<SetFalse>>;
5375def mzvector : Flag<["-"], "mzvector">, Alias<fzvector>;
5376def mno_zvector : Flag<["-"], "mno-zvector">, Alias<fno_zvector>;
5377
5378def mxcoff_build_id_EQ : Joined<["-"], "mxcoff-build-id=">, Group<Link_Group>, MetaVarName<"<0xHEXSTRING>">,
5379  HelpText<"On AIX, request creation of a build-id string, \"0xHEXSTRING\", in the string table of the loader section inside the linked binary">;
5380def mignore_xcoff_visibility : Flag<["-"], "mignore-xcoff-visibility">, Group<m_Group>,
5381HelpText<"Not emit the visibility attribute for asm in AIX OS or give all symbols 'unspecified' visibility in XCOFF object file">,
5382  Flags<[TargetSpecific]>, Visibility<[ClangOption, CC1Option]>;
5383defm backchain : BoolMOption<"backchain",
5384  CodeGenOpts<"Backchain">, DefaultFalse,
5385  PosFlag<SetTrue, [], [ClangOption], "Link stack frames through backchain on System Z">,
5386  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
5387
5388def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings">, Group<m_Group>;
5389def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Group<m_Group>;
5390def momit_leaf_frame_pointer : Flag<["-"], "momit-leaf-frame-pointer">, Group<m_Group>,
5391  HelpText<"Omit frame pointer setup for leaf functions">;
5392def moslib_EQ : Joined<["-"], "moslib=">, Group<m_Group>;
5393def mpascal_strings : Flag<["-"], "mpascal-strings">, Alias<fpascal_strings>;
5394def mred_zone : Flag<["-"], "mred-zone">, Group<m_Group>;
5395def mtls_direct_seg_refs : Flag<["-"], "mtls-direct-seg-refs">, Group<m_Group>,
5396  HelpText<"Enable direct TLS access through segment registers (default)">;
5397def mregparm_EQ : Joined<["-"], "mregparm=">, Group<m_Group>;
5398def mrelax_all : Flag<["-"], "mrelax-all">, Group<m_Group>,
5399  Visibility<[ClangOption, CC1Option, CC1AsOption]>,
5400  HelpText<"(integrated-as) Relax all machine instructions">,
5401  MarshallingInfoFlag<CodeGenOpts<"RelaxAll">>;
5402def mincremental_linker_compatible : Flag<["-"], "mincremental-linker-compatible">, Group<m_Group>,
5403  Visibility<[ClangOption, CC1Option, CC1AsOption]>,
5404  HelpText<"(integrated-as) Emit an object file which can be used with an incremental linker">,
5405  MarshallingInfoFlag<CodeGenOpts<"IncrementalLinkerCompatible">>;
5406def mno_incremental_linker_compatible : Flag<["-"], "mno-incremental-linker-compatible">, Group<m_Group>,
5407  HelpText<"(integrated-as) Emit an object file which cannot be used with an incremental linker">;
5408def mrtd : Flag<["-"], "mrtd">, Group<m_Group>,
5409  Visibility<[ClangOption, CC1Option]>,
5410  HelpText<"Make StdCall calling convention the default">;
5411def msmall_data_threshold_EQ : Joined <["-"], "msmall-data-threshold=">,
5412  Group<m_Group>, Alias<G>;
5413def msoft_float : Flag<["-"], "msoft-float">, Group<m_Group>,
5414  Visibility<[ClangOption, CC1Option]>,
5415  HelpText<"Use software floating point">,
5416  MarshallingInfoFlag<CodeGenOpts<"SoftFloat">>;
5417def mno_fmv : Flag<["-"], "mno-fmv">, Group<f_clang_Group>,
5418  Visibility<[ClangOption, CC1Option]>,
5419  HelpText<"Disable function multiversioning">;
5420def moutline_atomics : Flag<["-"], "moutline-atomics">, Group<f_clang_Group>,
5421  Visibility<[ClangOption, CC1Option, FlangOption]>,
5422  HelpText<"Generate local calls to out-of-line atomic operations">;
5423def mno_outline_atomics : Flag<["-"], "mno-outline-atomics">, Group<f_clang_Group>,
5424  Visibility<[ClangOption, CC1Option, FlangOption]>,
5425  HelpText<"Don't generate local calls to out-of-line atomic operations">;
5426def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group<m_Group>,
5427  HelpText<"Don't generate implicit floating point or vector instructions">;
5428def mimplicit_float : Flag<["-"], "mimplicit-float">, Group<m_Group>;
5429def mrecip : Flag<["-"], "mrecip">, Group<m_Group>,
5430  HelpText<"Equivalent to '-mrecip=all'">;
5431def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group<m_Group>,
5432  Visibility<[ClangOption, CC1Option]>,
5433  HelpText<"Control use of approximate reciprocal and reciprocal square root instructions followed by <n> iterations of "
5434           "Newton-Raphson refinement. "
5435           "<value> = ( ['!'] ['vec-'] ('rcp'|'sqrt') [('h'|'s'|'d')] [':'<n>] ) | 'all' | 'default' | 'none'">,
5436  MarshallingInfoStringVector<CodeGenOpts<"Reciprocals">>;
5437def mprefer_vector_width_EQ : Joined<["-"], "mprefer-vector-width=">, Group<m_Group>,
5438  Visibility<[ClangOption, CC1Option]>,
5439  HelpText<"Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.">,
5440  MarshallingInfoString<CodeGenOpts<"PreferVectorWidth">>;
5441def mstack_protector_guard_EQ : Joined<["-"], "mstack-protector-guard=">, Group<m_Group>,
5442  Visibility<[ClangOption, CC1Option]>,
5443  HelpText<"Use the given guard (global, tls) for addressing the stack-protector guard">,
5444  MarshallingInfoString<CodeGenOpts<"StackProtectorGuard">>;
5445def mstack_protector_guard_offset_EQ : Joined<["-"], "mstack-protector-guard-offset=">, Group<m_Group>,
5446  Visibility<[ClangOption, CC1Option]>,
5447  HelpText<"Use the given offset for addressing the stack-protector guard">,
5448  MarshallingInfoInt<CodeGenOpts<"StackProtectorGuardOffset">, "INT_MAX", "int">;
5449def mstack_protector_guard_symbol_EQ : Joined<["-"], "mstack-protector-guard-symbol=">, Group<m_Group>,
5450  Visibility<[ClangOption, CC1Option]>,
5451  HelpText<"Use the given symbol for addressing the stack-protector guard">,
5452  MarshallingInfoString<CodeGenOpts<"StackProtectorGuardSymbol">>;
5453def mstack_protector_guard_reg_EQ : Joined<["-"], "mstack-protector-guard-reg=">, Group<m_Group>,
5454  Visibility<[ClangOption, CC1Option]>,
5455  HelpText<"Use the given reg for addressing the stack-protector guard">,
5456  MarshallingInfoString<CodeGenOpts<"StackProtectorGuardReg">>;
5457def mfentry : Flag<["-"], "mfentry">, HelpText<"Insert calls to fentry at function entry (x86/SystemZ only)">,
5458  Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
5459  MarshallingInfoFlag<CodeGenOpts<"CallFEntry">>;
5460def mlsx : Flag<["-"], "mlsx">, Group<m_loongarch_Features_Group>,
5461  HelpText<"Enable Loongson SIMD Extension (LSX).">;
5462def mno_lsx : Flag<["-"], "mno-lsx">, Group<m_loongarch_Features_Group>,
5463  HelpText<"Disable Loongson SIMD Extension (LSX).">;
5464def mlasx : Flag<["-"], "mlasx">, Group<m_loongarch_Features_Group>,
5465  HelpText<"Enable Loongson Advanced SIMD Extension (LASX).">;
5466def mno_lasx : Flag<["-"], "mno-lasx">, Group<m_loongarch_Features_Group>,
5467  HelpText<"Disable Loongson Advanced SIMD Extension (LASX).">;
5468let Flags = [TargetSpecific] in {
5469def msimd_EQ : Joined<["-"], "msimd=">, Group<m_loongarch_Features_Group>,
5470  HelpText<"Select the SIMD extension(s) to be enabled in LoongArch either 'none', 'lsx', 'lasx'.">;
5471def mfrecipe : Flag<["-"], "mfrecipe">, Group<m_loongarch_Features_Group>,
5472  HelpText<"Enable frecipe.{s/d} and frsqrte.{s/d}">;
5473def mno_frecipe : Flag<["-"], "mno-frecipe">, Group<m_loongarch_Features_Group>,
5474  HelpText<"Disable frecipe.{s/d} and frsqrte.{s/d}">;
5475def mlam_bh : Flag<["-"], "mlam-bh">, Group<m_loongarch_Features_Group>,
5476  HelpText<"Enable amswap[_db].{b/h} and amadd[_db].{b/h}">;
5477def mno_lam_bh : Flag<["-"], "mno-lam-bh">, Group<m_loongarch_Features_Group>,
5478  HelpText<"Disable amswap[_db].{b/h} and amadd[_db].{b/h}">;
5479def mlamcas : Flag<["-"], "mlamcas">, Group<m_loongarch_Features_Group>,
5480  HelpText<"Enable amcas[_db].{b/h/w/d}">;
5481def mno_lamcas : Flag<["-"], "mno-lamcas">, Group<m_loongarch_Features_Group>,
5482  HelpText<"Disable amcas[_db].{b/h/w/d}">;
5483def mld_seq_sa : Flag<["-"], "mld-seq-sa">, Group<m_loongarch_Features_Group>,
5484  HelpText<"Do not generate load-load barrier instructions (dbar 0x700)">;
5485def mno_ld_seq_sa : Flag<["-"], "mno-ld-seq-sa">, Group<m_loongarch_Features_Group>,
5486  HelpText<"Generate load-load barrier instructions (dbar 0x700)">;
5487def mdiv32 : Flag<["-"], "mdiv32">, Group<m_loongarch_Features_Group>,
5488  HelpText<"Use div.w[u] and mod.w[u] instructions with input not sign-extended.">;
5489def mno_div32 : Flag<["-"], "mno-div32">, Group<m_loongarch_Features_Group>,
5490  HelpText<"Do not use div.w[u] and mod.w[u] instructions with input not sign-extended.">;
5491def mscq : Flag<["-"], "mscq">, Group<m_loongarch_Features_Group>,
5492  HelpText<"Enable sc.q instruction.">;
5493def mno_scq : Flag<["-"], "mno-scq">, Group<m_loongarch_Features_Group>,
5494  HelpText<"Disable sc.q instruction.">;
5495def mannotate_tablejump : Flag<["-"], "mannotate-tablejump">, Group<m_loongarch_Features_Group>,
5496  HelpText<"Enable annotate table jump instruction to correlate it with the jump table.">;
5497def mno_annotate_tablejump : Flag<["-"], "mno-annotate-tablejump">, Group<m_loongarch_Features_Group>,
5498  HelpText<"Disable annotate table jump instruction to correlate it with the jump table.">;
5499} // let Flags = [TargetSpecific]
5500def mnop_mcount : Flag<["-"], "mnop-mcount">, HelpText<"Generate mcount/__fentry__ calls as nops. To activate they need to be patched in.">,
5501  Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
5502  MarshallingInfoFlag<CodeGenOpts<"MNopMCount">>;
5503def mrecord_mcount : Flag<["-"], "mrecord-mcount">, HelpText<"Generate a __mcount_loc section entry for each __fentry__ call.">,
5504  Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
5505  MarshallingInfoFlag<CodeGenOpts<"RecordMCount">>;
5506def mpacked_stack : Flag<["-"], "mpacked-stack">, HelpText<"Use packed stack layout (SystemZ only).">,
5507  Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
5508  MarshallingInfoFlag<CodeGenOpts<"PackedStack">>;
5509def mno_packed_stack : Flag<["-"], "mno-packed-stack">,
5510  Visibility<[ClangOption, CC1Option]>, Group<m_Group>;
5511
5512let Flags = [TargetSpecific] in {
5513def mips16 : Flag<["-"], "mips16">, Group<m_mips_Features_Group>;
5514def mno_mips16 : Flag<["-"], "mno-mips16">, Group<m_mips_Features_Group>;
5515def mmicromips : Flag<["-"], "mmicromips">, Group<m_mips_Features_Group>;
5516def mno_micromips : Flag<["-"], "mno-micromips">, Group<m_mips_Features_Group>;
5517def mxgot : Flag<["-"], "mxgot">, Group<m_mips_Features_Group>;
5518def mno_xgot : Flag<["-"], "mno-xgot">, Group<m_mips_Features_Group>;
5519def mldc1_sdc1 : Flag<["-"], "mldc1-sdc1">, Group<m_mips_Features_Group>;
5520def mno_ldc1_sdc1 : Flag<["-"], "mno-ldc1-sdc1">, Group<m_mips_Features_Group>;
5521def mcheck_zero_division : Flag<["-"], "mcheck-zero-division">,
5522                           Group<m_mips_Features_Group>;
5523def mno_check_zero_division : Flag<["-"], "mno-check-zero-division">,
5524                              Group<m_mips_Features_Group>;
5525def mfix4300 : Flag<["-"], "mfix4300">, Group<m_mips_Features_Group>;
5526def mcompact_branches_EQ : Joined<["-"], "mcompact-branches=">,
5527                           Group<m_mips_Features_Group>;
5528} // let Flags = [TargetSpecific]
5529def mbranch_likely : Flag<["-"], "mbranch-likely">, Group<m_Group>,
5530  IgnoredGCCCompat;
5531def mno_branch_likely : Flag<["-"], "mno-branch-likely">, Group<m_Group>,
5532  IgnoredGCCCompat;
5533let Flags = [TargetSpecific] in {
5534def mindirect_jump_EQ : Joined<["-"], "mindirect-jump=">,
5535  Group<m_mips_Features_Group>,
5536  HelpText<"Change indirect jump instructions to inhibit speculation">;
5537def mdsp : Flag<["-"], "mdsp">, Group<m_mips_Features_Group>;
5538def mno_dsp : Flag<["-"], "mno-dsp">, Group<m_mips_Features_Group>;
5539def mdspr2 : Flag<["-"], "mdspr2">, Group<m_mips_Features_Group>;
5540def mno_dspr2 : Flag<["-"], "mno-dspr2">, Group<m_mips_Features_Group>;
5541def msingle_float : Flag<["-"], "msingle-float">, Group<m_Group>;
5542def mdouble_float : Flag<["-"], "mdouble-float">, Group<m_Group>;
5543def mmadd4 : Flag<["-"], "mmadd4">, Group<m_mips_Features_Group>,
5544  HelpText<"Enable the generation of 4-operand madd.s, madd.d and related instructions.">;
5545def mno_madd4 : Flag<["-"], "mno-madd4">, Group<m_mips_Features_Group>,
5546  HelpText<"Disable the generation of 4-operand madd.s, madd.d and related instructions.">;
5547def mmsa : Flag<["-"], "mmsa">, Group<m_mips_Features_Group>,
5548  Visibility<[ClangOption, CC1Option, CC1AsOption]>,
5549  HelpText<"Enable MSA ASE (MIPS only)">,
5550  MarshallingInfoFlag<CodeGenOpts<"MipsMsa">>;
5551def mno_msa : Flag<["-"], "mno-msa">, Group<m_mips_Features_Group>,
5552  HelpText<"Disable MSA ASE (MIPS only)">;
5553def mmt : Flag<["-"], "mmt">, Group<m_mips_Features_Group>,
5554  HelpText<"Enable MT ASE (MIPS only)">;
5555def mno_mt : Flag<["-"], "mno-mt">, Group<m_mips_Features_Group>,
5556  HelpText<"Disable MT ASE (MIPS only)">;
5557def mfp64 : Flag<["-"], "mfp64">, Group<m_mips_Features_Group>,
5558  HelpText<"Use 64-bit floating point registers (MIPS only)">;
5559def mfp32 : Flag<["-"], "mfp32">, Group<m_mips_Features_Group>,
5560  HelpText<"Use 32-bit floating point registers (MIPS only)">;
5561def mgpopt : Flag<["-"], "mgpopt">, Group<m_mips_Features_Group>,
5562  HelpText<"Use GP relative accesses for symbols known to be in a small"
5563           " data section (MIPS)">;
5564def mno_gpopt : Flag<["-"], "mno-gpopt">, Group<m_mips_Features_Group>,
5565  HelpText<"Do not use GP relative accesses for symbols known to be in a small"
5566           " data section (MIPS)">;
5567def mlocal_sdata : Flag<["-"], "mlocal-sdata">,
5568  Group<m_mips_Features_Group>,
5569  HelpText<"Extend the -G behaviour to object local data (MIPS)">;
5570def mno_local_sdata : Flag<["-"], "mno-local-sdata">,
5571  Group<m_mips_Features_Group>,
5572  HelpText<"Do not extend the -G behaviour to object local data (MIPS)">;
5573def mextern_sdata : Flag<["-"], "mextern-sdata">,
5574  Group<m_mips_Features_Group>,
5575  HelpText<"Assume that externally defined data is in the small data if it"
5576           " meets the -G <size> threshold (MIPS)">;
5577def mno_extern_sdata : Flag<["-"], "mno-extern-sdata">,
5578  Group<m_mips_Features_Group>,
5579  HelpText<"Do not assume that externally defined data is in the small data if"
5580           " it meets the -G <size> threshold (MIPS)">;
5581def membedded_data : Flag<["-"], "membedded-data">,
5582  Group<m_mips_Features_Group>,
5583  HelpText<"Place constants in the .rodata section instead of the .sdata "
5584           "section even if they meet the -G <size> threshold (MIPS)">;
5585def mno_embedded_data : Flag<["-"], "mno-embedded-data">,
5586  Group<m_mips_Features_Group>,
5587  HelpText<"Do not place constants in the .rodata section instead of the "
5588           ".sdata if they meet the -G <size> threshold (MIPS)">;
5589def mnan_EQ : Joined<["-"], "mnan=">, Group<m_mips_Features_Group>;
5590def mabs_EQ : Joined<["-"], "mabs=">, Group<m_mips_Features_Group>;
5591def mabicalls : Flag<["-"], "mabicalls">, Group<m_mips_Features_Group>,
5592  HelpText<"Enable SVR4-style position-independent code (Mips only)">;
5593def mno_abicalls : Flag<["-"], "mno-abicalls">, Group<m_mips_Features_Group>,
5594  HelpText<"Disable SVR4-style position-independent code (Mips only)">;
5595def mno_crc : Flag<["-"], "mno-crc">, Group<m_mips_Features_Group>,
5596  HelpText<"Disallow use of CRC instructions (Mips only)">;
5597def mvirt : Flag<["-"], "mvirt">, Group<m_mips_Features_Group>;
5598def mno_virt : Flag<["-"], "mno-virt">, Group<m_mips_Features_Group>;
5599def mginv : Flag<["-"], "mginv">, Group<m_mips_Features_Group>;
5600def mno_ginv : Flag<["-"], "mno-ginv">, Group<m_mips_Features_Group>;
5601} // let Flags = [TargetSpecific]
5602def mips1 : Flag<["-"], "mips1">,
5603  Alias<march_EQ>, AliasArgs<["mips1"]>, Group<m_mips_Features_Group>,
5604  HelpText<"Equivalent to -march=mips1">, Flags<[HelpHidden]>;
5605def mips2 : Flag<["-"], "mips2">,
5606  Alias<march_EQ>, AliasArgs<["mips2"]>, Group<m_mips_Features_Group>,
5607  HelpText<"Equivalent to -march=mips2">, Flags<[HelpHidden]>;
5608def mips3 : Flag<["-"], "mips3">,
5609  Alias<march_EQ>, AliasArgs<["mips3"]>, Group<m_mips_Features_Group>,
5610  HelpText<"Equivalent to -march=mips3">, Flags<[HelpHidden]>;
5611def mips4 : Flag<["-"], "mips4">,
5612  Alias<march_EQ>, AliasArgs<["mips4"]>, Group<m_mips_Features_Group>,
5613  HelpText<"Equivalent to -march=mips4">, Flags<[HelpHidden]>;
5614def mips5 : Flag<["-"], "mips5">,
5615  Alias<march_EQ>, AliasArgs<["mips5"]>, Group<m_mips_Features_Group>,
5616  HelpText<"Equivalent to -march=mips5">, Flags<[HelpHidden]>;
5617def mips32 : Flag<["-"], "mips32">,
5618  Alias<march_EQ>, AliasArgs<["mips32"]>, Group<m_mips_Features_Group>,
5619  HelpText<"Equivalent to -march=mips32">, Flags<[HelpHidden]>;
5620def mips32r2 : Flag<["-"], "mips32r2">,
5621  Alias<march_EQ>, AliasArgs<["mips32r2"]>, Group<m_mips_Features_Group>,
5622  HelpText<"Equivalent to -march=mips32r2">, Flags<[HelpHidden]>;
5623def mips32r3 : Flag<["-"], "mips32r3">,
5624  Alias<march_EQ>, AliasArgs<["mips32r3"]>, Group<m_mips_Features_Group>,
5625  HelpText<"Equivalent to -march=mips32r3">, Flags<[HelpHidden]>;
5626def mips32r5 : Flag<["-"], "mips32r5">,
5627  Alias<march_EQ>, AliasArgs<["mips32r5"]>, Group<m_mips_Features_Group>,
5628  HelpText<"Equivalent to -march=mips32r5">, Flags<[HelpHidden]>;
5629def mips32r6 : Flag<["-"], "mips32r6">,
5630  Alias<march_EQ>, AliasArgs<["mips32r6"]>, Group<m_mips_Features_Group>,
5631  HelpText<"Equivalent to -march=mips32r6">, Flags<[HelpHidden]>;
5632def mips64 : Flag<["-"], "mips64">,
5633  Alias<march_EQ>, AliasArgs<["mips64"]>, Group<m_mips_Features_Group>,
5634  HelpText<"Equivalent to -march=mips64">, Flags<[HelpHidden]>;
5635def mips64r2 : Flag<["-"], "mips64r2">,
5636  Alias<march_EQ>, AliasArgs<["mips64r2"]>, Group<m_mips_Features_Group>,
5637  HelpText<"Equivalent to -march=mips64r2">, Flags<[HelpHidden]>;
5638def mips64r3 : Flag<["-"], "mips64r3">,
5639  Alias<march_EQ>, AliasArgs<["mips64r3"]>, Group<m_mips_Features_Group>,
5640  HelpText<"Equivalent to -march=mips64r3">, Flags<[HelpHidden]>;
5641def mips64r5 : Flag<["-"], "mips64r5">,
5642  Alias<march_EQ>, AliasArgs<["mips64r5"]>, Group<m_mips_Features_Group>,
5643  HelpText<"Equivalent to -march=mips64r5">, Flags<[HelpHidden]>;
5644def mips64r6 : Flag<["-"], "mips64r6">,
5645  Alias<march_EQ>, AliasArgs<["mips64r6"]>, Group<m_mips_Features_Group>,
5646  HelpText<"Equivalent to -march=mips64r6">, Flags<[HelpHidden]>;
5647def mfpxx : Flag<["-"], "mfpxx">, Group<m_mips_Features_Group>,
5648  HelpText<"Avoid FPU mode dependent operations when used with the O32 ABI">,
5649  Flags<[HelpHidden]>;
5650def modd_spreg : Flag<["-"], "modd-spreg">, Group<m_mips_Features_Group>,
5651  HelpText<"Enable odd single-precision floating point registers">,
5652  Flags<[HelpHidden]>;
5653def mno_odd_spreg : Flag<["-"], "mno-odd-spreg">, Group<m_mips_Features_Group>,
5654  HelpText<"Disable odd single-precision floating point registers">,
5655  Flags<[HelpHidden]>;
5656def mrelax_pic_calls : Flag<["-"], "mrelax-pic-calls">,
5657  Group<m_mips_Features_Group>,
5658  HelpText<"Produce relaxation hints for linkers to try optimizing PIC "
5659           "call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
5660def mno_relax_pic_calls : Flag<["-"], "mno-relax-pic-calls">,
5661  Group<m_mips_Features_Group>,
5662  HelpText<"Do not produce relaxation hints for linkers to try optimizing PIC "
5663           "call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
5664def mglibc : Flag<["-"], "mglibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
5665def muclibc : Flag<["-"], "muclibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
5666def module_file_info : Flag<["-"], "module-file-info">, Flags<[]>,
5667  Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
5668  HelpText<"Provide information about a particular module file">;
5669def mthumb : Flag<["-"], "mthumb">, Group<m_Group>;
5670def mtune_EQ : Joined<["-"], "mtune=">, Group<m_Group>,
5671  Visibility<[ClangOption, FlangOption]>,
5672  HelpText<"Only supported on AArch64, PowerPC, RISC-V, SPARC, SystemZ, and X86">;
5673def multi_lib_config : Joined<["-", "--"], "multi-lib-config=">,
5674  HelpText<"Path to the YAML configuration file to be used for multilib selection">,
5675  MetaVarName<"<file>">;
5676def multi__module : Flag<["-"], "multi_module">;
5677def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
5678def multiply__defined : Separate<["-"], "multiply_defined">;
5679def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Group<m_Group>;
5680def canonical_prefixes : Flag<["-"], "canonical-prefixes">,
5681  Flags<[HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption]>,
5682  HelpText<"Use absolute paths for invoking subcommands (default)">;
5683def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">,
5684  Flags<[HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption]>,
5685  HelpText<"Use relative paths for invoking subcommands">;
5686def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>;
5687def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">;
5688def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
5689def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">;
5690def nobuiltininc : Flag<["-"], "nobuiltininc">,
5691  Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
5692  Group<IncludePath_Group>,
5693  HelpText<"Disable builtin #include directories only">,
5694  MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseBuiltinIncludes">>;
5695def nogpuinc : Flag<["-"], "nogpuinc">, Group<IncludePath_Group>,
5696  HelpText<"Do not add include paths for CUDA/HIP and"
5697  " do not include the default CUDA/HIP wrapper headers">;
5698def nohipwrapperinc : Flag<["-"], "nohipwrapperinc">, Group<IncludePath_Group>,
5699  HelpText<"Do not include the default HIP wrapper headers and include paths">;
5700def : Flag<["-"], "nocudainc">, Alias<nogpuinc>;
5701def nogpulib : Flag<["-"], "nogpulib">, MarshallingInfoFlag<LangOpts<"NoGPULib">>,
5702  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
5703  HelpText<"Do not link device library for CUDA/HIP device compilation">;
5704def : Flag<["-"], "nocudalib">, Alias<nogpulib>;
5705def gpulibc : Flag<["-"], "gpulibc">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
5706  HelpText<"Link the LLVM C Library for GPUs">;
5707def nogpulibc : Flag<["-"], "nogpulibc">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
5708def nodefaultlibs : Flag<["-"], "nodefaultlibs">,
5709  Visibility<[ClangOption, FlangOption]>;
5710def nodriverkitlib : Flag<["-"], "nodriverkitlib">;
5711def nofixprebinding : Flag<["-"], "nofixprebinding">;
5712def nolibc : Flag<["-"], "nolibc">;
5713def nomultidefs : Flag<["-"], "nomultidefs">;
5714def nopie : Flag<["-"], "nopie">, Visibility<[ClangOption, FlangOption]>, Flags<[TargetSpecific]>; // OpenBSD
5715def no_pie : Flag<["-"], "no-pie">, Visibility<[ClangOption, FlangOption]>;
5716def noprebind : Flag<["-"], "noprebind">;
5717def noprofilelib : Flag<["-"], "noprofilelib">;
5718def noseglinkedit : Flag<["-"], "noseglinkedit">;
5719def nostartfiles : Flag<["-"], "nostartfiles">, Group<Link_Group>;
5720def startfiles : Flag<["-"], "startfiles">, Group<Link_Group>;
5721def nostdinc : Flag<["-"], "nostdinc">,
5722  Visibility<[ClangOption, CLOption, DXCOption]>, Group<IncludePath_Group>,
5723  HelpText<"Disable both standard system #include directories and builtin #include directories">;
5724def nostdlibinc : Flag<["-"], "nostdlibinc">, Group<IncludePath_Group>,
5725  HelpText<"Disable standard system #include directories only">;
5726def nostdincxx : Flag<["-"], "nostdinc++">, Visibility<[ClangOption, CC1Option]>,
5727  Group<IncludePath_Group>,
5728  HelpText<"Disable standard #include directories for the C++ standard library">,
5729  MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardCXXIncludes">>;
5730def nostdlib : Flag<["-"], "nostdlib">,
5731  Visibility<[ClangOption, FlangOption]>,
5732  Group<Link_Group>;
5733def stdlib : Flag<["-"], "stdlib">,
5734  Visibility<[ClangOption, FlangOption]>,
5735  Group<Link_Group>;
5736def nostdlibxx : Flag<["-"], "nostdlib++">;
5737def object : Flag<["-"], "object">;
5738def o : JoinedOrSeparate<["-"], "o">,
5739  Flags<[NoXarchOption]>,
5740  Visibility<[ClangOption, CC1Option, CC1AsOption, FC1Option, FlangOption]>,
5741  HelpText<"Write output to <file>">, MetaVarName<"<file>">,
5742  MarshallingInfoString<FrontendOpts<"OutputFile">>;
5743def object_file_name_EQ : Joined<["-"], "object-file-name=">,
5744  Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
5745  HelpText<"Set the output <file> for debug infos">, MetaVarName<"<file>">,
5746  MarshallingInfoString<CodeGenOpts<"ObjectFilenameForDebug">>;
5747def object_file_name : Separate<["-"], "object-file-name">,
5748  Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
5749    Alias<object_file_name_EQ>;
5750def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">;
5751def pass_exit_codes : Flag<["-", "--"], "pass-exit-codes">, Flags<[Unsupported]>;
5752def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group<pedantic_Group>,
5753  Visibility<[ClangOption, CC1Option]>,
5754  MarshallingInfoFlag<DiagnosticOpts<"PedanticErrors">>;
5755def pedantic : Flag<["-", "--"], "pedantic">, Group<pedantic_Group>,
5756  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
5757  HelpText<"Warn on language extensions">, MarshallingInfoFlag<DiagnosticOpts<"Pedantic">>;
5758def p : Flag<["-"], "p">, HelpText<"Enable mcount instrumentation with prof">;
5759def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">,
5760  Visibility<[ClangOption, CC1Option]>,
5761  MarshallingInfoFlag<CodeGenOpts<"InstrumentForProfiling">>;
5762def pipe : Flag<["-", "--"], "pipe">,
5763  HelpText<"Use pipes between commands, when possible">;
5764def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">;
5765def prebind : Flag<["-"], "prebind">;
5766def preload : Flag<["-"], "preload">;
5767def print_file_name_EQ : Joined<["-", "--"], "print-file-name=">,
5768  HelpText<"Print the full library path of <file>">, MetaVarName<"<file>">,
5769  Visibility<[ClangOption, CLOption]>;
5770def print_ivar_layout : Flag<["-"], "print-ivar-layout">,
5771  Visibility<[ClangOption, CC1Option]>,
5772  HelpText<"Enable Objective-C Ivar layout bitmap print trace">,
5773  MarshallingInfoFlag<LangOpts<"ObjCGCBitmapPrint">>;
5774def print_libgcc_file_name : Flag<["-", "--"], "print-libgcc-file-name">,
5775  HelpText<"Print the library path for the currently used compiler runtime "
5776           "library (\"libgcc.a\" or \"libclang_rt.builtins.*.a\")">,
5777  Visibility<[ClangOption, CLOption]>;
5778def print_multi_directory : Flag<["-", "--"], "print-multi-directory">;
5779def print_multi_lib : Flag<["-", "--"], "print-multi-lib">;
5780def print_multi_flags : Flag<["-", "--"], "print-multi-flags-experimental">,
5781  HelpText<"Print the flags used for selecting multilibs (experimental)">;
5782def fmultilib_flag : Joined<["-", "--"], "fmultilib-flag=">,
5783  Visibility<[ClangOption]>;
5784def print_multi_os_directory : Flag<["-", "--"], "print-multi-os-directory">,
5785  Flags<[Unsupported]>;
5786def print_target_triple : Flag<["-", "--"], "print-target-triple">,
5787  HelpText<"Print the normalized target triple">,
5788  Visibility<[ClangOption, FlangOption, CLOption]>;
5789def print_effective_triple : Flag<["-", "--"], "print-effective-triple">,
5790  HelpText<"Print the effective target triple">,
5791  Visibility<[ClangOption, FlangOption, CLOption]>;
5792// GCC --disable-multiarch, GCC --enable-multiarch (upstream and Debian
5793// specific) have different behaviors. We choose not to support the option.
5794def : Flag<["-", "--"], "print-multiarch">, Flags<[Unsupported]>;
5795def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">,
5796  HelpText<"Print the full program path of <name>">, MetaVarName<"<name>">,
5797  Visibility<[ClangOption, CLOption]>;
5798def print_resource_dir : Flag<["-", "--"], "print-resource-dir">,
5799  HelpText<"Print the resource directory pathname">,
5800  HelpTextForVariants<[FlangOption],
5801                      "Print the resource directory pathname that contains lib and "
5802                      "include directories with the runtime libraries and MODULE files.">,
5803  Visibility<[ClangOption, CLOption, FlangOption]>;
5804def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
5805  HelpText<"Print the paths used for finding libraries and programs">,
5806  Visibility<[ClangOption, CLOption]>;
5807def print_std_module_manifest_path : Flag<["-", "--"], "print-library-module-manifest-path">,
5808  HelpText<"Print the path for the C++ Standard library module manifest">,
5809  Visibility<[ClangOption, CLOption]>;
5810def print_targets : Flag<["-", "--"], "print-targets">,
5811  HelpText<"Print the registered targets">,
5812  Visibility<[ClangOption, CLOption]>;
5813def print_rocm_search_dirs : Flag<["-", "--"], "print-rocm-search-dirs">,
5814  HelpText<"Print the paths used for finding ROCm installation">,
5815  Visibility<[ClangOption, CLOption]>;
5816def print_runtime_dir : Flag<["-", "--"], "print-runtime-dir">,
5817  HelpText<"Print the directory pathname containing Clang's runtime libraries">,
5818  Visibility<[ClangOption, CLOption]>;
5819def print_diagnostic_options : Flag<["-", "--"], "print-diagnostic-options">,
5820  HelpText<"Print all of Clang's warning options">,
5821  Visibility<[ClangOption, CLOption]>;
5822def private__bundle : Flag<["-"], "private_bundle">;
5823def pthreads : Flag<["-"], "pthreads">;
5824defm pthread : BoolOption<"", "pthread",
5825  LangOpts<"POSIXThreads">, DefaultFalse,
5826  PosFlag<SetTrue, [], [ClangOption], "Support POSIX threads in generated code">,
5827  NegFlag<SetFalse>,
5828  BothFlags<[], [ClangOption, CC1Option, FlangOption, FC1Option]>>;
5829def pie : Flag<["-"], "pie">, Group<Link_Group>;
5830def static_pie : Flag<["-"], "static-pie">, Group<Link_Group>;
5831def read__only__relocs : Separate<["-"], "read_only_relocs">;
5832def remap : Flag<["-"], "remap">;
5833def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[NoXarchOption]>,
5834  Visibility<[ClangOption, CC1Option]>,
5835  HelpText<"Rewrite Objective-C source to C++">, Group<Action_Group>;
5836def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">,
5837  Flags<[NoXarchOption]>,
5838  HelpText<"Rewrite Legacy Objective-C source to C++">;
5839def rdynamic : Flag<["-"], "rdynamic">, Group<Link_Group>,
5840  Visibility<[ClangOption, FlangOption]>;
5841def resource_dir : Separate<["-"], "resource-dir">,
5842  Flags<[NoXarchOption, HelpHidden]>,
5843  Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FlangOption, FC1Option]>,
5844  HelpText<"The directory which holds the compiler resource files">,
5845  MarshallingInfoString<HeaderSearchOpts<"ResourceDir">>;
5846def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[NoXarchOption]>,
5847  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
5848  Alias<resource_dir>;
5849def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>, Group<Link_Group>,
5850  Visibility<[ClangOption, FlangOption]>;
5851def rtlib_EQ : Joined<["-", "--"], "rtlib=">, Visibility<[ClangOption, CLOption, FlangOption]>,
5852  HelpText<"Compiler runtime library to use">;
5853def frtlib_add_rpath: Flag<["-"], "frtlib-add-rpath">, Flags<[NoArgumentUnused]>,
5854  Visibility<[ClangOption, FlangOption]>,
5855  HelpText<"Add -rpath with architecture-specific resource directory to the linker flags. "
5856  "When --hip-link is specified, also add -rpath with HIP runtime library directory to the linker flags">;
5857def fno_rtlib_add_rpath: Flag<["-"], "fno-rtlib-add-rpath">,
5858  Flags<[NoArgumentUnused]>,
5859  Visibility<[ClangOption, FlangOption]>,
5860  HelpText<"Do not add -rpath with architecture-specific resource directory to the linker flags. "
5861  "When --hip-link is specified, do not add -rpath with HIP runtime library directory to the linker flags">;
5862def frtlib_defaultlib : Flag<["-"], "frtlib-defaultlib">,
5863                      Visibility<[ClangOption, CLOption]>,
5864                      Group<f_Group>,
5865                      HelpText<"On Windows, emit /defaultlib: directives to link compiler-rt libraries (default)">;
5866def fno_rtlib_defaultlib : Flag<["-"], "fno-rtlib-defaultlib">,
5867                      Visibility<[ClangOption, CLOption]>,
5868                      Group<f_Group>,
5869                      HelpText<"On Windows, do not emit /defaultlib: directives to link compiler-rt libraries">;
5870def offload_add_rpath: Flag<["--"], "offload-add-rpath">,
5871  Flags<[NoArgumentUnused]>,
5872  Alias<frtlib_add_rpath>;
5873def no_offload_add_rpath: Flag<["--"], "no-offload-add-rpath">,
5874  Flags<[NoArgumentUnused]>,
5875  Alias<frtlib_add_rpath>;
5876def r : Flag<["-"], "r">, Flags<[LinkerInput, NoArgumentUnused]>,
5877        Group<Link_Group>;
5878def regcall4 : Flag<["-"], "regcall4">, Group<m_Group>,
5879  Visibility<[ClangOption, CC1Option]>,
5880  HelpText<"Set __regcall4 as a default calling convention to respect __regcall ABI v.4">,
5881  MarshallingInfoFlag<LangOpts<"RegCall4">>;
5882def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[NoXarchOption]>,
5883  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
5884  HelpText<"Save intermediate compilation results. <arg> can be set to 'cwd' for "
5885  "current working directory, or 'obj' which will save temporary files in the "
5886  "same directory as the final output file">;
5887def save_temps : Flag<["-", "--"], "save-temps">, Flags<[NoXarchOption]>,
5888  Visibility<[ClangOption, FlangOption, FC1Option]>,
5889  Alias<save_temps_EQ>, AliasArgs<["cwd"]>,
5890  HelpText<"Alias for --save-temps=cwd">;
5891def save_stats_EQ : Joined<["-", "--"], "save-stats=">, Flags<[NoXarchOption]>,
5892  HelpText<"Save llvm statistics.">;
5893def save_stats : Flag<["-", "--"], "save-stats">, Flags<[NoXarchOption]>,
5894  Alias<save_stats_EQ>, AliasArgs<["cwd"]>,
5895  HelpText<"Save llvm statistics.">;
5896def via_file_asm : Flag<["-", "--"], "via-file-asm">, InternalDebugOpt,
5897  HelpText<"Write assembly to file for input to assemble jobs">;
5898def sectalign : MultiArg<["-"], "sectalign", 3>;
5899def sectcreate : MultiArg<["-"], "sectcreate", 3>;
5900def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>;
5901def sectorder : MultiArg<["-"], "sectorder", 3>;
5902def seg1addr : JoinedOrSeparate<["-"], "seg1addr">;
5903def seg__addr__table__filename : Separate<["-"], "seg_addr_table_filename">;
5904def seg__addr__table : Separate<["-"], "seg_addr_table">;
5905def segaddr : MultiArg<["-"], "segaddr", 2>;
5906def segcreate : MultiArg<["-"], "segcreate", 3>;
5907def seglinkedit : Flag<["-"], "seglinkedit">;
5908def segprot : MultiArg<["-"], "segprot", 3>;
5909def segs__read__only__addr : Separate<["-"], "segs_read_only_addr">;
5910def segs__read__write__addr : Separate<["-"], "segs_read_write_addr">;
5911def segs__read__ : Joined<["-"], "segs_read_">;
5912def shared_libgcc : Flag<["-"], "shared-libgcc">;
5913def shared : Flag<["-", "--"], "shared">, Group<Link_Group>,
5914  Visibility<[ClangOption, FlangOption]>;
5915def single__module : Flag<["-"], "single_module">;
5916def specs_EQ : Joined<["-", "--"], "specs=">, Group<Link_Group>;
5917def specs : Separate<["-", "--"], "specs">, Flags<[Unsupported]>;
5918def start_no_unused_arguments : Flag<["--"], "start-no-unused-arguments">,
5919  Visibility<[ClangOption, CLOption, DXCOption]>,
5920  HelpText<"Don't emit warnings about unused arguments for the following arguments">;
5921def static_libgcc : Flag<["-"], "static-libgcc">;
5922def static_libstdcxx : Flag<["-"], "static-libstdc++">;
5923def static : Flag<["-", "--"], "static">, Group<Link_Group>,
5924  Visibility<[ClangOption, FlangOption]>,
5925  Flags<[NoArgumentUnused]>;
5926def std_default_EQ : Joined<["-"], "std-default=">;
5927def std_EQ : Joined<["-", "--"], "std=">,
5928  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
5929  Group<CompileOnly_Group>, HelpText<"Language standard to compile for">,
5930  ValuesCode<[{
5931    static constexpr const char VALUES_CODE [] =
5932    #define LANGSTANDARD(id, name, lang, desc, features) name ","
5933    #define LANGSTANDARD_ALIAS(id, alias) alias ","
5934    #include "clang/Basic/LangStandards.def"
5935    ;
5936  }]>;
5937def stdlib_EQ : Joined<["-", "--"], "stdlib=">,
5938  Visibility<[ClangOption, CC1Option]>,
5939  HelpText<"C++ standard library to use">, Values<"libc++,libstdc++,platform">;
5940def stdlibxx_isystem : JoinedOrSeparate<["-"], "stdlib++-isystem">,
5941  Group<clang_i_Group>,
5942  HelpText<"Use directory as the C++ standard library include path">,
5943  Flags<[NoXarchOption]>, MetaVarName<"<directory>">;
5944def unwindlib_EQ : Joined<["-", "--"], "unwindlib=">,
5945  Visibility<[ClangOption, CC1Option]>,
5946  HelpText<"Unwind library to use">, Values<"libgcc,unwindlib,platform">;
5947def sub__library : JoinedOrSeparate<["-"], "sub_library">;
5948def sub__umbrella : JoinedOrSeparate<["-"], "sub_umbrella">;
5949def system_header_prefix : Joined<["--"], "system-header-prefix=">,
5950  Group<clang_i_Group>, Visibility<[ClangOption, CC1Option]>,
5951  MetaVarName<"<prefix>">,
5952  HelpText<"Treat all #include paths starting with <prefix> as including a "
5953           "system header.">;
5954def : Separate<["--"], "system-header-prefix">, Alias<system_header_prefix>;
5955def no_system_header_prefix : Joined<["--"], "no-system-header-prefix=">,
5956  Group<clang_i_Group>, Visibility<[ClangOption, CC1Option]>,
5957  MetaVarName<"<prefix>">,
5958  HelpText<"Treat all #include paths starting with <prefix> as not including a "
5959           "system header.">;
5960def : Separate<["--"], "no-system-header-prefix">, Alias<no_system_header_prefix>;
5961def s : Flag<["-"], "s">, Group<Link_Group>;
5962def target : Joined<["--"], "target=">, Flags<[NoXarchOption]>,
5963  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
5964  HelpText<"Generate code for the given target">;
5965def darwin_target_variant : Separate<["-"], "darwin-target-variant">,
5966  Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption]>,
5967  HelpText<"Generate code for an additional runtime variant of the deployment target">;
5968
5969//===----------------------------------------------------------------------===//
5970// Print CPU info options (clang, clang-cl, flang)
5971//===----------------------------------------------------------------------===//
5972
5973let Visibility = [ClangOption, CC1Option, CLOption, FlangOption, FC1Option] in {
5974
5975def print_supported_cpus : Flag<["-", "--"], "print-supported-cpus">,
5976  Group<CompileOnly_Group>,
5977  HelpText<"Print supported cpu models for the given target (if target is not "
5978           "specified,it will print the supported cpus for the default target)">,
5979  MarshallingInfoFlag<FrontendOpts<"PrintSupportedCPUs">>;
5980
5981def : Flag<["-"], "mcpu=help">, Alias<print_supported_cpus>;
5982def : Flag<["-"], "mtune=help">, Alias<print_supported_cpus>;
5983
5984} // let Visibility = [ClangOption, CC1Option, CLOption, FlangOption, FC1Option]
5985
5986def print_supported_extensions : Flag<["-", "--"], "print-supported-extensions">,
5987  Visibility<[ClangOption, CC1Option, CLOption]>,
5988  HelpText<"Print supported -march extensions (RISC-V, AArch64 and ARM only)">,
5989  MarshallingInfoFlag<FrontendOpts<"PrintSupportedExtensions">>;
5990def print_enabled_extensions : Flag<["-", "--"], "print-enabled-extensions">,
5991  Visibility<[ClangOption, CC1Option, CLOption]>,
5992  HelpText<"Print the extensions enabled by the given target and -march/-mcpu options."
5993           " (AArch64 and RISC-V only)">,
5994  MarshallingInfoFlag<FrontendOpts<"PrintEnabledExtensions">>;
5995def time : Flag<["-"], "time">,
5996  HelpText<"Time individual commands">;
5997def traditional_cpp : Flag<["-", "--"], "traditional-cpp">,
5998  Visibility<[ClangOption, CC1Option]>,
5999  HelpText<"Enable some traditional CPP emulation">,
6000  MarshallingInfoFlag<LangOpts<"TraditionalCPP">>;
6001def traditional : Flag<["-", "--"], "traditional">;
6002def trigraphs : Flag<["-", "--"], "trigraphs">, Alias<ftrigraphs>,
6003  HelpText<"Process trigraph sequences">;
6004def twolevel__namespace__hints : Flag<["-"], "twolevel_namespace_hints">;
6005def twolevel__namespace : Flag<["-"], "twolevel_namespace">;
6006def t : Flag<["-"], "t">, Group<Link_Group>;
6007def umbrella : Separate<["-"], "umbrella">;
6008def undefined : JoinedOrSeparate<["-"], "undefined">, Group<u_Group>;
6009def undef : Flag<["-"], "undef">, Group<u_Group>,
6010  Visibility<[ClangOption, CC1Option]>,
6011  HelpText<"undef all system defines">,
6012  MarshallingInfoNegativeFlag<PreprocessorOpts<"UsePredefines">>;
6013def unexported__symbols__list : Separate<["-"], "unexported_symbols_list">;
6014def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
6015def v : Flag<["-"], "v">,
6016  Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FlangOption]>,
6017  HelpText<"Show commands to run and use verbose output">,
6018  MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
6019def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
6020  Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
6021  HelpText<"Source-level compatibility for Altivec vectors (for PowerPC "
6022           "targets). This includes results of vector comparison (scalar for "
6023           "'xl', vector for 'gcc') as well as behavior when initializing with "
6024           "a scalar (splatting for 'xl', element zero only for 'gcc'). For "
6025           "'mixed', the compatibility is as 'gcc' for 'vector bool/vector "
6026           "pixel' and as 'xl' for other types. Current default is 'mixed'.">,
6027  Values<"mixed,gcc,xl">,
6028  NormalizedValuesScope<"LangOptions::AltivecSrcCompatKind">,
6029  NormalizedValues<["Mixed", "GCC", "XL"]>,
6030  MarshallingInfoEnum<LangOpts<"AltivecSrcCompat">, "Mixed">;
6031def verify_debug_info : Flag<["--"], "verify-debug-info">,
6032  Flags<[NoXarchOption]>,
6033  HelpText<"Verify the binary representation of debug output">;
6034def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>;
6035def weak__framework : Separate<["-"], "weak_framework">, Flags<[LinkerInput]>;
6036def weak__library : Separate<["-"], "weak_library">, Flags<[LinkerInput]>;
6037def weak__reference__mismatches : Separate<["-"], "weak_reference_mismatches">;
6038def whatsloaded : Flag<["-"], "whatsloaded">;
6039def why_load : Flag<["-"], "why_load">;
6040def whyload : Flag<["-"], "whyload">, Alias<why_load>;
6041def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">,
6042  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
6043  MarshallingInfoFlag<DiagnosticOpts<"IgnoreWarnings">>;
6044def x : JoinedOrSeparate<["-"], "x">,
6045Flags<[NoXarchOption]>,
6046  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option, CLOption]>,
6047  HelpText<"Treat subsequent input files as having type <language>">,
6048  MetaVarName<"<language>">;
6049def y : Joined<["-"], "y">;
6050
6051defm integrated_as : BoolFOption<"integrated-as",
6052  CodeGenOpts<"DisableIntegratedAS">, DefaultFalse,
6053  NegFlag<SetTrue, [], [ClangOption, CC1Option, FlangOption], "Disable">,
6054  PosFlag<SetFalse, [], [ClangOption, CC1Option, FlangOption], "Enable">,
6055  BothFlags<[], [ClangOption], " the integrated assembler">>;
6056
6057def fintegrated_cc1 : Flag<["-"], "fintegrated-cc1">,
6058                      Visibility<[ClangOption, CLOption, DXCOption]>,
6059                      Group<f_Group>,
6060                      HelpText<"Run cc1 in-process">;
6061def fno_integrated_cc1 : Flag<["-"], "fno-integrated-cc1">,
6062                         Visibility<[ClangOption, CLOption, DXCOption]>,
6063                         Group<f_Group>,
6064                         HelpText<"Spawn a separate process for each cc1">;
6065
6066def fintegrated_objemitter : Flag<["-"], "fintegrated-objemitter">,
6067  Visibility<[ClangOption, CLOption]>,
6068  Group<f_Group>,
6069  HelpText<"Use internal machine object code emitter.">;
6070def fno_integrated_objemitter : Flag<["-"], "fno-integrated-objemitter">,
6071  Visibility<[ClangOption, CLOption]>,
6072  Group<f_Group>,
6073  HelpText<"Use external machine object code emitter.">;
6074
6075def : Flag<["-"], "integrated-as">, Alias<fintegrated_as>;
6076def : Flag<["-"], "no-integrated-as">, Alias<fno_integrated_as>,
6077      Visibility<[ClangOption, CC1Option, FlangOption]>;
6078
6079def working_directory : Separate<["-"], "working-directory">,
6080  Visibility<[ClangOption, CC1Option]>,
6081  HelpText<"Resolve file paths relative to the specified directory">,
6082  MarshallingInfoString<FileSystemOpts<"WorkingDir">>;
6083def working_directory_EQ : Joined<["-"], "working-directory=">,
6084  Visibility<[ClangOption, CC1Option]>,
6085  Alias<working_directory>;
6086
6087// Double dash options, which are usually an alias for one of the previous
6088// options.
6089
6090def _mhwdiv_EQ : Joined<["--"], "mhwdiv=">, Alias<mhwdiv_EQ>;
6091def _mhwdiv : Separate<["--"], "mhwdiv">, Alias<mhwdiv_EQ>;
6092def _CLASSPATH_EQ : Joined<["--"], "CLASSPATH=">, Alias<fclasspath_EQ>;
6093def _CLASSPATH : Separate<["--"], "CLASSPATH">, Alias<fclasspath_EQ>;
6094def _all_warnings : Flag<["--"], "all-warnings">, Alias<Wall>;
6095def _analyzer_no_default_checks : Flag<["--"], "analyzer-no-default-checks">,
6096  Flags<[NoXarchOption]>;
6097def _analyzer_output : JoinedOrSeparate<["--"], "analyzer-output">,
6098  Flags<[NoXarchOption]>,
6099  HelpText<"Static analyzer report output format (html|plist|plist-multi-file|plist-html|sarif|sarif-html|text).">;
6100def _analyze : Flag<["--"], "analyze">, Flags<[NoXarchOption]>,
6101  Visibility<[ClangOption, CLOption]>,
6102  HelpText<"Run the static analyzer">;
6103def _assemble : Flag<["--"], "assemble">, Alias<S>;
6104def _assert_EQ : Joined<["--"], "assert=">, Alias<A>;
6105def _assert : Separate<["--"], "assert">, Alias<A>;
6106def _bootclasspath_EQ : Joined<["--"], "bootclasspath=">, Alias<fbootclasspath_EQ>;
6107def _bootclasspath : Separate<["--"], "bootclasspath">, Alias<fbootclasspath_EQ>;
6108def _classpath_EQ : Joined<["--"], "classpath=">, Alias<fclasspath_EQ>;
6109def _classpath : Separate<["--"], "classpath">, Alias<fclasspath_EQ>;
6110def _comments_in_macros : Flag<["--"], "comments-in-macros">, Alias<CC>;
6111def _comments : Flag<["--"], "comments">, Alias<C>;
6112def _compile : Flag<["--"], "compile">, Alias<c>;
6113def _constant_cfstrings : Flag<["--"], "constant-cfstrings">;
6114def _debug_EQ : Joined<["--"], "debug=">, Alias<g_Flag>;
6115def _debug : Flag<["--"], "debug">, Alias<g_Flag>;
6116def _define_macro_EQ : Joined<["--"], "define-macro=">, Alias<D>;
6117def _define_macro : Separate<["--"], "define-macro">, Alias<D>;
6118def _dependencies : Flag<["--"], "dependencies">, Alias<M>;
6119def _dyld_prefix_EQ : Joined<["--"], "dyld-prefix=">;
6120def _dyld_prefix : Separate<["--"], "dyld-prefix">, Alias<_dyld_prefix_EQ>;
6121def _encoding_EQ : Joined<["--"], "encoding=">, Alias<fencoding_EQ>;
6122def _encoding : Separate<["--"], "encoding">, Alias<fencoding_EQ>;
6123def _entry : Flag<["--"], "entry">, Alias<e>;
6124def _extdirs_EQ : Joined<["--"], "extdirs=">, Alias<fextdirs_EQ>;
6125def _extdirs : Separate<["--"], "extdirs">, Alias<fextdirs_EQ>;
6126def _extra_warnings : Flag<["--"], "extra-warnings">, Alias<W_Joined>;
6127def _for_linker_EQ : Joined<["--"], "for-linker=">, Alias<Xlinker>;
6128def _for_linker : Separate<["--"], "for-linker">, Alias<Xlinker>;
6129def _force_link_EQ : Joined<["--"], "force-link=">, Alias<u>;
6130def _force_link : Separate<["--"], "force-link">, Alias<u>;
6131def _imacros_EQ : Joined<["--"], "imacros=">, Alias<imacros>;
6132def _include_barrier : Flag<["--"], "include-barrier">, Alias<I_>;
6133def _include_directory_after_EQ : Joined<["--"], "include-directory-after=">, Alias<idirafter>;
6134def _include_directory_after : Separate<["--"], "include-directory-after">, Alias<idirafter>;
6135def _include_directory_EQ : Joined<["--"], "include-directory=">, Alias<I>;
6136def _include_directory : Separate<["--"], "include-directory">, Alias<I>;
6137def _include_prefix_EQ : Joined<["--"], "include-prefix=">, Alias<iprefix>;
6138def _include_prefix : Separate<["--"], "include-prefix">, Alias<iprefix>;
6139def _include_with_prefix_after_EQ : Joined<["--"], "include-with-prefix-after=">, Alias<iwithprefix>;
6140def _include_with_prefix_after : Separate<["--"], "include-with-prefix-after">, Alias<iwithprefix>;
6141def _include_with_prefix_before_EQ : Joined<["--"], "include-with-prefix-before=">, Alias<iwithprefixbefore>;
6142def _include_with_prefix_before : Separate<["--"], "include-with-prefix-before">, Alias<iwithprefixbefore>;
6143def _include_with_prefix_EQ : Joined<["--"], "include-with-prefix=">, Alias<iwithprefix>;
6144def _include_with_prefix : Separate<["--"], "include-with-prefix">, Alias<iwithprefix>;
6145def _include_EQ : Joined<["--"], "include=">, Alias<include_>;
6146def _language_EQ : Joined<["--"], "language=">, Alias<x>;
6147def _language : Separate<["--"], "language">, Alias<x>;
6148def _library_directory_EQ : Joined<["--"], "library-directory=">, Alias<L>;
6149def _library_directory : Separate<["--"], "library-directory">, Alias<L>;
6150def _no_line_commands : Flag<["--"], "no-line-commands">, Alias<P>;
6151def _no_standard_includes : Flag<["--"], "no-standard-includes">, Alias<nostdinc>;
6152def _no_standard_libraries : Flag<["--"], "no-standard-libraries">, Alias<nostdlib>;
6153def _no_undefined : Flag<["--"], "no-undefined">, Flags<[LinkerInput]>;
6154def _no_warnings : Flag<["--"], "no-warnings">,
6155  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
6156  Alias<w>;
6157def _optimize_EQ : Joined<["--"], "optimize=">, Alias<O>;
6158def _optimize : Flag<["--"], "optimize">, Alias<O>;
6159def _output_class_directory_EQ : Joined<["--"], "output-class-directory=">, Alias<foutput_class_dir_EQ>;
6160def _output_class_directory : Separate<["--"], "output-class-directory">, Alias<foutput_class_dir_EQ>;
6161def _output_EQ : Joined<["--"], "output=">, Alias<o>;
6162def _output : Separate<["--"], "output">, Alias<o>;
6163def _param : Separate<["--"], "param">, Group<CompileOnly_Group>;
6164def _param_EQ : Joined<["--"], "param=">, Alias<_param>;
6165def _precompile : Flag<["--"], "precompile">, Flags<[NoXarchOption]>,
6166  Visibility<[ClangOption, CLOption]>,
6167  Group<Action_Group>, HelpText<"Only precompile the input">;
6168def _prefix_EQ : Joined<["--"], "prefix=">, Alias<B>;
6169def _prefix : Separate<["--"], "prefix">, Alias<B>;
6170def _preprocess : Flag<["--"], "preprocess">, Alias<E>;
6171def _print_diagnostic_categories : Flag<["--"], "print-diagnostic-categories">;
6172def _print_file_name : Separate<["--"], "print-file-name">, Alias<print_file_name_EQ>;
6173def _print_missing_file_dependencies : Flag<["--"], "print-missing-file-dependencies">, Alias<MG>;
6174def _print_prog_name : Separate<["--"], "print-prog-name">, Alias<print_prog_name_EQ>;
6175def _profile : Flag<["--"], "profile">, Alias<p>;
6176def _resource_EQ : Joined<["--"], "resource=">, Alias<fcompile_resource_EQ>;
6177def _resource : Separate<["--"], "resource">, Alias<fcompile_resource_EQ>;
6178def _rtlib : Separate<["--"], "rtlib">, Alias<rtlib_EQ>;
6179def _serialize_diags : Separate<["-", "--"], "serialize-diagnostics">,
6180  Flags<[NoXarchOption]>,
6181  HelpText<"Serialize compiler diagnostics to a file">;
6182// We give --version different semantics from -version.
6183def _version : Flag<["--"], "version">,
6184  Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
6185  HelpText<"Print version information">;
6186def _signed_char : Flag<["--"], "signed-char">, Alias<fsigned_char>;
6187def _std : Separate<["--"], "std">, Alias<std_EQ>;
6188def _stdlib : Separate<["--"], "stdlib">, Alias<stdlib_EQ>;
6189def _target_help : Flag<["--"], "target-help">;
6190def _trace_includes : Flag<["--"], "trace-includes">, Alias<H>;
6191def _undefine_macro_EQ : Joined<["--"], "undefine-macro=">, Alias<U>;
6192def _undefine_macro : Separate<["--"], "undefine-macro">, Alias<U>;
6193def _unsigned_char : Flag<["--"], "unsigned-char">, Alias<funsigned_char>;
6194def _user_dependencies : Flag<["--"], "user-dependencies">, Alias<MM>;
6195def _verbose : Flag<["--"], "verbose">, Alias<v>;
6196def _warn__EQ : Joined<["--"], "warn-=">, Alias<W_Joined>;
6197def _warn_ : Joined<["--"], "warn-">, Alias<W_Joined>;
6198def _write_dependencies : Flag<["--"], "write-dependencies">, Alias<MD>;
6199def _write_user_dependencies : Flag<["--"], "write-user-dependencies">, Alias<MMD>;
6200
6201def _help_hidden : Flag<["--"], "help-hidden">,
6202  Visibility<[ClangOption, FlangOption]>,
6203  HelpText<"Display help for hidden options">;
6204def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOption]>;
6205def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>;
6206
6207//===----------------------------------------------------------------------===//
6208// pie/pic options (clang + flang)
6209//===----------------------------------------------------------------------===//
6210let Visibility = [ClangOption, FlangOption] in {
6211
6212def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
6213def fno_PIC : Flag<["-"], "fno-PIC">, Group<f_Group>;
6214def fPIE : Flag<["-"], "fPIE">, Group<f_Group>;
6215def fno_PIE : Flag<["-"], "fno-PIE">, Group<f_Group>;
6216def fpic : Flag<["-"], "fpic">, Group<f_Group>;
6217def fno_pic : Flag<["-"], "fno-pic">, Group<f_Group>;
6218def fpie : Flag<["-"], "fpie">, Group<f_Group>;
6219def fno_pie : Flag<["-"], "fno-pie">, Group<f_Group>;
6220
6221} // let Vis = [Default, FlangOption]
6222
6223//===----------------------------------------------------------------------===//
6224// Target Options (clang + flang)
6225//===----------------------------------------------------------------------===//
6226let Flags = [TargetSpecific] in {
6227let Visibility = [ClangOption, FlangOption] in {
6228
6229def mcpu_EQ : Joined<["-"], "mcpu=">, Group<m_Group>,
6230  HelpText<"For a list of available CPUs for the target use '-mcpu=help'">;
6231def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group<m_Group>;
6232
6233} // let Vis = [Default, FlangOption]
6234} // let Flags = [TargetSpecific]
6235
6236// Hexagon feature flags.
6237let Flags = [TargetSpecific] in {
6238def mieee_rnd_near : Flag<["-"], "mieee-rnd-near">,
6239  Group<m_hexagon_Features_Group>;
6240def mv5 : Flag<["-"], "mv5">, Group<m_hexagon_Features_Group>, Alias<mcpu_EQ>,
6241  AliasArgs<["hexagonv5"]>;
6242def mv55 : Flag<["-"], "mv55">, Group<m_hexagon_Features_Group>,
6243  Alias<mcpu_EQ>, AliasArgs<["hexagonv55"]>;
6244def mv60 : Flag<["-"], "mv60">, Group<m_hexagon_Features_Group>,
6245  Alias<mcpu_EQ>, AliasArgs<["hexagonv60"]>;
6246def mv62 : Flag<["-"], "mv62">, Group<m_hexagon_Features_Group>,
6247  Alias<mcpu_EQ>, AliasArgs<["hexagonv62"]>;
6248def mv65 : Flag<["-"], "mv65">, Group<m_hexagon_Features_Group>,
6249  Alias<mcpu_EQ>, AliasArgs<["hexagonv65"]>;
6250def mv66 : Flag<["-"], "mv66">, Group<m_hexagon_Features_Group>,
6251  Alias<mcpu_EQ>, AliasArgs<["hexagonv66"]>;
6252def mv67 : Flag<["-"], "mv67">, Group<m_hexagon_Features_Group>,
6253  Alias<mcpu_EQ>, AliasArgs<["hexagonv67"]>;
6254def mv67t : Flag<["-"], "mv67t">, Group<m_hexagon_Features_Group>,
6255  Alias<mcpu_EQ>, AliasArgs<["hexagonv67t"]>;
6256def mv68 : Flag<["-"], "mv68">, Group<m_hexagon_Features_Group>,
6257  Alias<mcpu_EQ>, AliasArgs<["hexagonv68"]>;
6258def mv69 : Flag<["-"], "mv69">, Group<m_hexagon_Features_Group>,
6259  Alias<mcpu_EQ>, AliasArgs<["hexagonv69"]>;
6260def mv71 : Flag<["-"], "mv71">, Group<m_hexagon_Features_Group>,
6261  Alias<mcpu_EQ>, AliasArgs<["hexagonv71"]>;
6262def mv71t : Flag<["-"], "mv71t">, Group<m_hexagon_Features_Group>,
6263  Alias<mcpu_EQ>, AliasArgs<["hexagonv71t"]>;
6264def mv73 : Flag<["-"], "mv73">, Group<m_hexagon_Features_Group>,
6265  Alias<mcpu_EQ>, AliasArgs<["hexagonv73"]>;
6266def mv75 : Flag<["-"], "mv75">, Group<m_hexagon_Features_Group>,
6267  Alias<mcpu_EQ>, AliasArgs<["hexagonv75"]>;
6268def mv79 : Flag<["-"], "mv79">, Group<m_hexagon_Features_Group>,
6269  Alias<mcpu_EQ>, AliasArgs<["hexagonv79"]>;
6270def mhexagon_hvx : Flag<["-"], "mhvx">, Group<m_hexagon_Features_HVX_Group>,
6271  HelpText<"Enable Hexagon Vector eXtensions">;
6272def mhexagon_hvx_EQ : Joined<["-"], "mhvx=">,
6273  Group<m_hexagon_Features_HVX_Group>,
6274  HelpText<"Enable Hexagon Vector eXtensions">;
6275def mno_hexagon_hvx : Flag<["-"], "mno-hvx">,
6276  Group<m_hexagon_Features_HVX_Group>,
6277  HelpText<"Disable Hexagon Vector eXtensions">;
6278def mhexagon_hvx_length_EQ : Joined<["-"], "mhvx-length=">,
6279  Group<m_hexagon_Features_HVX_Group>, HelpText<"Set Hexagon Vector Length">,
6280  Values<"64B,128B">;
6281def mhexagon_hvx_qfloat : Flag<["-"], "mhvx-qfloat">,
6282  Group<m_hexagon_Features_HVX_Group>,
6283  HelpText<"Enable Hexagon HVX QFloat instructions">;
6284def mno_hexagon_hvx_qfloat : Flag<["-"], "mno-hvx-qfloat">,
6285  Group<m_hexagon_Features_HVX_Group>,
6286  HelpText<"Disable Hexagon HVX QFloat instructions">;
6287def mhexagon_hvx_ieee_fp : Flag<["-"], "mhvx-ieee-fp">,
6288  Group<m_hexagon_Features_Group>,
6289  HelpText<"Enable Hexagon HVX IEEE floating-point">;
6290def mno_hexagon_hvx_ieee_fp : Flag<["-"], "mno-hvx-ieee-fp">,
6291  Group<m_hexagon_Features_Group>,
6292  HelpText<"Disable Hexagon HVX IEEE floating-point">;
6293def ffixed_r19: Flag<["-"], "ffixed-r19">, Group<f_Group>,
6294  HelpText<"Reserve register r19 (Hexagon only)">;
6295} // let Flags = [TargetSpecific]
6296def mmemops : Flag<["-"], "mmemops">, Group<m_hexagon_Features_Group>,
6297  Visibility<[ClangOption, CC1Option]>,
6298  HelpText<"Enable generation of memop instructions">;
6299def mno_memops : Flag<["-"], "mno-memops">, Group<m_hexagon_Features_Group>,
6300  Visibility<[ClangOption, CC1Option]>,
6301  HelpText<"Disable generation of memop instructions">;
6302def mpackets : Flag<["-"], "mpackets">, Group<m_hexagon_Features_Group>,
6303  Visibility<[ClangOption, CC1Option]>,
6304  HelpText<"Enable generation of instruction packets">;
6305def mno_packets : Flag<["-"], "mno-packets">, Group<m_hexagon_Features_Group>,
6306  Visibility<[ClangOption, CC1Option]>,
6307  HelpText<"Disable generation of instruction packets">;
6308def mnvj : Flag<["-"], "mnvj">, Group<m_hexagon_Features_Group>,
6309  Visibility<[ClangOption, CC1Option]>,
6310  HelpText<"Enable generation of new-value jumps">;
6311def mno_nvj : Flag<["-"], "mno-nvj">, Group<m_hexagon_Features_Group>,
6312  Visibility<[ClangOption, CC1Option]>,
6313  HelpText<"Disable generation of new-value jumps">;
6314def mnvs : Flag<["-"], "mnvs">, Group<m_hexagon_Features_Group>,
6315  Visibility<[ClangOption, CC1Option]>,
6316  HelpText<"Enable generation of new-value stores">;
6317def mno_nvs : Flag<["-"], "mno-nvs">, Group<m_hexagon_Features_Group>,
6318  Visibility<[ClangOption, CC1Option]>,
6319  HelpText<"Disable generation of new-value stores">;
6320def mcabac: Flag<["-"], "mcabac">, Group<m_hexagon_Features_Group>,
6321  HelpText<"Enable CABAC instructions">;
6322
6323// SPARC feature flags
6324let Flags = [TargetSpecific] in {
6325def mfpu : Flag<["-"], "mfpu">, Group<m_sparc_Features_Group>;
6326def mno_fpu : Flag<["-"], "mno-fpu">, Group<m_sparc_Features_Group>;
6327def mfsmuld : Flag<["-"], "mfsmuld">, Group<m_sparc_Features_Group>;
6328def mno_fsmuld : Flag<["-"], "mno-fsmuld">, Group<m_sparc_Features_Group>;
6329def mpopc : Flag<["-"], "mpopc">, Group<m_sparc_Features_Group>;
6330def mno_popc : Flag<["-"], "mno-popc">, Group<m_sparc_Features_Group>;
6331def mvis : Flag<["-"], "mvis">, Group<m_sparc_Features_Group>;
6332def mno_vis : Flag<["-"], "mno-vis">, Group<m_sparc_Features_Group>;
6333def mvis2 : Flag<["-"], "mvis2">, Group<m_sparc_Features_Group>;
6334def mno_vis2 : Flag<["-"], "mno-vis2">, Group<m_sparc_Features_Group>;
6335def mvis3 : Flag<["-"], "mvis3">, Group<m_sparc_Features_Group>;
6336def mno_vis3 : Flag<["-"], "mno-vis3">, Group<m_sparc_Features_Group>;
6337def mhard_quad_float : Flag<["-"], "mhard-quad-float">, Group<m_sparc_Features_Group>;
6338def msoft_quad_float : Flag<["-"], "msoft-quad-float">, Group<m_sparc_Features_Group>;
6339def mv8plus : Flag<["-"], "mv8plus">, Group<m_sparc_Features_Group>,
6340  HelpText<"Enable V8+ mode, allowing use of 64-bit V9 instructions in 32-bit code">;
6341def mno_v8plus : Flag<["-"], "mno-v8plus">, Group<m_sparc_Features_Group>,
6342  HelpText<"Disable V8+ mode">;
6343def mfix_gr712rc : Flag<["-"], "mfix-gr712rc">, Group<m_sparc_Features_Group>,
6344  HelpText<"Enable workarounds for GR712RC errata">;
6345def mfix_ut700 : Flag<["-"], "mfix-ut700">, Group<m_sparc_Features_Group>,
6346  HelpText<"Enable workarounds for UT700 errata">;
6347foreach i = 1 ... 7 in
6348  def ffixed_g#i : Flag<["-"], "ffixed-g"#i>, Group<m_sparc_Features_Group>,
6349    HelpText<"Reserve the G"#i#" register (SPARC only)">;
6350foreach i = 0 ... 5 in
6351  def ffixed_o#i : Flag<["-"], "ffixed-o"#i>, Group<m_sparc_Features_Group>,
6352    HelpText<"Reserve the O"#i#" register (SPARC only)">;
6353foreach i = 0 ... 7 in
6354  def ffixed_l#i : Flag<["-"], "ffixed-l"#i>, Group<m_sparc_Features_Group>,
6355    HelpText<"Reserve the L"#i#" register (SPARC only)">;
6356foreach i = 0 ... 5 in
6357  def ffixed_i#i : Flag<["-"], "ffixed-i"#i>, Group<m_sparc_Features_Group>,
6358    HelpText<"Reserve the I"#i#" register (SPARC only)">;
6359} // let Flags = [TargetSpecific]
6360
6361// M68k features flags
6362let Flags = [TargetSpecific] in {
6363def m68000 : Flag<["-"], "m68000">, Group<m_m68k_Features_Group>;
6364def m68010 : Flag<["-"], "m68010">, Group<m_m68k_Features_Group>;
6365def m68020 : Flag<["-"], "m68020">, Group<m_m68k_Features_Group>;
6366def m68030 : Flag<["-"], "m68030">, Group<m_m68k_Features_Group>;
6367def m68040 : Flag<["-"], "m68040">, Group<m_m68k_Features_Group>;
6368def m68060 : Flag<["-"], "m68060">, Group<m_m68k_Features_Group>;
6369
6370def m68881 : Flag<["-"], "m68881">, Group<m_m68k_Features_Group>;
6371
6372foreach i = {0-6} in
6373  def ffixed_a#i : Flag<["-"], "ffixed-a"#i>, Group<m_m68k_Features_Group>,
6374    HelpText<"Reserve the a"#i#" register (M68k only)">;
6375foreach i = {0-7} in
6376  def ffixed_d#i : Flag<["-"], "ffixed-d"#i>, Group<m_m68k_Features_Group>,
6377    HelpText<"Reserve the d"#i#" register (M68k only)">;
6378} // let Flags = [TargetSpecific]
6379
6380// X86 feature flags
6381let Flags = [TargetSpecific] in {
6382def mx87 : Flag<["-"], "mx87">, Group<m_x86_Features_Group>;
6383def mno_x87 : Flag<["-"], "mno-x87">, Group<m_x86_Features_Group>;
6384def m80387 : Flag<["-"], "m80387">, Alias<mx87>;
6385def mno_80387 : Flag<["-"], "mno-80387">, Alias<mno_x87>;
6386def mno_fp_ret_in_387 : Flag<["-"], "mno-fp-ret-in-387">, Alias<mno_x87>;
6387def mmmx : Flag<["-"], "mmmx">, Group<m_x86_Features_Group>;
6388def mno_mmx : Flag<["-"], "mno-mmx">, Group<m_x86_Features_Group>;
6389def mamx_avx512 : Flag<["-"], "mamx-avx512">, Group<m_x86_Features_Group>;
6390def mno_amx_avx512 : Flag<["-"], "mno-amx-avx512">, Group<m_x86_Features_Group>;
6391def mamx_bf16 : Flag<["-"], "mamx-bf16">, Group<m_x86_Features_Group>;
6392def mno_amx_bf16 : Flag<["-"], "mno-amx-bf16">, Group<m_x86_Features_Group>;
6393def mamx_complex : Flag<["-"], "mamx-complex">, Group<m_x86_Features_Group>;
6394def mno_amx_complex : Flag<["-"], "mno-amx-complex">, Group<m_x86_Features_Group>;
6395def mamx_fp16 : Flag<["-"], "mamx-fp16">, Group<m_x86_Features_Group>;
6396def mno_amx_fp16 : Flag<["-"], "mno-amx-fp16">, Group<m_x86_Features_Group>;
6397def mamx_int8 : Flag<["-"], "mamx-int8">, Group<m_x86_Features_Group>;
6398def mno_amx_int8 : Flag<["-"], "mno-amx-int8">, Group<m_x86_Features_Group>;
6399def mamx_fp8 : Flag<["-"], "mamx-fp8">, Group<m_x86_Features_Group>;
6400def mno_amx_fp8 : Flag<["-"], "mno-amx-fp8">, Group<m_x86_Features_Group>;
6401def mamx_tf32 : Flag<["-"], "mamx-tf32">, Group<m_x86_Features_Group>;
6402def mno_amx_tf32 : Flag<["-"], "mno-amx-tf32">, Group<m_x86_Features_Group>;
6403def mamx_tile : Flag<["-"], "mamx-tile">, Group<m_x86_Features_Group>;
6404def mno_amx_tile : Flag<["-"], "mno-amx-tile">, Group<m_x86_Features_Group>;
6405def mamx_transpose : Flag<["-"], "mamx-transpose">, Group<m_x86_Features_Group>;
6406def mno_amx_transpose : Flag<["-"], "mno-amx-transpose">, Group<m_x86_Features_Group>;
6407def mamx_movrs: Flag<["-"], "mamx-movrs">, Group<m_x86_Features_Group>;
6408def mno_amx_movrs: Flag<["-"], "mno-amx-movrs">, Group<m_x86_Features_Group>;
6409def mcmpccxadd : Flag<["-"], "mcmpccxadd">, Group<m_x86_Features_Group>;
6410def mno_cmpccxadd : Flag<["-"], "mno-cmpccxadd">, Group<m_x86_Features_Group>;
6411def msse : Flag<["-"], "msse">, Group<m_x86_Features_Group>;
6412def mno_sse : Flag<["-"], "mno-sse">, Group<m_x86_Features_Group>;
6413def msse2 : Flag<["-"], "msse2">, Group<m_x86_Features_Group>;
6414def mno_sse2 : Flag<["-"], "mno-sse2">, Group<m_x86_Features_Group>;
6415def msse3 : Flag<["-"], "msse3">, Group<m_x86_Features_Group>;
6416def mno_sse3 : Flag<["-"], "mno-sse3">, Group<m_x86_Features_Group>;
6417def mssse3 : Flag<["-"], "mssse3">, Group<m_x86_Features_Group>;
6418def mno_ssse3 : Flag<["-"], "mno-ssse3">, Group<m_x86_Features_Group>;
6419def msse4_1 : Flag<["-"], "msse4.1">, Group<m_x86_Features_Group>;
6420def mno_sse4_1 : Flag<["-"], "mno-sse4.1">, Group<m_x86_Features_Group>;
6421} // let Flags = [TargetSpecific]
6422// TODO: Make -msse4.2 TargetSpecific after
6423// https://github.com/llvm/llvm-project/issues/63270 is fixed.
6424def msse4_2 : Flag<["-"], "msse4.2">, Group<m_x86_Features_Group>;
6425let Flags = [TargetSpecific] in {
6426def mno_sse4_2 : Flag<["-"], "mno-sse4.2">, Group<m_x86_Features_Group>;
6427def msse4 : Flag<["-"], "msse4">, Alias<msse4_2>;
6428// -mno-sse4 turns off sse4.1 which has the effect of turning off everything
6429// later than 4.1. -msse4 turns on 4.2 which has the effect of turning on
6430// everything earlier than 4.2.
6431def mno_sse4 : Flag<["-"], "mno-sse4">, Alias<mno_sse4_1>;
6432def msse4a : Flag<["-"], "msse4a">, Group<m_x86_Features_Group>;
6433def mno_sse4a : Flag<["-"], "mno-sse4a">, Group<m_x86_Features_Group>;
6434def mavx : Flag<["-"], "mavx">, Group<m_x86_Features_Group>;
6435def mno_avx : Flag<["-"], "mno-avx">, Group<m_x86_Features_Group>;
6436def mavx10_1_256 : Flag<["-"], "mavx10.1-256">, Group<m_x86_AVX10_Features_Group>;
6437def mno_avx10_1_256 : Flag<["-"], "mno-avx10.1-256">, Group<m_x86_AVX10_Features_Group>;
6438def mavx10_1_512 : Flag<["-"], "mavx10.1-512">, Group<m_x86_AVX10_Features_Group>;
6439def mno_avx10_1_512 : Flag<["-"], "mno-avx10.1-512">, Group<m_x86_AVX10_Features_Group>;
6440def mavx10_1 : Flag<["-"], "mavx10.1">, Alias<mavx10_1_256>;
6441def mno_avx10_1 : Flag<["-"], "mno-avx10.1">, Alias<mno_avx10_1_256>;
6442def mavx10_2_256 : Flag<["-"], "mavx10.2-256">, Group<m_x86_AVX10_Features_Group>;
6443def mno_avx10_2_256 : Flag<["-"], "mno-avx10.2-256">, Group<m_x86_AVX10_Features_Group>;
6444def mavx10_2_512 : Flag<["-"], "mavx10.2-512">, Group<m_x86_AVX10_Features_Group>;
6445def mno_avx10_2_512 : Flag<["-"], "mno-avx10.2-512">, Group<m_x86_AVX10_Features_Group>;
6446def mavx10_2 : Flag<["-"], "mavx10.2">, Alias<mavx10_2_256>;
6447def mno_avx10_2 : Flag<["-"], "mno-avx10.2">, Alias<mno_avx10_2_256>;
6448def mavx2 : Flag<["-"], "mavx2">, Group<m_x86_Features_Group>;
6449def mno_avx2 : Flag<["-"], "mno-avx2">, Group<m_x86_Features_Group>;
6450def mavx512f : Flag<["-"], "mavx512f">, Group<m_x86_Features_Group>;
6451def mno_avx512f : Flag<["-"], "mno-avx512f">, Group<m_x86_Features_Group>;
6452def mavx512bf16 : Flag<["-"], "mavx512bf16">, Group<m_x86_Features_Group>;
6453def mno_avx512bf16 : Flag<["-"], "mno-avx512bf16">, Group<m_x86_Features_Group>;
6454def mavx512bitalg : Flag<["-"], "mavx512bitalg">, Group<m_x86_Features_Group>;
6455def mno_avx512bitalg : Flag<["-"], "mno-avx512bitalg">, Group<m_x86_Features_Group>;
6456def mavx512bw : Flag<["-"], "mavx512bw">, Group<m_x86_Features_Group>;
6457def mno_avx512bw : Flag<["-"], "mno-avx512bw">, Group<m_x86_Features_Group>;
6458def mavx512cd : Flag<["-"], "mavx512cd">, Group<m_x86_Features_Group>;
6459def mno_avx512cd : Flag<["-"], "mno-avx512cd">, Group<m_x86_Features_Group>;
6460def mavx512dq : Flag<["-"], "mavx512dq">, Group<m_x86_Features_Group>;
6461def mno_avx512dq : Flag<["-"], "mno-avx512dq">, Group<m_x86_Features_Group>;
6462def mavx512fp16 : Flag<["-"], "mavx512fp16">, Group<m_x86_Features_Group>;
6463def mno_avx512fp16 : Flag<["-"], "mno-avx512fp16">, Group<m_x86_Features_Group>;
6464def mavx512ifma : Flag<["-"], "mavx512ifma">, Group<m_x86_Features_Group>;
6465def mno_avx512ifma : Flag<["-"], "mno-avx512ifma">, Group<m_x86_Features_Group>;
6466def mavx512vbmi : Flag<["-"], "mavx512vbmi">, Group<m_x86_Features_Group>;
6467def mno_avx512vbmi : Flag<["-"], "mno-avx512vbmi">, Group<m_x86_Features_Group>;
6468def mavx512vbmi2 : Flag<["-"], "mavx512vbmi2">, Group<m_x86_Features_Group>;
6469def mno_avx512vbmi2 : Flag<["-"], "mno-avx512vbmi2">, Group<m_x86_Features_Group>;
6470def mavx512vl : Flag<["-"], "mavx512vl">, Group<m_x86_Features_Group>;
6471def mno_avx512vl : Flag<["-"], "mno-avx512vl">, Group<m_x86_Features_Group>;
6472def mavx512vnni : Flag<["-"], "mavx512vnni">, Group<m_x86_Features_Group>;
6473def mno_avx512vnni : Flag<["-"], "mno-avx512vnni">, Group<m_x86_Features_Group>;
6474def mavx512vpopcntdq : Flag<["-"], "mavx512vpopcntdq">, Group<m_x86_Features_Group>;
6475def mno_avx512vpopcntdq : Flag<["-"], "mno-avx512vpopcntdq">, Group<m_x86_Features_Group>;
6476def mavx512vp2intersect : Flag<["-"], "mavx512vp2intersect">, Group<m_x86_Features_Group>;
6477def mno_avx512vp2intersect : Flag<["-"], "mno-avx512vp2intersect">, Group<m_x86_Features_Group>;
6478def mavxifma : Flag<["-"], "mavxifma">, Group<m_x86_Features_Group>;
6479def mno_avxifma : Flag<["-"], "mno-avxifma">, Group<m_x86_Features_Group>;
6480def mavxneconvert : Flag<["-"], "mavxneconvert">, Group<m_x86_Features_Group>;
6481def mno_avxneconvert : Flag<["-"], "mno-avxneconvert">, Group<m_x86_Features_Group>;
6482def mavxvnniint16 : Flag<["-"], "mavxvnniint16">, Group<m_x86_Features_Group>;
6483def mno_avxvnniint16 : Flag<["-"], "mno-avxvnniint16">, Group<m_x86_Features_Group>;
6484def mavxvnniint8 : Flag<["-"], "mavxvnniint8">, Group<m_x86_Features_Group>;
6485def mno_avxvnniint8 : Flag<["-"], "mno-avxvnniint8">, Group<m_x86_Features_Group>;
6486def mavxvnni : Flag<["-"], "mavxvnni">, Group<m_x86_Features_Group>;
6487def mno_avxvnni : Flag<["-"], "mno-avxvnni">, Group<m_x86_Features_Group>;
6488def madx : Flag<["-"], "madx">, Group<m_x86_Features_Group>;
6489def mno_adx : Flag<["-"], "mno-adx">, Group<m_x86_Features_Group>;
6490def maes : Flag<["-"], "maes">, Group<m_x86_Features_Group>;
6491def mno_aes : Flag<["-"], "mno-aes">, Group<m_x86_Features_Group>;
6492def mbmi : Flag<["-"], "mbmi">, Group<m_x86_Features_Group>;
6493def mno_bmi : Flag<["-"], "mno-bmi">, Group<m_x86_Features_Group>;
6494def mbmi2 : Flag<["-"], "mbmi2">, Group<m_x86_Features_Group>;
6495def mno_bmi2 : Flag<["-"], "mno-bmi2">, Group<m_x86_Features_Group>;
6496def mcldemote : Flag<["-"], "mcldemote">, Group<m_x86_Features_Group>;
6497def mno_cldemote : Flag<["-"], "mno-cldemote">, Group<m_x86_Features_Group>;
6498def mclflushopt : Flag<["-"], "mclflushopt">, Group<m_x86_Features_Group>;
6499def mno_clflushopt : Flag<["-"], "mno-clflushopt">, Group<m_x86_Features_Group>;
6500def mclwb : Flag<["-"], "mclwb">, Group<m_x86_Features_Group>;
6501def mno_clwb : Flag<["-"], "mno-clwb">, Group<m_x86_Features_Group>;
6502def mwbnoinvd : Flag<["-"], "mwbnoinvd">, Group<m_x86_Features_Group>;
6503def mno_wbnoinvd : Flag<["-"], "mno-wbnoinvd">, Group<m_x86_Features_Group>;
6504def mclzero : Flag<["-"], "mclzero">, Group<m_x86_Features_Group>;
6505def mno_clzero : Flag<["-"], "mno-clzero">, Group<m_x86_Features_Group>;
6506def mcrc32 : Flag<["-"], "mcrc32">, Group<m_x86_Features_Group>;
6507def mno_crc32 : Flag<["-"], "mno-crc32">, Group<m_x86_Features_Group>;
6508def mcx16 : Flag<["-"], "mcx16">, Group<m_x86_Features_Group>;
6509def mno_cx16 : Flag<["-"], "mno-cx16">, Group<m_x86_Features_Group>;
6510def menqcmd : Flag<["-"], "menqcmd">, Group<m_x86_Features_Group>;
6511def mno_enqcmd : Flag<["-"], "mno-enqcmd">, Group<m_x86_Features_Group>;
6512def mevex512 : Flag<["-"], "mevex512">, Group<m_x86_Features_Group>,
6513               Visibility<[ClangOption, CLOption, FlangOption]>;
6514def mno_evex512 : Flag<["-"], "mno-evex512">, Group<m_x86_Features_Group>,
6515                  Visibility<[ClangOption, CLOption, FlangOption]>;
6516def mf16c : Flag<["-"], "mf16c">, Group<m_x86_Features_Group>;
6517def mno_f16c : Flag<["-"], "mno-f16c">, Group<m_x86_Features_Group>;
6518def mfma : Flag<["-"], "mfma">, Group<m_x86_Features_Group>;
6519def mno_fma : Flag<["-"], "mno-fma">, Group<m_x86_Features_Group>;
6520def mfma4 : Flag<["-"], "mfma4">, Group<m_x86_Features_Group>;
6521def mno_fma4 : Flag<["-"], "mno-fma4">, Group<m_x86_Features_Group>;
6522def mfsgsbase : Flag<["-"], "mfsgsbase">, Group<m_x86_Features_Group>;
6523def mno_fsgsbase : Flag<["-"], "mno-fsgsbase">, Group<m_x86_Features_Group>;
6524def mfxsr : Flag<["-"], "mfxsr">, Group<m_x86_Features_Group>;
6525def mno_fxsr : Flag<["-"], "mno-fxsr">, Group<m_x86_Features_Group>;
6526def minvpcid : Flag<["-"], "minvpcid">, Group<m_x86_Features_Group>;
6527def mno_invpcid : Flag<["-"], "mno-invpcid">, Group<m_x86_Features_Group>;
6528def mgfni : Flag<["-"], "mgfni">, Group<m_x86_Features_Group>;
6529def mno_gfni : Flag<["-"], "mno-gfni">, Group<m_x86_Features_Group>;
6530def mhreset : Flag<["-"], "mhreset">, Group<m_x86_Features_Group>;
6531def mno_hreset : Flag<["-"], "mno-hreset">, Group<m_x86_Features_Group>;
6532def mkl : Flag<["-"], "mkl">, Group<m_x86_Features_Group>;
6533def mno_kl : Flag<["-"], "mno-kl">, Group<m_x86_Features_Group>;
6534def mwidekl : Flag<["-"], "mwidekl">, Group<m_x86_Features_Group>;
6535def mno_widekl : Flag<["-"], "mno-widekl">, Group<m_x86_Features_Group>;
6536def mlwp : Flag<["-"], "mlwp">, Group<m_x86_Features_Group>;
6537def mno_lwp : Flag<["-"], "mno-lwp">, Group<m_x86_Features_Group>;
6538def mlzcnt : Flag<["-"], "mlzcnt">, Group<m_x86_Features_Group>;
6539def mno_lzcnt : Flag<["-"], "mno-lzcnt">, Group<m_x86_Features_Group>;
6540def mmovbe : Flag<["-"], "mmovbe">, Group<m_x86_Features_Group>;
6541def mno_movbe : Flag<["-"], "mno-movbe">, Group<m_x86_Features_Group>;
6542def mmovdiri : Flag<["-"], "mmovdiri">, Group<m_x86_Features_Group>;
6543def mno_movdiri : Flag<["-"], "mno-movdiri">, Group<m_x86_Features_Group>;
6544def mmovdir64b : Flag<["-"], "mmovdir64b">, Group<m_x86_Features_Group>;
6545def mno_movdir64b : Flag<["-"], "mno-movdir64b">, Group<m_x86_Features_Group>;
6546def mmovrs : Flag<["-"], "mmovrs">, Group<m_x86_Features_Group>;
6547def mno_movrs : Flag<["-"], "mno-movrs">, Group<m_x86_Features_Group>;
6548def mmwaitx : Flag<["-"], "mmwaitx">, Group<m_x86_Features_Group>;
6549def mno_mwaitx : Flag<["-"], "mno-mwaitx">, Group<m_x86_Features_Group>;
6550def mpku : Flag<["-"], "mpku">, Group<m_x86_Features_Group>;
6551def mno_pku : Flag<["-"], "mno-pku">, Group<m_x86_Features_Group>;
6552def mpclmul : Flag<["-"], "mpclmul">, Group<m_x86_Features_Group>;
6553def mno_pclmul : Flag<["-"], "mno-pclmul">, Group<m_x86_Features_Group>;
6554def mpconfig : Flag<["-"], "mpconfig">, Group<m_x86_Features_Group>;
6555def mno_pconfig : Flag<["-"], "mno-pconfig">, Group<m_x86_Features_Group>;
6556def mpopcnt : Flag<["-"], "mpopcnt">, Group<m_x86_Features_Group>;
6557def mno_popcnt : Flag<["-"], "mno-popcnt">, Group<m_x86_Features_Group>;
6558def mprefetchi : Flag<["-"], "mprefetchi">, Group<m_x86_Features_Group>;
6559def mno_prefetchi : Flag<["-"], "mno-prefetchi">, Group<m_x86_Features_Group>;
6560def mprfchw : Flag<["-"], "mprfchw">, Group<m_x86_Features_Group>;
6561def mno_prfchw : Flag<["-"], "mno-prfchw">, Group<m_x86_Features_Group>;
6562def mptwrite : Flag<["-"], "mptwrite">, Group<m_x86_Features_Group>;
6563def mno_ptwrite : Flag<["-"], "mno-ptwrite">, Group<m_x86_Features_Group>;
6564def mraoint : Flag<["-"], "mraoint">, Group<m_x86_Features_Group>;
6565def mno_raoint : Flag<["-"], "mno-raoint">, Group<m_x86_Features_Group>;
6566def mrdpid : Flag<["-"], "mrdpid">, Group<m_x86_Features_Group>;
6567def mno_rdpid : Flag<["-"], "mno-rdpid">, Group<m_x86_Features_Group>;
6568def mrdpru : Flag<["-"], "mrdpru">, Group<m_x86_Features_Group>;
6569def mno_rdpru : Flag<["-"], "mno-rdpru">, Group<m_x86_Features_Group>;
6570def mrdrnd : Flag<["-"], "mrdrnd">, Group<m_x86_Features_Group>;
6571def mno_rdrnd : Flag<["-"], "mno-rdrnd">, Group<m_x86_Features_Group>;
6572def mrtm : Flag<["-"], "mrtm">, Group<m_x86_Features_Group>;
6573def mno_rtm : Flag<["-"], "mno-rtm">, Group<m_x86_Features_Group>;
6574def mrdseed : Flag<["-"], "mrdseed">, Group<m_x86_Features_Group>;
6575def mno_rdseed : Flag<["-"], "mno-rdseed">, Group<m_x86_Features_Group>;
6576def msahf : Flag<["-"], "msahf">, Group<m_x86_Features_Group>;
6577def mno_sahf : Flag<["-"], "mno-sahf">, Group<m_x86_Features_Group>;
6578def mserialize : Flag<["-"], "mserialize">, Group<m_x86_Features_Group>;
6579def mno_serialize : Flag<["-"], "mno-serialize">, Group<m_x86_Features_Group>;
6580def msgx : Flag<["-"], "msgx">, Group<m_x86_Features_Group>;
6581def mno_sgx : Flag<["-"], "mno-sgx">, Group<m_x86_Features_Group>;
6582def msha : Flag<["-"], "msha">, Group<m_x86_Features_Group>;
6583def mno_sha : Flag<["-"], "mno-sha">, Group<m_x86_Features_Group>;
6584def msha512 : Flag<["-"], "msha512">, Group<m_x86_Features_Group>;
6585def mno_sha512 : Flag<["-"], "mno-sha512">, Group<m_x86_Features_Group>;
6586def msm3 : Flag<["-"], "msm3">, Group<m_x86_Features_Group>;
6587def mno_sm3 : Flag<["-"], "mno-sm3">, Group<m_x86_Features_Group>;
6588def msm4 : Flag<["-"], "msm4">, Group<m_x86_Features_Group>;
6589def mno_sm4 : Flag<["-"], "mno-sm4">, Group<m_x86_Features_Group>;
6590def mtbm : Flag<["-"], "mtbm">, Group<m_x86_Features_Group>;
6591def mno_tbm : Flag<["-"], "mno-tbm">, Group<m_x86_Features_Group>;
6592def mtsxldtrk : Flag<["-"], "mtsxldtrk">, Group<m_x86_Features_Group>;
6593def mno_tsxldtrk : Flag<["-"], "mno-tsxldtrk">, Group<m_x86_Features_Group>;
6594def muintr : Flag<["-"], "muintr">, Group<m_x86_Features_Group>;
6595def mno_uintr : Flag<["-"], "mno-uintr">, Group<m_x86_Features_Group>;
6596def musermsr : Flag<["-"], "musermsr">, Group<m_x86_Features_Group>;
6597def mno_usermsr : Flag<["-"], "mno-usermsr">, Group<m_x86_Features_Group>;
6598def mvaes : Flag<["-"], "mvaes">, Group<m_x86_Features_Group>;
6599def mno_vaes : Flag<["-"], "mno-vaes">, Group<m_x86_Features_Group>;
6600def mvpclmulqdq : Flag<["-"], "mvpclmulqdq">, Group<m_x86_Features_Group>;
6601def mno_vpclmulqdq : Flag<["-"], "mno-vpclmulqdq">, Group<m_x86_Features_Group>;
6602def mwaitpkg : Flag<["-"], "mwaitpkg">, Group<m_x86_Features_Group>;
6603def mno_waitpkg : Flag<["-"], "mno-waitpkg">, Group<m_x86_Features_Group>;
6604def mxop : Flag<["-"], "mxop">, Group<m_x86_Features_Group>;
6605def mno_xop : Flag<["-"], "mno-xop">, Group<m_x86_Features_Group>;
6606def mxsave : Flag<["-"], "mxsave">, Group<m_x86_Features_Group>;
6607def mno_xsave : Flag<["-"], "mno-xsave">, Group<m_x86_Features_Group>;
6608def mxsavec : Flag<["-"], "mxsavec">, Group<m_x86_Features_Group>;
6609def mno_xsavec : Flag<["-"], "mno-xsavec">, Group<m_x86_Features_Group>;
6610def mxsaveopt : Flag<["-"], "mxsaveopt">, Group<m_x86_Features_Group>;
6611def mno_xsaveopt : Flag<["-"], "mno-xsaveopt">, Group<m_x86_Features_Group>;
6612def mxsaves : Flag<["-"], "mxsaves">, Group<m_x86_Features_Group>;
6613def mno_xsaves : Flag<["-"], "mno-xsaves">, Group<m_x86_Features_Group>;
6614def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Features_Group>;
6615def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
6616def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
6617def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
6618def mvzeroupper : Flag<["-"], "mvzeroupper">, Group<m_x86_Features_Group>;
6619def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group<m_x86_Features_Group>;
6620def mno_gather : Flag<["-"], "mno-gather">, Group<m_Group>,
6621                 HelpText<"Disable generation of gather instructions in auto-vectorization(x86 only)">;
6622def mno_scatter : Flag<["-"], "mno-scatter">, Group<m_Group>,
6623                  HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;
6624def mapx_features_EQ : CommaJoined<["-"], "mapx-features=">, Group<m_x86_Features_Group>,
6625    HelpText<"Enable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">,  Visibility<[ClangOption, CLOption, FlangOption]>;
6626def mno_apx_features_EQ : CommaJoined<["-"], "mno-apx-features=">, Group<m_x86_Features_Group>,
6627    HelpText<"Disable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">, Visibility<[ClangOption, CLOption, FlangOption]>;
6628def mapxf : Flag<["-"], "mapxf">, Alias<mapx_features_EQ>, AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf","zu"]>;
6629def mno_apxf : Flag<["-"], "mno-apxf">, Alias<mno_apx_features_EQ>, AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf","zu"]>;
6630def mapx_inline_asm_use_gpr32 : Flag<["-"], "mapx-inline-asm-use-gpr32">, Group<m_Group>,
6631                                HelpText<"Enable use of GPR32 in inline assembly for APX">;
6632} // let Flags = [TargetSpecific]
6633
6634// VE feature flags
6635let Flags = [TargetSpecific] in {
6636def mvevpu : Flag<["-"], "mvevpu">, Group<m_ve_Features_Group>,
6637  HelpText<"Emit VPU instructions for VE">;
6638def mno_vevpu : Flag<["-"], "mno-vevpu">, Group<m_ve_Features_Group>;
6639} // let Flags = [TargetSpecific]
6640
6641// Unsupported X86 feature flags (triggers a warning)
6642def m3dnow : Flag<["-"], "m3dnow">;
6643def mno_3dnow : Flag<["-"], "mno-3dnow">;
6644def m3dnowa : Flag<["-"], "m3dnowa">;
6645def mno_3dnowa : Flag<["-"], "mno-3dnowa">;
6646
6647// These are legacy user-facing driver-level option spellings. They are always
6648// aliases for options that are spelled using the more common Unix / GNU flag
6649// style of double-dash and equals-joined flags.
6650def target_legacy_spelling : Separate<["-"], "target">,
6651                             Alias<target>,
6652                             Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>;
6653
6654// Special internal option to handle -Xlinker --no-demangle.
6655def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">,
6656    Flags<[Unsupported, NoArgumentUnused]>;
6657
6658// Special internal option to allow forwarding arbitrary arguments to linker.
6659def Zlinker_input : Separate<["-"], "Zlinker-input">,
6660    Flags<[Unsupported, NoArgumentUnused]>;
6661
6662// Reserved library options.
6663def Z_reserved_lib_stdcxx : Flag<["-"], "Z-reserved-lib-stdc++">,
6664    Flags<[LinkerInput, NoArgumentUnused, Unsupported]>,
6665    Group<reserved_lib_Group>;
6666def Z_reserved_lib_cckext : Flag<["-"], "Z-reserved-lib-cckext">,
6667    Flags<[LinkerInput, NoArgumentUnused, Unsupported]>,
6668    Group<reserved_lib_Group>;
6669
6670// Ignored options
6671multiclass BooleanFFlag<string name> {
6672  def f#NAME : Flag<["-"], "f"#name>;
6673  def fno_#NAME : Flag<["-"], "fno-"#name>;
6674}
6675
6676multiclass FlangIgnoredDiagOpt<string name> {
6677  def unsupported_warning_w#NAME : Flag<["-", "--"], "W"#name>,
6678    Visibility<[FlangOption]>, Group<flang_ignored_w_Group>;
6679}
6680
6681defm : BooleanFFlag<"keep-inline-functions">, Group<clang_ignored_gcc_optimization_f_Group>;
6682
6683def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group<f_Group>;
6684
6685// The default value matches BinutilsVersion in MCAsmInfo.h.
6686def fbinutils_version_EQ : Joined<["-"], "fbinutils-version=">,
6687  MetaVarName<"<major.minor>">, Group<f_Group>,
6688  Visibility<[ClangOption, CC1Option]>,
6689  HelpText<"Produced object files can use all ELF features supported by this "
6690  "binutils version and newer. If -fno-integrated-as is specified, the "
6691  "generated assembly will consider GNU as support. 'none' means that all ELF "
6692  "features can be used, regardless of binutils support. Defaults to 2.26.">;
6693def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>,
6694  Flags<[LinkOption]>, Visibility<[ClangOption, FlangOption, CLOption]>;
6695def ld_path_EQ : Joined<["--"], "ld-path=">, Group<Link_Group>;
6696def fuse_lipo_EQ : Joined<["-"], "fuse-lipo=">, Group<f_clang_Group>, Flags<[LinkOption]>;
6697
6698defm align_labels : BooleanFFlag<"align-labels">, Group<clang_ignored_gcc_optimization_f_Group>;
6699def falign_labels_EQ : Joined<["-"], "falign-labels=">, Group<clang_ignored_gcc_optimization_f_Group>;
6700defm align_loops : BooleanFFlag<"align-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
6701defm align_jumps : BooleanFFlag<"align-jumps">, Group<clang_ignored_gcc_optimization_f_Group>;
6702def falign_jumps_EQ : Joined<["-"], "falign-jumps=">, Group<clang_ignored_gcc_optimization_f_Group>;
6703
6704// FIXME: This option should be supported and wired up to our diognostics, but
6705// ignore it for now to avoid breaking builds that use it.
6706def fdiagnostics_show_location_EQ : Joined<["-"], "fdiagnostics-show-location=">, Group<clang_ignored_f_Group>;
6707
6708defm check_new : BoolOption<"f", "check-new",
6709  LangOpts<"CheckNew">, DefaultFalse,
6710  PosFlag<SetTrue, [], [ClangOption], "Do not assume C++ operator new may not return NULL">,
6711  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
6712
6713defm caller_saves : BooleanFFlag<"caller-saves">, Group<clang_ignored_gcc_optimization_f_Group>;
6714defm reorder_blocks : BooleanFFlag<"reorder-blocks">, Group<clang_ignored_gcc_optimization_f_Group>;
6715defm branch_count_reg : BooleanFFlag<"branch-count-reg">, Group<clang_ignored_gcc_optimization_f_Group>;
6716defm default_inline : BooleanFFlag<"default-inline">, Group<clang_ignored_gcc_optimization_f_Group>;
6717defm float_store : BooleanFFlag<"float-store">, Group<clang_ignored_gcc_optimization_f_Group>;
6718defm friend_injection : BooleanFFlag<"friend-injection">, Group<clang_ignored_f_Group>;
6719defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group<clang_ignored_f_Group>;
6720defm gcse : BooleanFFlag<"gcse">, Group<clang_ignored_gcc_optimization_f_Group>;
6721defm gcse_after_reload: BooleanFFlag<"gcse-after-reload">, Group<clang_ignored_gcc_optimization_f_Group>;
6722defm gcse_las: BooleanFFlag<"gcse-las">, Group<clang_ignored_gcc_optimization_f_Group>;
6723defm gcse_sm: BooleanFFlag<"gcse-sm">, Group<clang_ignored_gcc_optimization_f_Group>;
6724defm gnu : BooleanFFlag<"gnu">, Group<clang_ignored_f_Group>;
6725defm implicit_templates : BooleanFFlag<"implicit-templates">, Group<clang_ignored_f_Group>;
6726defm implement_inlines : BooleanFFlag<"implement-inlines">, Group<clang_ignored_f_Group>;
6727defm merge_constants : BooleanFFlag<"merge-constants">, Group<clang_ignored_gcc_optimization_f_Group>;
6728defm modulo_sched : BooleanFFlag<"modulo-sched">, Group<clang_ignored_gcc_optimization_f_Group>;
6729defm modulo_sched_allow_regmoves : BooleanFFlag<"modulo-sched-allow-regmoves">,
6730    Group<clang_ignored_gcc_optimization_f_Group>;
6731defm inline_functions_called_once : BooleanFFlag<"inline-functions-called-once">,
6732    Group<clang_ignored_gcc_optimization_f_Group>;
6733def finline_limit_EQ : Joined<["-"], "finline-limit=">, Group<clang_ignored_gcc_optimization_f_Group>;
6734defm finline_limit : BooleanFFlag<"inline-limit">, Group<clang_ignored_gcc_optimization_f_Group>;
6735defm inline_small_functions : BooleanFFlag<"inline-small-functions">,
6736    Group<clang_ignored_gcc_optimization_f_Group>;
6737defm ipa_cp : BooleanFFlag<"ipa-cp">,
6738    Group<clang_ignored_gcc_optimization_f_Group>;
6739defm ivopts : BooleanFFlag<"ivopts">, Group<clang_ignored_gcc_optimization_f_Group>;
6740defm semantic_interposition : BoolFOption<"semantic-interposition",
6741  LangOpts<"SemanticInterposition">, DefaultFalse,
6742  PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
6743  NegFlag<SetFalse>>,
6744  DocBrief<[{Enable semantic interposition. Semantic interposition allows for the
6745interposition of a symbol by another at runtime, thus preventing a range of
6746inter-procedural optimisation.}]>;
6747defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">, Group<clang_ignored_f_Group>;
6748defm peel_loops : BooleanFFlag<"peel-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
6749defm permissive : BooleanFFlag<"permissive">, Group<clang_ignored_f_Group>;
6750defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">, Group<clang_ignored_gcc_optimization_f_Group>;
6751defm printf : BooleanFFlag<"printf">, Group<clang_ignored_f_Group>;
6752defm profile : BooleanFFlag<"profile">, Group<clang_ignored_f_Group>;
6753defm profile_correction : BooleanFFlag<"profile-correction">, Group<clang_ignored_gcc_optimization_f_Group>;
6754defm profile_generate_sampling : BooleanFFlag<"profile-generate-sampling">, Group<clang_ignored_f_Group>;
6755defm profile_reusedist : BooleanFFlag<"profile-reusedist">, Group<clang_ignored_f_Group>;
6756defm profile_values : BooleanFFlag<"profile-values">, Group<clang_ignored_gcc_optimization_f_Group>;
6757defm regs_graph : BooleanFFlag<"regs-graph">, Group<clang_ignored_f_Group>;
6758defm rename_registers : BooleanFFlag<"rename-registers">, Group<clang_ignored_gcc_optimization_f_Group>;
6759defm ripa : BooleanFFlag<"ripa">, Group<clang_ignored_f_Group>;
6760defm schedule_insns : BooleanFFlag<"schedule-insns">, Group<clang_ignored_gcc_optimization_f_Group>;
6761defm schedule_insns2 : BooleanFFlag<"schedule-insns2">, Group<clang_ignored_gcc_optimization_f_Group>;
6762defm see : BooleanFFlag<"see">, Group<clang_ignored_f_Group>;
6763defm signaling_nans : BooleanFFlag<"signaling-nans">, Group<clang_ignored_gcc_optimization_f_Group>;
6764defm single_precision_constant : BooleanFFlag<"single-precision-constant">,
6765    Group<clang_ignored_gcc_optimization_f_Group>;
6766defm spec_constr_count : BooleanFFlag<"spec-constr-count">, Group<clang_ignored_f_Group>;
6767defm stack_check : BooleanFFlag<"stack-check">, Group<clang_ignored_f_Group>;
6768defm strength_reduce :
6769    BooleanFFlag<"strength-reduce">, Group<clang_ignored_gcc_optimization_f_Group>;
6770defm tls_model : BooleanFFlag<"tls-model">, Group<clang_ignored_f_Group>;
6771defm tracer : BooleanFFlag<"tracer">, Group<clang_ignored_gcc_optimization_f_Group>;
6772defm tree_dce : BooleanFFlag<"tree-dce">, Group<clang_ignored_gcc_optimization_f_Group>;
6773defm tree_salias : BooleanFFlag<"tree-salias">, Group<clang_ignored_f_Group>;
6774defm tree_ter : BooleanFFlag<"tree-ter">, Group<clang_ignored_gcc_optimization_f_Group>;
6775defm tree_vectorizer_verbose : BooleanFFlag<"tree-vectorizer-verbose">, Group<clang_ignored_f_Group>;
6776defm tree_vrp : BooleanFFlag<"tree-vrp">, Group<clang_ignored_gcc_optimization_f_Group>;
6777defm : BooleanFFlag<"unit-at-a-time">, Group<clang_ignored_gcc_optimization_f_Group>;
6778defm unroll_all_loops : BooleanFFlag<"unroll-all-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
6779defm unsafe_loop_optimizations : BooleanFFlag<"unsafe-loop-optimizations">,
6780    Group<clang_ignored_gcc_optimization_f_Group>;
6781defm unswitch_loops : BooleanFFlag<"unswitch-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
6782defm use_linker_plugin : BooleanFFlag<"use-linker-plugin">, Group<clang_ignored_gcc_optimization_f_Group>;
6783defm vect_cost_model : BooleanFFlag<"vect-cost-model">, Group<clang_ignored_gcc_optimization_f_Group>;
6784defm variable_expansion_in_unroller : BooleanFFlag<"variable-expansion-in-unroller">,
6785    Group<clang_ignored_gcc_optimization_f_Group>;
6786defm web : BooleanFFlag<"web">, Group<clang_ignored_gcc_optimization_f_Group>;
6787defm whole_program : BooleanFFlag<"whole-program">, Group<clang_ignored_gcc_optimization_f_Group>;
6788defm devirtualize : BooleanFFlag<"devirtualize">, Group<clang_ignored_gcc_optimization_f_Group>;
6789defm devirtualize_speculatively : BooleanFFlag<"devirtualize-speculatively">,
6790    Group<clang_ignored_gcc_optimization_f_Group>;
6791
6792// Generic gfortran options.
6793def A_DASH : Joined<["-"], "A-">, Group<gfortran_Group>;
6794def static_libgfortran : Flag<["-"], "static-libgfortran">, Group<gfortran_Group>;
6795
6796// "f" options with values for gfortran.
6797def fblas_matmul_limit_EQ : Joined<["-"], "fblas-matmul-limit=">, Group<gfortran_Group>;
6798def fcheck_EQ : Joined<["-"], "fcheck=">, Group<gfortran_Group>;
6799def fcoarray_EQ : Joined<["-"], "fcoarray=">, Group<gfortran_Group>;
6800def ffpe_trap_EQ : Joined<["-"], "ffpe-trap=">, Group<gfortran_Group>;
6801def ffree_line_length_VALUE : Joined<["-"], "ffree-line-length-">, Group<gfortran_Group>;
6802def finit_character_EQ : Joined<["-"], "finit-character=">, Group<gfortran_Group>;
6803def finit_integer_EQ : Joined<["-"], "finit-integer=">, Group<gfortran_Group>;
6804def finit_logical_EQ : Joined<["-"], "finit-logical=">, Group<gfortran_Group>;
6805def finit_real_EQ : Joined<["-"], "finit-real=">, Group<gfortran_Group>;
6806def fmax_array_constructor_EQ : Joined<["-"], "fmax-array-constructor=">, Group<gfortran_Group>;
6807def fmax_errors_EQ : Joined<["-"], "fmax-errors=">, Group<gfortran_Group>;
6808def fmax_stack_var_size_EQ : Joined<["-"], "fmax-stack-var-size=">, Group<gfortran_Group>;
6809def fmax_subrecord_length_EQ : Joined<["-"], "fmax-subrecord-length=">, Group<gfortran_Group>;
6810def frecord_marker_EQ : Joined<["-"], "frecord-marker=">, Group<gfortran_Group>;
6811
6812// "f" flags for gfortran.
6813defm aggressive_function_elimination : BooleanFFlag<"aggressive-function-elimination">, Group<gfortran_Group>;
6814defm align_commons : BooleanFFlag<"align-commons">, Group<gfortran_Group>;
6815defm all_intrinsics : BooleanFFlag<"all-intrinsics">, Group<gfortran_Group>;
6816def fautomatic : Flag<["-"], "fautomatic">; // -fno-automatic is significant
6817defm backtrace : BooleanFFlag<"backtrace">, Group<gfortran_Group>;
6818defm bounds_check : BooleanFFlag<"bounds-check">, Group<gfortran_Group>;
6819defm check_array_temporaries : BooleanFFlag<"check-array-temporaries">, Group<gfortran_Group>;
6820defm cray_pointer : BooleanFFlag<"cray-pointer">, Group<gfortran_Group>;
6821defm d_lines_as_code : BooleanFFlag<"d-lines-as-code">, Group<gfortran_Group>;
6822defm d_lines_as_comments : BooleanFFlag<"d-lines-as-comments">, Group<gfortran_Group>;
6823defm dollar_ok : BooleanFFlag<"dollar-ok">, Group<gfortran_Group>;
6824defm dump_fortran_optimized : BooleanFFlag<"dump-fortran-optimized">, Group<gfortran_Group>;
6825defm dump_fortran_original : BooleanFFlag<"dump-fortran-original">, Group<gfortran_Group>;
6826defm dump_parse_tree : BooleanFFlag<"dump-parse-tree">, Group<gfortran_Group>;
6827defm external_blas : BooleanFFlag<"external-blas">, Group<gfortran_Group>;
6828defm f2c : BooleanFFlag<"f2c">, Group<gfortran_Group>;
6829defm frontend_optimize : BooleanFFlag<"frontend-optimize">, Group<gfortran_Group>;
6830defm init_local_zero : BooleanFFlag<"init-local-zero">, Group<gfortran_Group>;
6831defm integer_4_integer_8 : BooleanFFlag<"integer-4-integer-8">, Group<gfortran_Group>;
6832defm max_identifier_length : BooleanFFlag<"max-identifier-length">, Group<gfortran_Group>;
6833defm module_private : BooleanFFlag<"module-private">, Group<gfortran_Group>;
6834defm pack_derived : BooleanFFlag<"pack-derived">, Group<gfortran_Group>;
6835//defm protect_parens : BooleanFFlag<"protect-parens">, Group<gfortran_Group>;
6836defm range_check : BooleanFFlag<"range-check">, Group<gfortran_Group>;
6837defm real_4_real_10 : BooleanFFlag<"real-4-real-10">, Group<gfortran_Group>;
6838defm real_4_real_16 : BooleanFFlag<"real-4-real-16">, Group<gfortran_Group>;
6839defm real_4_real_8 : BooleanFFlag<"real-4-real-8">, Group<gfortran_Group>;
6840defm real_8_real_10 : BooleanFFlag<"real-8-real-10">, Group<gfortran_Group>;
6841defm real_8_real_16 : BooleanFFlag<"real-8-real-16">, Group<gfortran_Group>;
6842defm real_8_real_4 : BooleanFFlag<"real-8-real-4">, Group<gfortran_Group>;
6843defm recursive : BooleanFFlag<"recursive">, Group<gfortran_Group>;
6844defm repack_arrays : BooleanFFlag<"repack-arrays">, Group<gfortran_Group>;
6845defm second_underscore : BooleanFFlag<"second-underscore">, Group<gfortran_Group>;
6846defm sign_zero : BooleanFFlag<"sign-zero">, Group<gfortran_Group>;
6847defm whole_file : BooleanFFlag<"whole-file">, Group<gfortran_Group>;
6848
6849// -W <arg> options unsupported by the flang compiler
6850// If any of these options are passed into flang's compiler driver,
6851// a warning will be raised and the argument will be claimed
6852defm : FlangIgnoredDiagOpt<"extra">;
6853defm : FlangIgnoredDiagOpt<"aliasing">;
6854defm : FlangIgnoredDiagOpt<"ampersand">;
6855defm : FlangIgnoredDiagOpt<"array-bounds">;
6856defm : FlangIgnoredDiagOpt<"c-binding-type">;
6857defm : FlangIgnoredDiagOpt<"character-truncation">;
6858defm : FlangIgnoredDiagOpt<"conversion">;
6859defm : FlangIgnoredDiagOpt<"do-subscript">;
6860defm : FlangIgnoredDiagOpt<"function-elimination">;
6861defm : FlangIgnoredDiagOpt<"implicit-interface">;
6862defm : FlangIgnoredDiagOpt<"implicit-procedure">;
6863defm : FlangIgnoredDiagOpt<"intrinsic-shadow">;
6864defm : FlangIgnoredDiagOpt<"use-without-only">;
6865defm : FlangIgnoredDiagOpt<"intrinsics-std">;
6866defm : FlangIgnoredDiagOpt<"line-truncation">;
6867defm : FlangIgnoredDiagOpt<"no-align-commons">;
6868defm : FlangIgnoredDiagOpt<"no-overwrite-recursive">;
6869defm : FlangIgnoredDiagOpt<"no-tabs">;
6870defm : FlangIgnoredDiagOpt<"real-q-constant">;
6871defm : FlangIgnoredDiagOpt<"surprising">;
6872defm : FlangIgnoredDiagOpt<"underflow">;
6873defm : FlangIgnoredDiagOpt<"unused-parameter">;
6874defm : FlangIgnoredDiagOpt<"realloc-lhs">;
6875defm : FlangIgnoredDiagOpt<"realloc-lhs-all">;
6876defm : FlangIgnoredDiagOpt<"frontend-loop-interchange">;
6877defm : FlangIgnoredDiagOpt<"target-lifetime">;
6878
6879// C++ SYCL options
6880let Group = sycl_Group in {
6881def fsycl : Flag<["-"], "fsycl">,
6882  HelpText<"Enable SYCL C++ extensions">;
6883def fno_sycl : Flag<["-"], "fno-sycl">,
6884  HelpText<"Disable SYCL C++ extensions">;
6885def fsycl_device_only : Flag<["-"], "fsycl-device-only">,
6886  Alias<offload_device_only>, HelpText<"Compile SYCL code for device only">;
6887def fsycl_host_only : Flag<["-"], "fsycl-host-only">,
6888  Alias<offload_host_only>, HelpText<"Compile SYCL code for host only. Has no "
6889  "effect on non-SYCL compilations">;
6890def sycl_link : Flag<["--"], "sycl-link">, Flags<[HelpHidden]>,
6891  HelpText<"Perform link through clang-sycl-linker via the target "
6892  "offloading toolchain.">;
6893} // let Group = sycl_Group
6894
6895// OS-specific options
6896let Flags = [TargetSpecific] in {
6897defm android_pad_segment : BooleanFFlag<"android-pad-segment">, Group<f_Group>;
6898} // let Flags = [TargetSpecific]
6899
6900//===----------------------------------------------------------------------===//
6901// FLangOption + NoXarchOption
6902//===----------------------------------------------------------------------===//
6903
6904def flang_experimental_hlfir : Flag<["-"], "flang-experimental-hlfir">,
6905  Flags<[HelpHidden]>, Visibility<[FlangOption, FC1Option]>,
6906  HelpText<"Use HLFIR lowering (experimental)">;
6907
6908def flang_deprecated_no_hlfir : Flag<["-"], "flang-deprecated-no-hlfir">,
6909  Flags<[HelpHidden]>, Visibility<[FlangOption, FC1Option]>,
6910  HelpText<"Do not use HLFIR lowering (deprecated)">;
6911
6912//===----------------------------------------------------------------------===//
6913// FLangOption + CoreOption + NoXarchOption
6914//===----------------------------------------------------------------------===//
6915
6916def Xflang : Separate<["-"], "Xflang">,
6917  HelpText<"Pass <arg> to the flang compiler">, MetaVarName<"<arg>">,
6918  Flags<[NoXarchOption]>, Visibility<[FlangOption, CLOption]>,
6919  Group<CompileOnly_Group>;
6920
6921//===----------------------------------------------------------------------===//
6922// FlangOption and FC1 Options
6923//===----------------------------------------------------------------------===//
6924
6925let Visibility = [FC1Option, FlangOption] in {
6926
6927def cpp : Flag<["-"], "cpp">, Group<f_Group>,
6928  HelpText<"Enable predefined and command line preprocessor macros">;
6929def nocpp : Flag<["-"], "nocpp">, Group<f_Group>,
6930  HelpText<"Disable predefined and command line preprocessor macros">;
6931def module_dir : JoinedOrSeparate<["-"], "module-dir">, MetaVarName<"<dir>">,
6932  HelpText<"Put MODULE files in <dir>">,
6933  DocBrief<[{This option specifies where to put .mod files for compiled modules.
6934It is also added to the list of directories to be searched by an USE statement.
6935The default is the current directory.}]>;
6936
6937def ffixed_form : Flag<["-"], "ffixed-form">, Group<f_Group>,
6938  HelpText<"Process source files in fixed form">;
6939def ffree_form : Flag<["-"], "ffree-form">, Group<f_Group>,
6940  HelpText<"Process source files in free form">;
6941def ffixed_line_length_EQ : Joined<["-"], "ffixed-line-length=">, Group<f_Group>,
6942  HelpText<"Use <value> as character line width in fixed mode">,
6943  DocBrief<[{Set column after which characters are ignored in typical fixed-form lines in the source
6944file}]>;
6945def ffixed_line_length_VALUE : Joined<["-"], "ffixed-line-length-">, Group<f_Group>, Alias<ffixed_line_length_EQ>;
6946def fconvert_EQ : Joined<["-"], "fconvert=">, Group<f_Group>,
6947  HelpText<"Set endian conversion of data for unformatted files">;
6948def fdefault_double_8 : Flag<["-"],"fdefault-double-8">, Group<f_Group>,
6949  HelpText<"Set the default double precision kind to an 8 byte wide type">;
6950def fdefault_integer_8 : Flag<["-"],"fdefault-integer-8">, Group<f_Group>,
6951  HelpText<"Set the default integer and logical kind to an 8 byte wide type">;
6952def fdefault_real_8 : Flag<["-"],"fdefault-real-8">, Group<f_Group>,
6953  HelpText<"Set the default real kind to an 8 byte wide type">;
6954def fdisable_real_3 : Flag<["-"],"fdisable-real-3">, Group<f_Group>,
6955   HelpText<"Disable real(KIND=3) from TargetCharacteristics">, Flags<[HelpHidden]>;
6956def fdisable_real_10 : Flag<["-"],"fdisable-real-10">, Group<f_Group>,
6957  HelpText<"Disable real(KIND=10) from TargetCharacteristics">, Flags<[HelpHidden]>;
6958def fdisable_integer_2 : Flag<["-"],"fdisable-integer-2">, Group<f_Group>,
6959  HelpText<"Disable integer(KIND=2) from TargetCharacteristics">, Flags<[HelpHidden]>;
6960def fdisable_integer_16 : Flag<["-"],"fdisable-integer-16">, Group<f_Group>,
6961  HelpText<"Disable integer(KIND=16) from TargetCharacteristics">, Flags<[HelpHidden]>;
6962def flarge_sizes : Flag<["-"],"flarge-sizes">, Group<f_Group>,
6963  HelpText<"Use INTEGER(KIND=8) for the result type in size-related intrinsics">;
6964
6965def falternative_parameter_statement : Flag<["-"], "falternative-parameter-statement">, Group<f_Group>,
6966  HelpText<"Enable the old style PARAMETER statement">;
6967def fintrinsic_modules_path : Separate<["-"], "fintrinsic-modules-path">,  Group<f_Group>, MetaVarName<"<dir>">,
6968  HelpText<"Specify where to find the compiled intrinsic modules">,
6969  DocBrief<[{This option specifies the location of pre-compiled intrinsic modules,
6970  if they are not in the default location expected by the compiler.}]>;
6971
6972defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string introduces an escape character">;
6973defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">;
6974defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">;
6975defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">;
6976defm underscoring : OptInFC1FFlag<"underscoring", "Appends one trailing underscore to external names">;
6977defm ppc_native_vec_elem_order: BoolOptionWithoutMarshalling<"f", "ppc-native-vector-element-order",
6978  PosFlag<SetTrue, [], [ClangOption], "Specifies PowerPC native vector element order (default)">,
6979  NegFlag<SetFalse, [], [ClangOption], "Specifies PowerPC non-native vector element order">>;
6980defm unsigned : OptInFC1FFlag<"unsigned", "Enables UNSIGNED type">;
6981
6982def fno_automatic : Flag<["-"], "fno-automatic">, Group<f_Group>,
6983  HelpText<"Implies the SAVE attribute for non-automatic local objects in subprograms unless RECURSIVE">;
6984
6985defm save_main_program : BoolOptionWithoutMarshalling<"f", "save-main-program",
6986  PosFlag<SetTrue, [], [],
6987    "Place all main program variables in static memory (otherwise scalars may be placed on the stack)">,
6988  NegFlag<SetFalse, [], [],
6989    "Allow placing main program variables on the stack (default)">>;
6990
6991defm stack_arrays : BoolOptionWithoutMarshalling<"f", "stack-arrays",
6992  PosFlag<SetTrue, [], [ClangOption], "Attempt to allocate array temporaries on the stack, no matter their size">,
6993  NegFlag<SetFalse, [], [ClangOption], "Allocate array temporaries on the heap (default)">>;
6994defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stride",
6995  PosFlag<SetTrue, [], [ClangOption], "Create unit-strided versions of loops">,
6996   NegFlag<SetFalse, [], [ClangOption], "Do not create unit-strided loops (default)">>;
6997
6998def fhermetic_module_files : Flag<["-"], "fhermetic-module-files">, Group<f_Group>,
6999  HelpText<"Emit hermetic module files (no nested USE association)">;
7000} // let Visibility = [FC1Option, FlangOption]
7001
7002def J : JoinedOrSeparate<["-"], "J">,
7003  Flags<[RenderJoined]>, Visibility<[FlangOption, FC1Option]>,
7004  Group<gfortran_Group>,
7005  Alias<module_dir>;
7006
7007//===----------------------------------------------------------------------===//
7008// FC1 Options
7009//===----------------------------------------------------------------------===//
7010
7011let Visibility = [FC1Option] in {
7012
7013def fget_definition : MultiArg<["-"], "fget-definition", 3>,
7014  HelpText<"Get the symbol definition from <line> <start-column> <end-column>">,
7015  Group<Action_Group>;
7016def test_io : Flag<["-"], "test-io">, Group<Action_Group>,
7017  HelpText<"Run the InputOuputTest action. Use for development and testing only.">;
7018def fdebug_unparse_no_sema : Flag<["-"], "fdebug-unparse-no-sema">, Group<Action_Group>,
7019  HelpText<"Unparse and stop (skips the semantic checks)">,
7020  DocBrief<[{Only run the parser, then unparse the parse-tree and output the
7021generated Fortran source file. Semantic checks are disabled.}]>;
7022def fdebug_unparse : Flag<["-"], "fdebug-unparse">, Group<Action_Group>,
7023  HelpText<"Unparse and stop.">,
7024  DocBrief<[{Run the parser and the semantic checks. Then unparse the
7025parse-tree and output the generated Fortran source file.}]>;
7026def fdebug_unparse_with_symbols : Flag<["-"], "fdebug-unparse-with-symbols">, Group<Action_Group>,
7027  HelpText<"Unparse with symbols and stop.">;
7028def fdebug_unparse_with_modules : Flag<["-"], "fdebug-unparse-with-modules">, Group<Action_Group>,
7029  HelpText<"Unparse with dependent modules and stop.">;
7030def fdebug_dump_symbols : Flag<["-"], "fdebug-dump-symbols">, Group<Action_Group>,
7031  HelpText<"Dump symbols after the semantic analysis">;
7032def fdebug_dump_parse_tree : Flag<["-"], "fdebug-dump-parse-tree">, Group<Action_Group>,
7033  HelpText<"Dump the parse tree">,
7034  DocBrief<[{Run the Parser and the semantic checks, and then output the
7035parse tree.}]>;
7036def fdebug_dump_pft : Flag<["-"], "fdebug-dump-pft">, Group<Action_Group>,
7037  HelpText<"Dump the pre-fir parse tree">;
7038def fdebug_dump_parse_tree_no_sema : Flag<["-"], "fdebug-dump-parse-tree-no-sema">, Group<Action_Group>,
7039  HelpText<"Dump the parse tree (skips the semantic checks)">,
7040  DocBrief<[{Run the Parser and then output the parse tree. Semantic
7041checks are disabled.}]>;
7042def fdebug_dump_all : Flag<["-"], "fdebug-dump-all">, Group<Action_Group>,
7043  HelpText<"Dump symbols and the parse tree after the semantic checks">;
7044def fdebug_dump_provenance : Flag<["-"], "fdebug-dump-provenance">, Group<Action_Group>,
7045  HelpText<"Dump provenance">;
7046def fdebug_dump_parsing_log : Flag<["-"], "fdebug-dump-parsing-log">, Group<Action_Group>,
7047  HelpText<"Run instrumented parse and dump the parsing log">;
7048def fdebug_measure_parse_tree : Flag<["-"], "fdebug-measure-parse-tree">, Group<Action_Group>,
7049  HelpText<"Measure the parse tree">;
7050def fdebug_pre_fir_tree : Flag<["-"], "fdebug-pre-fir-tree">, Group<Action_Group>,
7051  HelpText<"Dump the pre-FIR tree">;
7052def fdebug_module_writer : Flag<["-"],"fdebug-module-writer">,
7053  HelpText<"Enable debug messages while writing module files">;
7054def fget_symbols_sources : Flag<["-"], "fget-symbols-sources">, Group<Action_Group>,
7055  HelpText<"Dump symbols and their source code locations">;
7056
7057def module_suffix : Separate<["-"], "module-suffix">,  Group<f_Group>, MetaVarName<"<suffix>">,
7058  HelpText<"Use <suffix> as the suffix for module files (the default value is `.mod`)">;
7059def fno_reformat : Flag<["-"], "fno-reformat">, Group<Preprocessor_Group>,
7060  HelpText<"Dump the cooked character stream in -E mode">;
7061def fpreprocess_include_lines : Flag<["-"], "fpreprocess-include-lines">, Group<Preprocessor_Group>,
7062  HelpText<"Treat INCLUDE lines like #include directives in -E mode">;
7063defm analyzed_objects_for_unparse : OptOutFC1FFlag<"analyzed-objects-for-unparse", "", "Do not use the analyzed objects when unparsing">;
7064
7065def emit_fir : Flag<["-"], "emit-fir">, Group<Action_Group>,
7066  HelpText<"Build the parse tree, then lower it to FIR">;
7067def emit_mlir : Flag<["-"], "emit-mlir">, Alias<emit_fir>;
7068
7069def emit_hlfir : Flag<["-"], "emit-hlfir">, Group<Action_Group>,
7070  HelpText<"Build the parse tree, then lower it to HLFIR">;
7071
7072} // let Visibility = [FC1Option]
7073
7074//===----------------------------------------------------------------------===//
7075// Target Options (cc1 + cc1as)
7076//===----------------------------------------------------------------------===//
7077
7078let Visibility = [CC1Option, CC1AsOption] in {
7079
7080def target_abi : Separate<["-"], "target-abi">,
7081  HelpText<"Target a particular ABI type">,
7082  MarshallingInfoString<TargetOpts<"ABI">>;
7083def target_sdk_version_EQ : Joined<["-"], "target-sdk-version=">,
7084  HelpText<"The version of target SDK used for compilation">;
7085def darwin_target_variant_sdk_version_EQ : Joined<["-"],
7086  "darwin-target-variant-sdk-version=">,
7087  HelpText<"The version of darwin target variant SDK used for compilation">;
7088
7089} // let Visibility = [CC1Option, CC1AsOption]
7090
7091let Visibility = [ClangOption, CC1Option, CC1AsOption] in {
7092
7093def darwin_target_variant_triple : Separate<["-"], "darwin-target-variant-triple">,
7094  HelpText<"Specify the darwin target variant triple">,
7095  MarshallingInfoString<TargetOpts<"DarwinTargetVariantTriple">>,
7096  Normalizer<"normalizeTriple">;
7097
7098} // let Visibility = [ClangOption, CC1Option, CC1AsOption]
7099
7100//===----------------------------------------------------------------------===//
7101// Target Options (cc1 + cc1as + fc1)
7102//===----------------------------------------------------------------------===//
7103
7104let Visibility = [CC1Option, CC1AsOption, FC1Option] in {
7105
7106def tune_cpu : Separate<["-"], "tune-cpu">,
7107  HelpText<"Tune for a specific cpu type">,
7108  MarshallingInfoString<TargetOpts<"TuneCPU">>;
7109def target_cpu : Separate<["-"], "target-cpu">,
7110  HelpText<"Target a specific cpu type">,
7111  MarshallingInfoString<TargetOpts<"CPU">>;
7112def target_feature : Separate<["-"], "target-feature">,
7113  HelpText<"Target specific attributes">,
7114  MarshallingInfoStringVector<TargetOpts<"FeaturesAsWritten">>;
7115def triple : Separate<["-"], "triple">,
7116  HelpText<"Specify target triple (e.g. i686-apple-darwin9)">,
7117  MarshallingInfoString<TargetOpts<"Triple">, "llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple())">,
7118  AlwaysEmit, Normalizer<"normalizeTriple">;
7119
7120} // let Visibility = [CC1Option, CC1AsOption, FC1Option]
7121
7122//===----------------------------------------------------------------------===//
7123// Target Options (other)
7124//===----------------------------------------------------------------------===//
7125
7126let Visibility = [CC1Option] in {
7127
7128def target_linker_version : Separate<["-"], "target-linker-version">,
7129  HelpText<"Target linker version">,
7130  MarshallingInfoString<TargetOpts<"LinkerVersion">>;
7131def triple_EQ : Joined<["-"], "triple=">, Alias<triple>;
7132def mfpmath : Separate<["-"], "mfpmath">,
7133  HelpText<"Which unit to use for fp math">,
7134  MarshallingInfoString<TargetOpts<"FPMath">>;
7135
7136defm padding_on_unsigned_fixed_point : BoolOption<"f", "padding-on-unsigned-fixed-point",
7137  LangOpts<"PaddingOnUnsignedFixedPoint">, DefaultFalse,
7138  PosFlag<SetTrue, [], [ClangOption], "Force each unsigned fixed point type to have an extra bit of padding to align their scales with those of signed fixed point types">,
7139  NegFlag<SetFalse>>,
7140  ShouldParseIf<ffixed_point.KeyPath>;
7141
7142} // let Visibility = [CC1Option]
7143
7144//===----------------------------------------------------------------------===//
7145// Analyzer Options
7146//===----------------------------------------------------------------------===//
7147
7148let Visibility = [CC1Option] in {
7149
7150def analysis_UnoptimizedCFG : Flag<["-"], "unoptimized-cfg">,
7151  HelpText<"Generate unoptimized CFGs for all analyses">,
7152  MarshallingInfoFlag<AnalyzerOpts<"UnoptimizedCFG">>;
7153def analysis_CFGAddImplicitDtors : Flag<["-"], "cfg-add-implicit-dtors">,
7154  HelpText<"Add C++ implicit destructors to CFGs for all analyses">;
7155
7156def analyzer_constraints : Separate<["-"], "analyzer-constraints">,
7157  HelpText<"Source Code Analysis - Symbolic Constraint Engines">;
7158def analyzer_constraints_EQ : Joined<["-"], "analyzer-constraints=">,
7159  Alias<analyzer_constraints>;
7160
7161def analyzer_output : Separate<["-"], "analyzer-output">,
7162  HelpText<"Source Code Analysis - Output Options">;
7163def analyzer_output_EQ : Joined<["-"], "analyzer-output=">,
7164  Alias<analyzer_output>;
7165
7166def analyzer_purge : Separate<["-"], "analyzer-purge">,
7167  HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">;
7168def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias<analyzer_purge>;
7169
7170def analyzer_opt_analyze_headers : Flag<["-"], "analyzer-opt-analyze-headers">,
7171  HelpText<"Force the static analyzer to analyze functions defined in header files">,
7172  MarshallingInfoFlag<AnalyzerOpts<"AnalyzeAll">>;
7173def analyzer_display_progress : Flag<["-"], "analyzer-display-progress">,
7174  HelpText<"Emit verbose output about the analyzer's progress">,
7175  MarshallingInfoFlag<AnalyzerOpts<"AnalyzerDisplayProgress">>;
7176def analyzer_note_analysis_entry_points : Flag<["-"], "analyzer-note-analysis-entry-points">,
7177  HelpText<"Add a note for each bug report to denote their analysis entry points">,
7178  MarshallingInfoFlag<AnalyzerOpts<"AnalyzerNoteAnalysisEntryPoints">>;
7179def analyze_function : Separate<["-"], "analyze-function">,
7180  HelpText<"Run analysis on specific function (for C++ include parameters in name)">,
7181  MarshallingInfoString<AnalyzerOpts<"AnalyzeSpecificFunction">>;
7182def analyze_function_EQ : Joined<["-"], "analyze-function=">, Alias<analyze_function>;
7183def trim_egraph : Flag<["-"], "trim-egraph">,
7184  HelpText<"Only show error-related paths in the analysis graph">,
7185  MarshallingInfoFlag<AnalyzerOpts<"TrimGraph">>;
7186def analyzer_viz_egraph_graphviz : Flag<["-"], "analyzer-viz-egraph-graphviz">,
7187  HelpText<"Display exploded graph using GraphViz">,
7188  MarshallingInfoFlag<AnalyzerOpts<"visualizeExplodedGraphWithGraphViz">>;
7189def analyzer_dump_egraph : Separate<["-"], "analyzer-dump-egraph">,
7190  HelpText<"Dump exploded graph to the specified file">,
7191  MarshallingInfoString<AnalyzerOpts<"DumpExplodedGraphTo">>;
7192def analyzer_dump_egraph_EQ : Joined<["-"], "analyzer-dump-egraph=">, Alias<analyzer_dump_egraph>;
7193
7194def analyzer_inline_max_stack_depth : Separate<["-"], "analyzer-inline-max-stack-depth">,
7195  HelpText<"Bound on stack depth while inlining (4 by default)">,
7196  // Cap the stack depth at 4 calls (5 stack frames, base + 4 calls).
7197  MarshallingInfoInt<AnalyzerOpts<"InlineMaxStackDepth">, "5">;
7198def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">,
7199  Alias<analyzer_inline_max_stack_depth>;
7200
7201def analyzer_inlining_mode : Separate<["-"], "analyzer-inlining-mode">,
7202  HelpText<"Specify the function selection heuristic used during inlining">;
7203def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>;
7204
7205def analyzer_disable_retry_exhausted : Flag<["-"], "analyzer-disable-retry-exhausted">,
7206  HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">,
7207  MarshallingInfoFlag<AnalyzerOpts<"NoRetryExhausted">>;
7208
7209def analyzer_max_loop : Separate<["-"], "analyzer-max-loop">,
7210  HelpText<"The maximum number of times the analyzer will go through a loop">,
7211  MarshallingInfoInt<AnalyzerOpts<"maxBlockVisitOnPath">, "4">;
7212def analyzer_stats : Flag<["-"], "analyzer-stats">,
7213  HelpText<"Print internal analyzer statistics.">,
7214  MarshallingInfoFlag<AnalyzerOpts<"PrintStats">>;
7215
7216def analyzer_checker : Separate<["-"], "analyzer-checker">,
7217  HelpText<"Choose analyzer checkers to enable">,
7218  ValuesCode<[{
7219    static constexpr const char VALUES_CODE [] =
7220    #define GET_CHECKERS
7221    #define CHECKER(FULLNAME, CLASS, HT, DOC_URI, IS_HIDDEN)  FULLNAME ","
7222    #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
7223    #undef GET_CHECKERS
7224    #define GET_PACKAGES
7225    #define PACKAGE(FULLNAME)  FULLNAME ","
7226    #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
7227    #undef GET_PACKAGES
7228    ;
7229  }]>;
7230def analyzer_checker_EQ : Joined<["-"], "analyzer-checker=">,
7231  Alias<analyzer_checker>;
7232
7233def analyzer_disable_checker : Separate<["-"], "analyzer-disable-checker">,
7234  HelpText<"Choose analyzer checkers to disable">;
7235def analyzer_disable_checker_EQ : Joined<["-"], "analyzer-disable-checker=">,
7236  Alias<analyzer_disable_checker>;
7237
7238def analyzer_disable_all_checks : Flag<["-"], "analyzer-disable-all-checks">,
7239  HelpText<"Disable all static analyzer checks">,
7240  MarshallingInfoFlag<AnalyzerOpts<"DisableAllCheckers">>;
7241
7242def analyzer_checker_help : Flag<["-"], "analyzer-checker-help">,
7243  HelpText<"Display the list of analyzer checkers that are available">,
7244  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelp">>;
7245
7246def analyzer_checker_help_alpha : Flag<["-"], "analyzer-checker-help-alpha">,
7247  HelpText<"Display the list of in development analyzer checkers. These "
7248           "are NOT considered safe, they are unstable and will emit incorrect "
7249           "reports. Enable ONLY FOR DEVELOPMENT purposes">,
7250  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelpAlpha">>;
7251
7252def analyzer_checker_help_developer : Flag<["-"], "analyzer-checker-help-developer">,
7253  HelpText<"Display the list of developer-only checkers such as modeling "
7254           "and debug checkers">,
7255  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelpDeveloper">>;
7256
7257def analyzer_config_help : Flag<["-"], "analyzer-config-help">,
7258  HelpText<"Display the list of -analyzer-config options. These are meant for "
7259           "development purposes only!">,
7260  MarshallingInfoFlag<AnalyzerOpts<"ShowConfigOptionsList">>;
7261
7262def analyzer_list_enabled_checkers : Flag<["-"], "analyzer-list-enabled-checkers">,
7263  HelpText<"Display the list of enabled analyzer checkers">,
7264  MarshallingInfoFlag<AnalyzerOpts<"ShowEnabledCheckerList">>;
7265
7266def analyzer_config : Separate<["-"], "analyzer-config">,
7267  HelpText<"Choose analyzer options to enable">;
7268
7269def analyzer_checker_option_help : Flag<["-"], "analyzer-checker-option-help">,
7270  HelpText<"Display the list of checker and package options">,
7271  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionList">>;
7272
7273def analyzer_checker_option_help_alpha : Flag<["-"], "analyzer-checker-option-help-alpha">,
7274  HelpText<"Display the list of in development checker and package options. "
7275           "These are NOT considered safe, they are unstable and will emit "
7276           "incorrect reports. Enable ONLY FOR DEVELOPMENT purposes">,
7277  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionAlphaList">>;
7278
7279def analyzer_checker_option_help_developer : Flag<["-"], "analyzer-checker-option-help-developer">,
7280  HelpText<"Display the list of checker and package options meant for "
7281           "development purposes only">,
7282  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionDeveloperList">>;
7283
7284def analyzer_config_compatibility_mode : Separate<["-"], "analyzer-config-compatibility-mode">,
7285  HelpText<"Don't emit errors on invalid analyzer-config inputs">,
7286  Values<"true,false">, NormalizedValues<[[{false}], [{true}]]>,
7287  MarshallingInfoEnum<AnalyzerOpts<"ShouldEmitErrorsOnInvalidConfigValue">, [{true}]>;
7288
7289def analyzer_config_compatibility_mode_EQ : Joined<["-"], "analyzer-config-compatibility-mode=">,
7290  Alias<analyzer_config_compatibility_mode>;
7291
7292def analyzer_werror : Flag<["-"], "analyzer-werror">,
7293  HelpText<"Emit analyzer results as errors rather than warnings">,
7294  MarshallingInfoFlag<AnalyzerOpts<"AnalyzerWerror">>;
7295
7296} // let Visibility = [CC1Option]
7297
7298//===----------------------------------------------------------------------===//
7299// Migrator Options
7300//===----------------------------------------------------------------------===//
7301
7302def migrator_no_nsalloc_error : Flag<["-"], "no-ns-alloc-error">,
7303  HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">,
7304  Visibility<[CC1Option]>,
7305  MarshallingInfoFlag<MigratorOpts<"NoNSAllocReallocError">>;
7306
7307def migrator_no_finalize_removal : Flag<["-"], "no-finalize-removal">,
7308  HelpText<"Do not remove finalize method in gc mode">,
7309  Visibility<[CC1Option]>,
7310  MarshallingInfoFlag<MigratorOpts<"NoFinalizeRemoval">>;
7311
7312//===----------------------------------------------------------------------===//
7313// CodeGen Options
7314//===----------------------------------------------------------------------===//
7315
7316let Visibility = [CC1Option, CC1AsOption, FC1Option] in {
7317
7318def mrelocation_model : Separate<["-"], "mrelocation-model">,
7319  HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">,
7320  NormalizedValuesScope<"llvm::Reloc">,
7321  NormalizedValues<["Static", "PIC_", "ROPI", "RWPI", "ROPI_RWPI", "DynamicNoPIC"]>,
7322  MarshallingInfoEnum<CodeGenOpts<"RelocationModel">, "PIC_">;
7323def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
7324def record_command_line : Separate<["-"], "record-command-line">,
7325  HelpText<"The string to embed in the .LLVM.command.line section.">,
7326  MarshallingInfoString<CodeGenOpts<"RecordCommandLine">>;
7327
7328} // let Visibility = [CC1Option, CC1AsOption, FC1Option]
7329
7330let Visibility = [CC1Option, CC1AsOption] in {
7331
7332def debug_info_macro : Flag<["-"], "debug-info-macro">,
7333  HelpText<"Emit macro debug information">,
7334  MarshallingInfoFlag<CodeGenOpts<"MacroDebugInfo">>;
7335def default_function_attr : Separate<["-"], "default-function-attr">,
7336  HelpText<"Apply given attribute to all functions">,
7337  MarshallingInfoStringVector<CodeGenOpts<"DefaultFunctionAttrs">>;
7338def dwarf_version_EQ : Joined<["-"], "dwarf-version=">,
7339  MarshallingInfoInt<CodeGenOpts<"DwarfVersion">>;
7340def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">,
7341  Values<"gdb,lldb,sce,dbx">,
7342  NormalizedValuesScope<"llvm::DebuggerKind">, NormalizedValues<["GDB", "LLDB", "SCE", "DBX"]>,
7343  MarshallingInfoEnum<CodeGenOpts<"DebuggerTuning">, "Default">;
7344def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
7345  HelpText<"The string to embed in the Dwarf debug flags record.">,
7346  MarshallingInfoString<CodeGenOpts<"DwarfDebugFlags">>;
7347def compress_debug_sections_EQ : Joined<["-", "--"], "compress-debug-sections=">,
7348    HelpText<"DWARF debug sections compression type">, Values<"none,zlib,zstd">,
7349    NormalizedValuesScope<"llvm::DebugCompressionType">, NormalizedValues<["None", "Zlib", "Zstd"]>,
7350    MarshallingInfoEnum<CodeGenOpts<"CompressDebugSections">, "None">;
7351def compress_debug_sections : Flag<["-", "--"], "compress-debug-sections">,
7352  Alias<compress_debug_sections_EQ>, AliasArgs<["zlib"]>;
7353def mno_exec_stack : Flag<["-"], "mnoexecstack">,
7354  HelpText<"Mark the file as not needing an executable stack">,
7355  MarshallingInfoFlag<CodeGenOpts<"NoExecStack">>;
7356def massembler_no_warn : Flag<["-"], "massembler-no-warn">,
7357  HelpText<"Make assembler not emit warnings">,
7358  MarshallingInfoFlag<CodeGenOpts<"NoWarn">>;
7359def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
7360  HelpText<"Make assembler warnings fatal">,
7361  MarshallingInfoFlag<CodeGenOpts<"FatalWarnings">>;
7362def crel : Flag<["--"], "crel">,
7363  HelpText<"Enable CREL relocation format (ELF only)">,
7364  MarshallingInfoFlag<CodeGenOpts<"Crel">>;
7365def mmapsyms_implicit : Flag<["-"], "mmapsyms=implicit">,
7366  HelpText<"Allow mapping symbol at section beginning to be implicit, "
7367    "lowering number of mapping symbols at the expense of some "
7368    "portability. Recommended for projects that can build all their "
7369    "object files using this option">,
7370  MarshallingInfoFlag<CodeGenOpts<"ImplicitMapSyms">>;
7371def mrelax_relocations_no : Flag<["-"], "mrelax-relocations=no">,
7372    HelpText<"Disable x86 relax relocations">,
7373    MarshallingInfoNegativeFlag<CodeGenOpts<"X86RelaxRelocations">>;
7374def msave_temp_labels : Flag<["-"], "msave-temp-labels">,
7375  HelpText<"Save temporary labels in the symbol table. "
7376           "Note this may change .s semantics and shouldn't generally be used "
7377           "on compiler-generated code.">,
7378  MarshallingInfoFlag<CodeGenOpts<"SaveTempLabels">>;
7379def mno_type_check : Flag<["-"], "mno-type-check">,
7380  HelpText<"Don't perform type checking of the assembly code (wasm only)">,
7381  MarshallingInfoFlag<CodeGenOpts<"NoTypeCheck">>;
7382def fno_math_builtin : Flag<["-"], "fno-math-builtin">,
7383  HelpText<"Disable implicit builtin knowledge of math functions">,
7384  MarshallingInfoFlag<LangOpts<"NoMathBuiltin">>;
7385def fno_use_ctor_homing: Flag<["-"], "fno-use-ctor-homing">,
7386    HelpText<"Don't use constructor homing for debug info">;
7387def fuse_ctor_homing: Flag<["-"], "fuse-ctor-homing">,
7388    HelpText<"Use constructor homing if we are using limited debug info already">;
7389def as_secure_log_file : Separate<["-"], "as-secure-log-file">,
7390  HelpText<"Emit .secure_log_unique directives to this filename.">,
7391  MarshallingInfoString<CodeGenOpts<"AsSecureLogFile">>;
7392def output_asm_variant : Joined<["--"], "output-asm-variant=">,
7393  HelpText<"Select the asm variant (integer) to use for output (3: unspecified)">,
7394  MarshallingInfoInt<CodeGenOpts<"OutputAsmVariant">, "3">;
7395
7396} // let Visibility = [CC1Option, CC1AsOption]
7397
7398let Visibility = [CC1Option, FC1Option] in {
7399def mlink_builtin_bitcode : Separate<["-"], "mlink-builtin-bitcode">,
7400  HelpText<"Link and internalize needed symbols from the given bitcode file "
7401           "before performing optimizations.">;
7402} // let Visibility = [CC1Option, FC1Option]
7403
7404let Visibility = [CC1Option] in {
7405
7406def llvm_verify_each : Flag<["-"], "llvm-verify-each">,
7407  HelpText<"Run the LLVM verifier after every LLVM pass">,
7408  MarshallingInfoFlag<CodeGenOpts<"VerifyEach">>;
7409def disable_llvm_verifier : Flag<["-"], "disable-llvm-verifier">,
7410  HelpText<"Don't run the LLVM IR verifier pass">,
7411  MarshallingInfoNegativeFlag<CodeGenOpts<"VerifyModule">>;
7412def disable_llvm_passes : Flag<["-"], "disable-llvm-passes">,
7413  HelpText<"Use together with -emit-llvm to get pristine LLVM IR from the "
7414           "frontend by not running any LLVM passes at all">,
7415  MarshallingInfoFlag<CodeGenOpts<"DisableLLVMPasses">>;
7416def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">,
7417  Alias<disable_llvm_passes>;
7418def disable_lifetimemarkers : Flag<["-"], "disable-lifetime-markers">,
7419  HelpText<"Disable lifetime-markers emission even when optimizations are "
7420           "enabled">,
7421  MarshallingInfoFlag<CodeGenOpts<"DisableLifetimeMarkers">>;
7422def disable_O0_optnone : Flag<["-"], "disable-O0-optnone">,
7423  HelpText<"Disable adding the optnone attribute to functions at O0">,
7424  MarshallingInfoFlag<CodeGenOpts<"DisableO0ImplyOptNone">>;
7425def disable_red_zone : Flag<["-"], "disable-red-zone">,
7426  HelpText<"Do not emit code that uses the red zone.">,
7427  MarshallingInfoFlag<CodeGenOpts<"DisableRedZone">>;
7428def dwarf_ext_refs : Flag<["-"], "dwarf-ext-refs">,
7429  HelpText<"Generate debug info with external references to clang modules"
7430           " or precompiled headers">,
7431  MarshallingInfoFlag<CodeGenOpts<"DebugTypeExtRefs">>;
7432def dwarf_explicit_import : Flag<["-"], "dwarf-explicit-import">,
7433  HelpText<"Generate explicit import from anonymous namespace to containing"
7434           " scope">,
7435  MarshallingInfoFlag<CodeGenOpts<"DebugExplicitImport">>;
7436def debug_forward_template_params : Flag<["-"], "debug-forward-template-params">,
7437  HelpText<"Emit complete descriptions of template parameters in forward"
7438           " declarations">,
7439  MarshallingInfoFlag<CodeGenOpts<"DebugFwdTemplateParams">>;
7440def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">,
7441  HelpText<"Emit an error if a C++ static local initializer would need a guard variable">,
7442  MarshallingInfoFlag<CodeGenOpts<"ForbidGuardVariables">>;
7443def no_implicit_float : Flag<["-"], "no-implicit-float">,
7444  HelpText<"Don't generate implicit floating point or vector instructions">,
7445  MarshallingInfoFlag<CodeGenOpts<"NoImplicitFloat">>;
7446def fdump_vtable_layouts : Flag<["-"], "fdump-vtable-layouts">,
7447  HelpText<"Dump the layouts of all vtables that will be emitted in a translation unit">,
7448  MarshallingInfoFlag<LangOpts<"DumpVTableLayouts">>;
7449def fmerge_functions : Flag<["-"], "fmerge-functions">,
7450  HelpText<"Permit merging of identical functions when optimizing.">,
7451  MarshallingInfoFlag<CodeGenOpts<"MergeFunctions">>;
7452def : Joined<["-"], "coverage-data-file=">,
7453  MarshallingInfoString<CodeGenOpts<"CoverageDataFile">>;
7454def : Joined<["-"], "coverage-notes-file=">,
7455  MarshallingInfoString<CodeGenOpts<"CoverageNotesFile">>;
7456def coverage_version_EQ : Joined<["-"], "coverage-version=">,
7457  HelpText<"Four-byte version string for gcov files.">;
7458def dump_coverage_mapping : Flag<["-"], "dump-coverage-mapping">,
7459  HelpText<"Dump the coverage mapping records, for testing">,
7460  MarshallingInfoFlag<CodeGenOpts<"DumpCoverageMapping">>;
7461def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">,
7462  HelpText<"Use register sized accesses to bit-fields, when possible.">,
7463  MarshallingInfoFlag<CodeGenOpts<"UseRegisterSizedBitfieldAccess">>;
7464def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
7465  HelpText<"Turn off Type Based Alias Analysis">,
7466  MarshallingInfoFlag<CodeGenOpts<"RelaxedAliasing">>;
7467defm pointer_tbaa: BoolOption<"", "pointer-tbaa", CodeGenOpts<"PointerTBAA">,
7468DefaultTrue,
7469  PosFlag<SetTrue, [], [ClangOption], "Enable">,
7470  NegFlag<SetFalse, [], [ClangOption], "Disable">,
7471  BothFlags<[], [ClangOption], " that single precision floating-point divide and sqrt used in ">>
7472  ;
7473def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">,
7474  HelpText<"Turn off struct-path aware Type Based Alias Analysis">,
7475  MarshallingInfoNegativeFlag<CodeGenOpts<"StructPathTBAA">>;
7476def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">,
7477  HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">;
7478def mdebug_pass : Separate<["-"], "mdebug-pass">,
7479  HelpText<"Enable additional debug output">,
7480  MarshallingInfoString<CodeGenOpts<"DebugPass">>;
7481def mabi_EQ_ieeelongdouble : Flag<["-"], "mabi=ieeelongdouble">,
7482  HelpText<"Use IEEE 754 quadruple-precision for long double">,
7483  MarshallingInfoFlag<LangOpts<"PPCIEEELongDouble">>;
7484def mabi_EQ_vec_extabi : Flag<["-"], "mabi=vec-extabi">,
7485  Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
7486  HelpText<"Enable the extended Altivec ABI on AIX. Use volatile and nonvolatile vector registers">,
7487  MarshallingInfoFlag<LangOpts<"EnableAIXExtendedAltivecABI">>;
7488def mfloat_abi : Separate<["-"], "mfloat-abi">,
7489  HelpText<"The float ABI to use">,
7490  MarshallingInfoString<CodeGenOpts<"FloatABI">>;
7491def mtp : Separate<["-"], "mtp">,
7492  HelpText<"Mode for reading thread pointer">;
7493def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
7494  HelpText<"Limit float precision to the given value">,
7495  MarshallingInfoString<CodeGenOpts<"LimitFloatPrecision">>;
7496def mregparm : Separate<["-"], "mregparm">,
7497  HelpText<"Limit the number of registers available for integer arguments">,
7498  MarshallingInfoInt<CodeGenOpts<"NumRegisterParameters">>;
7499def msmall_data_limit : Separate<["-"], "msmall-data-limit">,
7500  HelpText<"Put global and static data smaller than the limit into a special section">,
7501  MarshallingInfoInt<CodeGenOpts<"SmallDataLimit">>;
7502def funwind_tables_EQ : Joined<["-"], "funwind-tables=">,
7503  HelpText<"Generate unwinding tables for all functions">,
7504  MarshallingInfoInt<CodeGenOpts<"UnwindTables">>;
7505defm constructor_aliases : BoolMOption<"constructor-aliases",
7506  CodeGenOpts<"CXXCtorDtorAliases">, DefaultFalse,
7507  PosFlag<SetTrue, [], [ClangOption], "Enable">,
7508  NegFlag<SetFalse, [], [ClangOption], "Disable">,
7509  BothFlags<[], [ClangOption, CC1Option],
7510          " emitting complete constructors and destructors as aliases when possible">>;
7511def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">,
7512  HelpText<"Link the given bitcode file before performing optimizations.">;
7513defm link_builtin_bitcode_postopt: BoolMOption<"link-builtin-bitcode-postopt",
7514  CodeGenOpts<"LinkBitcodePostopt">, DefaultFalse,
7515  PosFlag<SetTrue, [], [ClangOption], "Link builtin bitcodes after the "
7516  "optimization pipeline">,
7517  NegFlag<SetFalse, [], [ClangOption]>>;
7518def vectorize_loops : Flag<["-"], "vectorize-loops">,
7519  HelpText<"Run the Loop vectorization passes">,
7520  MarshallingInfoFlag<CodeGenOpts<"VectorizeLoop">>;
7521def vectorize_slp : Flag<["-"], "vectorize-slp">,
7522  HelpText<"Run the SLP vectorization passes">,
7523  MarshallingInfoFlag<CodeGenOpts<"VectorizeSLP">>;
7524def linker_option : Joined<["--"], "linker-option=">,
7525  HelpText<"Add linker option">,
7526  MarshallingInfoStringVector<CodeGenOpts<"LinkerOptions">>;
7527def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
7528                              HelpText<"Sanitizer coverage type">,
7529                              MarshallingInfoInt<CodeGenOpts<"SanitizeCoverageType">>;
7530def fsanitize_coverage_indirect_calls
7531    : Flag<["-"], "fsanitize-coverage-indirect-calls">,
7532      HelpText<"Enable sanitizer coverage for indirect calls">,
7533      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageIndirectCalls">>;
7534def fsanitize_coverage_trace_bb
7535    : Flag<["-"], "fsanitize-coverage-trace-bb">,
7536      HelpText<"Enable basic block tracing in sanitizer coverage">,
7537      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceBB">>;
7538def fsanitize_coverage_trace_cmp
7539    : Flag<["-"], "fsanitize-coverage-trace-cmp">,
7540      HelpText<"Enable cmp instruction tracing in sanitizer coverage">,
7541      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceCmp">>;
7542def fsanitize_coverage_trace_div
7543    : Flag<["-"], "fsanitize-coverage-trace-div">,
7544      HelpText<"Enable div instruction tracing in sanitizer coverage">,
7545      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceDiv">>;
7546def fsanitize_coverage_trace_gep
7547    : Flag<["-"], "fsanitize-coverage-trace-gep">,
7548      HelpText<"Enable gep instruction tracing in sanitizer coverage">,
7549      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceGep">>;
7550def fsanitize_coverage_8bit_counters
7551    : Flag<["-"], "fsanitize-coverage-8bit-counters">,
7552      HelpText<"Enable frequency counters in sanitizer coverage">,
7553      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverage8bitCounters">>;
7554def fsanitize_coverage_inline_8bit_counters
7555    : Flag<["-"], "fsanitize-coverage-inline-8bit-counters">,
7556      HelpText<"Enable inline 8-bit counters in sanitizer coverage">,
7557      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInline8bitCounters">>;
7558def fsanitize_coverage_inline_bool_flag
7559    : Flag<["-"], "fsanitize-coverage-inline-bool-flag">,
7560      HelpText<"Enable inline bool flag in sanitizer coverage">,
7561      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInlineBoolFlag">>;
7562def fsanitize_coverage_pc_table
7563    : Flag<["-"], "fsanitize-coverage-pc-table">,
7564      HelpText<"Create a table of coverage-instrumented PCs">,
7565      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoveragePCTable">>;
7566def fsanitize_coverage_control_flow
7567    : Flag<["-"], "fsanitize-coverage-control-flow">,
7568      HelpText<"Collect control flow of function">,
7569      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageControlFlow">>;
7570def fsanitize_coverage_trace_pc
7571    : Flag<["-"], "fsanitize-coverage-trace-pc">,
7572      HelpText<"Enable PC tracing in sanitizer coverage">,
7573      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePC">>;
7574def fsanitize_coverage_trace_pc_guard
7575    : Flag<["-"], "fsanitize-coverage-trace-pc-guard">,
7576      HelpText<"Enable PC tracing with guard in sanitizer coverage">,
7577      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePCGuard">>;
7578def fsanitize_coverage_no_prune
7579    : Flag<["-"], "fsanitize-coverage-no-prune">,
7580      HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">,
7581      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageNoPrune">>;
7582def fsanitize_coverage_stack_depth
7583    : Flag<["-"], "fsanitize-coverage-stack-depth">,
7584      HelpText<"Enable max stack depth tracing">,
7585      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageStackDepth">>;
7586def fsanitize_coverage_trace_loads
7587    : Flag<["-"], "fsanitize-coverage-trace-loads">,
7588      HelpText<"Enable tracing of loads">,
7589      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceLoads">>;
7590def fsanitize_coverage_trace_stores
7591    : Flag<["-"], "fsanitize-coverage-trace-stores">,
7592      HelpText<"Enable tracing of stores">,
7593      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceStores">>;
7594def fexperimental_sanitize_metadata_EQ_covered
7595    : Flag<["-"], "fexperimental-sanitize-metadata=covered">,
7596      HelpText<"Emit PCs for code covered with binary analysis sanitizers">,
7597      MarshallingInfoFlag<CodeGenOpts<"SanitizeBinaryMetadataCovered">>;
7598def fexperimental_sanitize_metadata_EQ_atomics
7599    : Flag<["-"], "fexperimental-sanitize-metadata=atomics">,
7600      HelpText<"Emit PCs for atomic operations used by binary analysis sanitizers">,
7601      MarshallingInfoFlag<CodeGenOpts<"SanitizeBinaryMetadataAtomics">>;
7602def fexperimental_sanitize_metadata_EQ_uar
7603    : Flag<["-"], "fexperimental-sanitize-metadata=uar">,
7604      HelpText<"Emit PCs for start of functions that are subject for use-after-return checking.">,
7605      MarshallingInfoFlag<CodeGenOpts<"SanitizeBinaryMetadataUAR">>;
7606def fpatchable_function_entry_offset_EQ
7607    : Joined<["-"], "fpatchable-function-entry-offset=">, MetaVarName<"<M>">,
7608      HelpText<"Generate M NOPs before function entry">,
7609      MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryOffset">>;
7610def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
7611    HelpText<"Enable PGO instrumentation">, Values<"none,clang,llvm,csllvm">,
7612    NormalizedValuesScope<"CodeGenOptions">,
7613    NormalizedValues<["ProfileNone", "ProfileClangInstr", "ProfileIRInstr", "ProfileCSIRInstr"]>,
7614    MarshallingInfoEnum<CodeGenOpts<"ProfileInstr">, "ProfileNone">;
7615def fprofile_instrument_path_EQ : Joined<["-"], "fprofile-instrument-path=">,
7616    HelpText<"Generate instrumented code to collect execution counts into "
7617             "<file> (overridden by LLVM_PROFILE_FILE env var)">,
7618    MarshallingInfoString<CodeGenOpts<"InstrProfileOutput">>;
7619def fprofile_instrument_use_path_EQ :
7620    Joined<["-"], "fprofile-instrument-use-path=">,
7621    HelpText<"Specify the profile path in PGO use compilation">,
7622    MarshallingInfoString<CodeGenOpts<"ProfileInstrumentUsePath">>;
7623def flto_visibility_public_std:
7624    Flag<["-"], "flto-visibility-public-std">,
7625    HelpText<"Use public LTO visibility for classes in std and stdext namespaces">,
7626    MarshallingInfoFlag<CodeGenOpts<"LTOVisibilityPublicStd">>;
7627defm lto_unit : BoolOption<"f", "lto-unit",
7628  CodeGenOpts<"LTOUnit">, DefaultFalse,
7629  PosFlag<SetTrue, [], [ClangOption, CC1Option],
7630          "Emit IR to support LTO unit features (CFI, whole program vtable opt)">,
7631  NegFlag<SetFalse>>;
7632def fverify_debuginfo_preserve
7633    : Flag<["-"], "fverify-debuginfo-preserve">,
7634      HelpText<"Enable Debug Info Metadata preservation testing in "
7635               "optimizations.">,
7636      MarshallingInfoFlag<CodeGenOpts<"EnableDIPreservationVerify">>;
7637def fverify_debuginfo_preserve_export
7638    : Joined<["-"], "fverify-debuginfo-preserve-export=">,
7639      MetaVarName<"<file>">,
7640      HelpText<"Export debug info (by testing original Debug Info) failures "
7641               "into specified (JSON) file (should be abs path as we use "
7642               "append mode to insert new JSON objects).">,
7643      MarshallingInfoString<CodeGenOpts<"DIBugsReportFilePath">>;
7644def fwarn_stack_size_EQ
7645    : Joined<["-"], "fwarn-stack-size=">,
7646      MarshallingInfoInt<CodeGenOpts<"WarnStackSize">, "UINT_MAX">;
7647// The driver option takes the key as a parameter to the -msign-return-address=
7648// and -mbranch-protection= options, but CC1 has a separate option so we
7649// don't have to parse the parameter twice.
7650def msign_return_address_key_EQ : Joined<["-"], "msign-return-address-key=">,
7651    Values<"a_key,b_key">;
7652def mbranch_target_enforce : Flag<["-"], "mbranch-target-enforce">,
7653  MarshallingInfoFlag<LangOpts<"BranchTargetEnforcement">>;
7654def mbranch_protection_pauth_lr : Flag<["-"], "mbranch-protection-pauth-lr">,
7655  MarshallingInfoFlag<LangOpts<"BranchProtectionPAuthLR">>;
7656def mguarded_control_stack : Flag<["-"], "mguarded-control-stack">,
7657  MarshallingInfoFlag<LangOpts<"GuardedControlStack">>;
7658def fno_dllexport_inlines : Flag<["-"], "fno-dllexport-inlines">,
7659  MarshallingInfoNegativeFlag<LangOpts<"DllExportInlines">>;
7660def cfguard_no_checks : Flag<["-"], "cfguard-no-checks">,
7661    HelpText<"Emit Windows Control Flow Guard tables only (no checks)">,
7662    MarshallingInfoFlag<CodeGenOpts<"ControlFlowGuardNoChecks">>;
7663def cfguard : Flag<["-"], "cfguard">,
7664    HelpText<"Emit Windows Control Flow Guard tables and checks">,
7665    MarshallingInfoFlag<CodeGenOpts<"ControlFlowGuard">>;
7666def ehcontguard : Flag<["-"], "ehcontguard">,
7667    HelpText<"Emit Windows EH Continuation Guard tables">,
7668    MarshallingInfoFlag<CodeGenOpts<"EHContGuard">>;
7669
7670def fdenormal_fp_math_f32_EQ : Joined<["-"], "fdenormal-fp-math-f32=">,
7671   Group<f_Group>;
7672
7673def fctor_dtor_return_this : Flag<["-"], "fctor-dtor-return-this">,
7674  HelpText<"Change the C++ ABI to returning `this` pointer from constructors "
7675           "and non-deleting destructors. (No effect on Microsoft ABI)">,
7676  MarshallingInfoFlag<CodeGenOpts<"CtorDtorReturnThis">>;
7677
7678def fexperimental_assignment_tracking_EQ : Joined<["-"], "fexperimental-assignment-tracking=">,
7679  Group<f_Group>, CodeGenOpts<"EnableAssignmentTracking">,
7680  NormalizedValuesScope<"CodeGenOptions::AssignmentTrackingOpts">,
7681  Values<"disabled,enabled,forced">, NormalizedValues<["Disabled","Enabled","Forced"]>,
7682  MarshallingInfoEnum<CodeGenOpts<"AssignmentTrackingMode">, "Enabled">;
7683
7684def enable_tlsdesc : Flag<["-"], "enable-tlsdesc">,
7685  MarshallingInfoFlag<CodeGenOpts<"EnableTLSDESC">>;
7686
7687} // let Visibility = [CC1Option]
7688
7689//===----------------------------------------------------------------------===//
7690// Dependency Output Options
7691//===----------------------------------------------------------------------===//
7692
7693let Visibility = [CC1Option] in {
7694
7695def sys_header_deps : Flag<["-"], "sys-header-deps">,
7696  HelpText<"Include system headers in dependency output">,
7697  MarshallingInfoFlag<DependencyOutputOpts<"IncludeSystemHeaders">>;
7698def module_file_deps : Flag<["-"], "module-file-deps">,
7699  HelpText<"Include module files in dependency output">,
7700  MarshallingInfoFlag<DependencyOutputOpts<"IncludeModuleFiles">>;
7701def header_include_file : Separate<["-"], "header-include-file">,
7702  HelpText<"Filename (or -) to write header include output to">,
7703  MarshallingInfoString<DependencyOutputOpts<"HeaderIncludeOutputFile">>;
7704def header_include_format_EQ : Joined<["-"], "header-include-format=">,
7705  HelpText<"set format in which header info is emitted">,
7706  Values<"textual,json">, NormalizedValues<["HIFMT_Textual", "HIFMT_JSON"]>,
7707  MarshallingInfoEnum<DependencyOutputOpts<"HeaderIncludeFormat">, "HIFMT_Textual">;
7708def header_include_filtering_EQ : Joined<["-"], "header-include-filtering=">,
7709  HelpText<"set the flag that enables filtering header information">,
7710  Values<"none,only-direct-system">, NormalizedValues<["HIFIL_None", "HIFIL_Only_Direct_System"]>,
7711  MarshallingInfoEnum<DependencyOutputOpts<"HeaderIncludeFiltering">, "HIFIL_None">;
7712def show_includes : Flag<["--"], "show-includes">,
7713  HelpText<"Print cl.exe style /showIncludes to stdout">;
7714
7715} // let Visibility = [CC1Option]
7716
7717//===----------------------------------------------------------------------===//
7718// Diagnostic Options
7719//===----------------------------------------------------------------------===//
7720
7721let Visibility = [CC1Option] in {
7722
7723def diagnostic_log_file : Separate<["-"], "diagnostic-log-file">,
7724  HelpText<"Filename (or -) to log diagnostics to">,
7725  MarshallingInfoString<DiagnosticOpts<"DiagnosticLogFile">>;
7726def diagnostic_serialized_file : Separate<["-"], "serialize-diagnostic-file">,
7727  MetaVarName<"<filename>">,
7728  HelpText<"File for serializing diagnostics in a binary format">;
7729
7730def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">,
7731  HelpText<"Change diagnostic formatting to match IDE and command line tools">,
7732  Values<"clang,msvc,vi,sarif,SARIF">,
7733  NormalizedValuesScope<"DiagnosticOptions">, NormalizedValues<["Clang", "MSVC", "Vi", "SARIF", "SARIF"]>,
7734  MarshallingInfoEnum<DiagnosticOpts<"Format">, "Clang">;
7735def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">,
7736  HelpText<"Print diagnostic category">,
7737  Values<"none,id,name">,
7738  NormalizedValues<["0", "1", "2"]>,
7739  MarshallingInfoEnum<DiagnosticOpts<"ShowCategories">, "0">;
7740def fno_diagnostics_use_presumed_location : Flag<["-"], "fno-diagnostics-use-presumed-location">,
7741  HelpText<"Ignore #line directives when displaying diagnostic locations">,
7742  MarshallingInfoNegativeFlag<DiagnosticOpts<"ShowPresumedLoc">>;
7743def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">,
7744  HelpText<"Set the tab stop distance.">,
7745  MarshallingInfoInt<DiagnosticOpts<"TabStop">, "DiagnosticOptions::DefaultTabStop">;
7746def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"<N>">,
7747  HelpText<"Set the maximum number of errors to emit before stopping (0 = no limit).">,
7748  MarshallingInfoInt<DiagnosticOpts<"ErrorLimit">>;
7749def verify_EQ : CommaJoined<["-"], "verify=">,
7750  MetaVarName<"<prefixes>">,
7751  HelpText<"Verify diagnostic output using comment directives that start with"
7752           " prefixes in the comma-separated sequence <prefixes>">;
7753def verify : Flag<["-"], "verify">,
7754  HelpText<"Equivalent to -verify=expected">;
7755def verify_ignore_unexpected : Flag<["-"], "verify-ignore-unexpected">,
7756  HelpText<"Ignore unexpected diagnostic messages">;
7757def verify_ignore_unexpected_EQ : CommaJoined<["-"], "verify-ignore-unexpected=">,
7758  HelpText<"Ignore unexpected diagnostic messages">;
7759def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">,
7760  HelpText<"Silence ObjC rewriting warnings">,
7761  MarshallingInfoFlag<DiagnosticOpts<"NoRewriteMacros">>;
7762
7763} // let Visibility = [CC1Option]
7764
7765//===----------------------------------------------------------------------===//
7766// Frontend Options
7767//===----------------------------------------------------------------------===//
7768
7769let Visibility = [CC1Option] in {
7770
7771// This isn't normally used, it is just here so we can parse a
7772// CompilerInvocation out of a driver-derived argument vector.
7773def cc1 : Flag<["-"], "cc1">;
7774def cc1as : Flag<["-"], "cc1as">;
7775
7776def ast_merge : Separate<["-"], "ast-merge">,
7777  MetaVarName<"<ast file>">,
7778  HelpText<"Merge the given AST file into the translation unit being compiled.">,
7779  MarshallingInfoStringVector<FrontendOpts<"ASTMergeFiles">>;
7780def aux_target_cpu : Separate<["-"], "aux-target-cpu">,
7781  HelpText<"Target a specific auxiliary cpu type">;
7782def aux_target_feature : Separate<["-"], "aux-target-feature">,
7783  HelpText<"Target specific auxiliary attributes">;
7784def aux_triple : Separate<["-"], "aux-triple">,
7785  HelpText<"Auxiliary target triple.">,
7786  MarshallingInfoString<FrontendOpts<"AuxTriple">>;
7787def code_completion_at : Separate<["-"], "code-completion-at">,
7788  MetaVarName<"<file>:<line>:<column>">,
7789  HelpText<"Dump code-completion information at a location">;
7790def remap_file : Separate<["-"], "remap-file">,
7791  MetaVarName<"<from>;<to>">,
7792  HelpText<"Replace the contents of the <from> file with the contents of the <to> file">;
7793def code_completion_at_EQ : Joined<["-"], "code-completion-at=">,
7794  Alias<code_completion_at>;
7795def code_completion_macros : Flag<["-"], "code-completion-macros">,
7796  HelpText<"Include macros in code-completion results">,
7797  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeMacros">>;
7798def code_completion_patterns : Flag<["-"], "code-completion-patterns">,
7799  HelpText<"Include code patterns in code-completion results">,
7800  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeCodePatterns">>;
7801def no_code_completion_globals : Flag<["-"], "no-code-completion-globals">,
7802  HelpText<"Do not include global declarations in code-completion results.">,
7803  MarshallingInfoNegativeFlag<FrontendOpts<"CodeCompleteOpts.IncludeGlobals">>;
7804def no_code_completion_ns_level_decls : Flag<["-"], "no-code-completion-ns-level-decls">,
7805  HelpText<"Do not include declarations inside namespaces (incl. global namespace) in the code-completion results.">,
7806  MarshallingInfoNegativeFlag<FrontendOpts<"CodeCompleteOpts.IncludeNamespaceLevelDecls">>;
7807def code_completion_brief_comments : Flag<["-"], "code-completion-brief-comments">,
7808  HelpText<"Include brief documentation comments in code-completion results.">,
7809  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeBriefComments">>;
7810def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">,
7811  HelpText<"Include code completion results which require small fix-its.">,
7812  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeFixIts">>;
7813def skip_function_bodies : Flag<["-"], "skip-function-bodies">,
7814  HelpText<"Skip function bodies when possible">,
7815  MarshallingInfoFlag<FrontendOpts<"SkipFunctionBodies">>;
7816def disable_free : Flag<["-"], "disable-free">,
7817  HelpText<"Disable freeing of memory on exit">,
7818  MarshallingInfoFlag<FrontendOpts<"DisableFree">>;
7819defm clear_ast_before_backend : BoolOption<"",
7820  "clear-ast-before-backend",
7821  CodeGenOpts<"ClearASTBeforeBackend">,
7822  DefaultFalse,
7823  PosFlag<SetTrue, [], [ClangOption], "Clear">,
7824  NegFlag<SetFalse, [], [ClangOption], "Don't clear">,
7825  BothFlags<[], [ClangOption], " the Clang AST before running backend code generation">>;
7826defm enable_noundef_analysis : BoolOption<"",
7827  "enable-noundef-analysis",
7828  CodeGenOpts<"EnableNoundefAttrs">,
7829  DefaultTrue,
7830  PosFlag<SetTrue, [], [ClangOption], "Enable">,
7831  NegFlag<SetFalse, [], [ClangOption], "Disable">,
7832  BothFlags<[], [ClangOption], " analyzing function argument and return types for mandatory definedness">>;
7833def discard_value_names : Flag<["-"], "discard-value-names">,
7834  HelpText<"Discard value names in LLVM IR">,
7835  MarshallingInfoFlag<CodeGenOpts<"DiscardValueNames">>;
7836def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">,
7837    MetaVarName<"<name> <arg>">,
7838    HelpText<"Pass <arg> to plugin <name>">;
7839def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"<name>">,
7840  HelpText<"Use the named plugin action in addition to the default action">,
7841  MarshallingInfoStringVector<FrontendOpts<"AddPluginActions">>;
7842def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
7843  MetaVarName<"<dump_filter>">,
7844  HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
7845           " nodes having a certain substring in a qualified name. Use"
7846           " -ast-list to list all filterable declaration node names.">,
7847  MarshallingInfoString<FrontendOpts<"ASTDumpFilter">>;
7848def ast_dump_filter_EQ : Joined<["-"], "ast-dump-filter=">,
7849  Alias<ast_dump_filter>;
7850def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
7851  HelpText<"Do not automatically generate or update the global module index">,
7852  MarshallingInfoNegativeFlag<FrontendOpts<"UseGlobalModuleIndex">>;
7853def fno_modules_error_recovery : Flag<["-"], "fno-modules-error-recovery">,
7854  HelpText<"Do not automatically import modules for error recovery">,
7855  MarshallingInfoNegativeFlag<LangOpts<"ModulesErrorRecovery">>;
7856def fmodule_map_file_home_is_cwd : Flag<["-"], "fmodule-map-file-home-is-cwd">,
7857  HelpText<"Use the current working directory as the home directory of "
7858           "module maps specified by -fmodule-map-file=<FILE>">,
7859  MarshallingInfoFlag<HeaderSearchOpts<"ModuleMapFileHomeIsCwd">>;
7860def fmodule_file_home_is_cwd : Flag<["-"], "fmodule-file-home-is-cwd">,
7861  HelpText<"Use the current working directory as the base directory of "
7862           "compiled module files.">,
7863  MarshallingInfoFlag<HeaderSearchOpts<"ModuleFileHomeIsCwd">>;
7864def fmodule_feature : Separate<["-"], "fmodule-feature">,
7865  MetaVarName<"<feature>">,
7866  HelpText<"Enable <feature> in module map requires declarations">,
7867  MarshallingInfoStringVector<LangOpts<"ModuleFeatures">>;
7868def fmodules_embed_file_EQ : Joined<["-"], "fmodules-embed-file=">,
7869  MetaVarName<"<file>">,
7870  HelpText<"Embed the contents of the specified file into the module file "
7871           "being compiled.">,
7872  MarshallingInfoStringVector<FrontendOpts<"ModulesEmbedFiles">>;
7873defm fimplicit_modules_use_lock : BoolOption<"f", "implicit-modules-use-lock",
7874  FrontendOpts<"BuildingImplicitModuleUsesLock">, DefaultTrue,
7875  NegFlag<SetFalse>,
7876  PosFlag<SetTrue, [], [ClangOption],
7877          "Use filesystem locks for implicit modules builds to avoid "
7878          "duplicating work in competing clang invocations.">>;
7879// FIXME: We only need this in C++ modules if we might textually
7880// enter a different module (eg, when building a header unit).
7881def fmodules_local_submodule_visibility :
7882  Flag<["-"], "fmodules-local-submodule-visibility">,
7883  HelpText<"Enforce name visibility rules across submodules of the same "
7884           "top-level module.">,
7885  MarshallingInfoFlag<LangOpts<"ModulesLocalVisibility">>,
7886  ImpliedByAnyOf<[fcxx_modules.KeyPath]>;
7887def fmodules_codegen :
7888  Flag<["-"], "fmodules-codegen">,
7889  HelpText<"Generate code for uses of this module that assumes an explicit "
7890           "object file will be built for the module">,
7891  MarshallingInfoFlag<LangOpts<"ModulesCodegen">>;
7892def fmodules_debuginfo :
7893  Flag<["-"], "fmodules-debuginfo">,
7894  HelpText<"Generate debug info for types in an object file built from this "
7895           "module and do not generate them elsewhere">,
7896  MarshallingInfoFlag<LangOpts<"ModulesDebugInfo">>;
7897def fmodule_format_EQ : Joined<["-"], "fmodule-format=">,
7898  HelpText<"Select the container format for clang modules and PCH. "
7899           "Supported options are 'raw' and 'obj'.">,
7900  MarshallingInfoString<HeaderSearchOpts<"ModuleFormat">, [{"raw"}]>;
7901def ftest_module_file_extension_EQ :
7902  Joined<["-"], "ftest-module-file-extension=">,
7903  HelpText<"introduce a module file extension for testing purposes. "
7904           "The argument is parsed as blockname:major:minor:hashed:user info">;
7905
7906defm recovery_ast : BoolOption<"f", "recovery-ast",
7907  LangOpts<"RecoveryAST">, DefaultTrue,
7908  NegFlag<SetFalse>,
7909  PosFlag<SetTrue, [], [ClangOption], "Preserve expressions in AST rather "
7910                              "than dropping them when encountering semantic errors">>;
7911defm recovery_ast_type : BoolOption<"f", "recovery-ast-type",
7912  LangOpts<"RecoveryASTType">, DefaultTrue,
7913  NegFlag<SetFalse>,
7914  PosFlag<SetTrue, [], [ClangOption], "Preserve the type for recovery "
7915                              "expressions when possible">>;
7916
7917let Group = Action_Group in {
7918
7919def Eonly : Flag<["-"], "Eonly">,
7920  HelpText<"Just run preprocessor, no output (for timings)">;
7921def dump_raw_tokens : Flag<["-"], "dump-raw-tokens">,
7922  HelpText<"Lex file in raw mode and dump raw tokens">;
7923def analyze : Flag<["-"], "analyze">,
7924  HelpText<"Run static analysis engine">;
7925def dump_tokens : Flag<["-"], "dump-tokens">,
7926  HelpText<"Run preprocessor, dump internal rep of tokens">;
7927def fixit : Flag<["-"], "fixit">,
7928  HelpText<"Apply fix-it advice to the input source">;
7929def fixit_EQ : Joined<["-"], "fixit=">,
7930  HelpText<"Apply fix-it advice creating a file with the given suffix">;
7931def print_preamble : Flag<["-"], "print-preamble">,
7932  HelpText<"Print the \"preamble\" of a file, which is a candidate for implicit"
7933           " precompiled headers.">;
7934def emit_html : Flag<["-"], "emit-html">,
7935  HelpText<"Output input source as HTML">;
7936def ast_print : Flag<["-"], "ast-print">,
7937  HelpText<"Build ASTs and then pretty-print them">;
7938def ast_list : Flag<["-"], "ast-list">,
7939  HelpText<"Build ASTs and print the list of declaration node qualified names">;
7940def ast_dump : Flag<["-"], "ast-dump">,
7941  HelpText<"Build ASTs and then debug dump them">;
7942def ast_dump_EQ : Joined<["-"], "ast-dump=">,
7943  HelpText<"Build ASTs and then debug dump them in the specified format. "
7944           "Supported formats include: default, json">;
7945def ast_dump_all : Flag<["-"], "ast-dump-all">,
7946  HelpText<"Build ASTs and then debug dump them, forcing deserialization">;
7947def ast_dump_all_EQ : Joined<["-"], "ast-dump-all=">,
7948  HelpText<"Build ASTs and then debug dump them in the specified format, "
7949           "forcing deserialization. Supported formats include: default, json">;
7950def ast_dump_decl_types : Flag<["-"], "ast-dump-decl-types">,
7951  HelpText<"Include declaration types in AST dumps">,
7952  MarshallingInfoFlag<FrontendOpts<"ASTDumpDeclTypes">>;
7953def templight_dump : Flag<["-"], "templight-dump">,
7954  HelpText<"Dump templight information to stdout">;
7955def ast_dump_lookups : Flag<["-"], "ast-dump-lookups">,
7956  HelpText<"Build ASTs and then debug dump their name lookup tables">,
7957  MarshallingInfoFlag<FrontendOpts<"ASTDumpLookups">>;
7958def ast_view : Flag<["-"], "ast-view">,
7959  HelpText<"Build ASTs and view them with GraphViz">;
7960def emit_module : Flag<["-"], "emit-module">,
7961  HelpText<"Generate pre-compiled module file from a module map">;
7962def emit_module_interface : Flag<["-"], "emit-module-interface">,
7963  HelpText<"Generate pre-compiled module file from a standard C++ module interface unit">;
7964def emit_reduced_module_interface : Flag<["-"], "emit-reduced-module-interface">,
7965  HelpText<"Generate reduced prebuilt module interface from a standard C++ module interface unit">;
7966def emit_header_unit : Flag<["-"], "emit-header-unit">,
7967  HelpText<"Generate C++20 header units from header files">;
7968def emit_pch : Flag<["-"], "emit-pch">,
7969  HelpText<"Generate pre-compiled header file">;
7970def emit_llvm_only : Flag<["-"], "emit-llvm-only">,
7971  HelpText<"Build ASTs and convert to LLVM, discarding output">;
7972def emit_codegen_only : Flag<["-"], "emit-codegen-only">,
7973  HelpText<"Generate machine code, but discard output">;
7974def rewrite_test : Flag<["-"], "rewrite-test">,
7975  HelpText<"Rewriter playground">;
7976def rewrite_macros : Flag<["-"], "rewrite-macros">,
7977  HelpText<"Expand macros without full preprocessing">;
7978def migrate : Flag<["-"], "migrate">,
7979  HelpText<"Migrate source code">;
7980def compiler_options_dump : Flag<["-"], "compiler-options-dump">,
7981  HelpText<"Dump the compiler configuration options">;
7982def print_dependency_directives_minimized_source : Flag<["-"],
7983  "print-dependency-directives-minimized-source">,
7984  HelpText<"Print the output of the dependency directives source minimizer">;
7985}
7986
7987defm emit_llvm_uselists : BoolOption<"", "emit-llvm-uselists",
7988  CodeGenOpts<"EmitLLVMUseLists">, DefaultFalse,
7989  PosFlag<SetTrue, [], [ClangOption], "Preserve">,
7990  NegFlag<SetFalse, [], [ClangOption], "Don't preserve">,
7991  BothFlags<[], [ClangOption], " order of LLVM use-lists when serializing">>;
7992
7993def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">,
7994  HelpText<"Directory for temporary files produced during ARC or ObjC migration">,
7995  MarshallingInfoString<FrontendOpts<"MTMigrateDir">>;
7996
7997def arcmt_action_EQ : Joined<["-"], "arcmt-action=">, Visibility<[CC1Option]>,
7998  HelpText<"The ARC migration action to take">,
7999  Values<"check,modify,migrate">,
8000  NormalizedValuesScope<"FrontendOptions">,
8001  NormalizedValues<["ARCMT_Check", "ARCMT_Modify", "ARCMT_Migrate"]>,
8002  MarshallingInfoEnum<FrontendOpts<"ARCMTAction">, "ARCMT_None">;
8003
8004def print_stats : Flag<["-"], "print-stats">,
8005  HelpText<"Print performance metrics and statistics">,
8006  MarshallingInfoFlag<FrontendOpts<"ShowStats">>;
8007def stats_file : Joined<["-"], "stats-file=">,
8008  HelpText<"Filename to write statistics to">,
8009  MarshallingInfoString<FrontendOpts<"StatsFile">>;
8010def stats_file_append : Flag<["-"], "stats-file-append">,
8011  HelpText<"If stats should be appended to stats-file instead of overwriting it">,
8012  MarshallingInfoFlag<FrontendOpts<"AppendStats">>;
8013def fdump_record_layouts_simple : Flag<["-"], "fdump-record-layouts-simple">,
8014  HelpText<"Dump record layout information in a simple form used for testing">,
8015  MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsSimple">>;
8016def fdump_record_layouts_canonical : Flag<["-"], "fdump-record-layouts-canonical">,
8017  HelpText<"Dump record layout information with canonical field types">,
8018  MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsCanonical">>;
8019def fdump_record_layouts_complete : Flag<["-"], "fdump-record-layouts-complete">,
8020  HelpText<"Dump record layout information for all complete types">,
8021  MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsComplete">>;
8022def fdump_record_layouts : Flag<["-"], "fdump-record-layouts">,
8023  HelpText<"Dump record layout information">,
8024  MarshallingInfoFlag<LangOpts<"DumpRecordLayouts">>,
8025  ImpliedByAnyOf<[fdump_record_layouts_simple.KeyPath, fdump_record_layouts_complete.KeyPath, fdump_record_layouts_canonical.KeyPath]>;
8026def fix_what_you_can : Flag<["-"], "fix-what-you-can">,
8027  HelpText<"Apply fix-it advice even in the presence of unfixable errors">,
8028  MarshallingInfoFlag<FrontendOpts<"FixWhatYouCan">>;
8029def fix_only_warnings : Flag<["-"], "fix-only-warnings">,
8030  HelpText<"Apply fix-it advice only for warnings, not errors">,
8031  MarshallingInfoFlag<FrontendOpts<"FixOnlyWarnings">>;
8032def fixit_recompile : Flag<["-"], "fixit-recompile">,
8033  HelpText<"Apply fix-it changes and recompile">,
8034  MarshallingInfoFlag<FrontendOpts<"FixAndRecompile">>;
8035def fixit_to_temp : Flag<["-"], "fixit-to-temporary">,
8036  HelpText<"Apply fix-it changes to temporary files">,
8037  MarshallingInfoFlag<FrontendOpts<"FixToTemporaries">>;
8038
8039def foverride_record_layout_EQ : Joined<["-"], "foverride-record-layout=">,
8040  HelpText<"Override record layouts with those in the given file">,
8041  MarshallingInfoString<FrontendOpts<"OverrideRecordLayoutsFile">>;
8042def pch_through_header_EQ : Joined<["-"], "pch-through-header=">,
8043  HelpText<"Stop PCH generation after including this file.  When using a PCH, "
8044           "skip tokens until after this file is included.">,
8045  MarshallingInfoString<PreprocessorOpts<"PCHThroughHeader">>;
8046def pch_through_hdrstop_create : Flag<["-"], "pch-through-hdrstop-create">,
8047  HelpText<"When creating a PCH, stop PCH generation after #pragma hdrstop.">,
8048  MarshallingInfoFlag<PreprocessorOpts<"PCHWithHdrStopCreate">>;
8049def pch_through_hdrstop_use : Flag<["-"], "pch-through-hdrstop-use">,
8050  HelpText<"When using a PCH, skip tokens until after a #pragma hdrstop.">;
8051def fno_pch_timestamp : Flag<["-"], "fno-pch-timestamp">,
8052  HelpText<"Disable inclusion of timestamp in precompiled headers">,
8053  MarshallingInfoNegativeFlag<FrontendOpts<"IncludeTimestamps">>;
8054def building_pch_with_obj : Flag<["-"], "building-pch-with-obj">,
8055  HelpText<"This compilation is part of building a PCH with corresponding object file.">,
8056  MarshallingInfoFlag<LangOpts<"BuildingPCHWithObjectFile">>;
8057
8058def aligned_alloc_unavailable : Flag<["-"], "faligned-alloc-unavailable">,
8059  HelpText<"Aligned allocation/deallocation functions are unavailable">,
8060  MarshallingInfoFlag<LangOpts<"AlignedAllocationUnavailable">>,
8061  ShouldParseIf<faligned_allocation.KeyPath>;
8062
8063} // let Visibility = [CC1Option]
8064
8065//===----------------------------------------------------------------------===//
8066// Language Options
8067//===----------------------------------------------------------------------===//
8068
8069def version : Flag<["-"], "version">,
8070  HelpText<"Print the compiler version">,
8071  Visibility<[CC1Option, CC1AsOption, FC1Option]>,
8072  MarshallingInfoFlag<FrontendOpts<"ShowVersion">>;
8073
8074def main_file_name : Separate<["-"], "main-file-name">,
8075  HelpText<"Main file name to use for debug info and source if missing">,
8076  Visibility<[CC1Option, CC1AsOption]>,
8077  MarshallingInfoString<CodeGenOpts<"MainFileName">>;
8078def split_dwarf_output : Separate<["-"], "split-dwarf-output">,
8079  HelpText<"File name to use for split dwarf debug info output">,
8080  Visibility<[CC1Option, CC1AsOption]>,
8081  MarshallingInfoString<CodeGenOpts<"SplitDwarfOutput">>;
8082
8083let Visibility = [CC1Option, FC1Option] in {
8084
8085def mreassociate : Flag<["-"], "mreassociate">,
8086  HelpText<"Allow reassociation transformations for floating-point instructions">,
8087  MarshallingInfoFlag<LangOpts<"AllowFPReassoc">>, ImpliedByAnyOf<[funsafe_math_optimizations.KeyPath]>;
8088def menable_no_nans : Flag<["-"], "menable-no-nans">,
8089  HelpText<"Allow optimization to assume there are no NaNs.">,
8090  MarshallingInfoFlag<LangOpts<"NoHonorNaNs">>, ImpliedByAnyOf<[ffast_math.KeyPath]>;
8091def menable_no_infs : Flag<["-"], "menable-no-infs">,
8092  HelpText<"Allow optimization to assume there are no infinities.">,
8093  MarshallingInfoFlag<LangOpts<"NoHonorInfs">>, ImpliedByAnyOf<[ffast_math.KeyPath]>;
8094
8095def pic_level : Separate<["-"], "pic-level">,
8096  HelpText<"Value for __PIC__">,
8097  MarshallingInfoInt<LangOpts<"PICLevel">>;
8098def pic_is_pie : Flag<["-"], "pic-is-pie">,
8099  HelpText<"File is for a position independent executable">,
8100  MarshallingInfoFlag<LangOpts<"PIE">>;
8101
8102def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">,
8103  HelpText<"Specify which frame pointers to retain.">, Values<"all,non-leaf,reserved,none">,
8104  NormalizedValuesScope<"CodeGenOptions::FramePointerKind">, NormalizedValues<["All", "NonLeaf", "Reserved", "None"]>,
8105  MarshallingInfoEnum<CodeGenOpts<"FramePointer">, "None">;
8106
8107
8108def dependent_lib : Joined<["--"], "dependent-lib=">,
8109  HelpText<"Add dependent library">,
8110  MarshallingInfoStringVector<CodeGenOpts<"DependentLibraries">>;
8111
8112} // let Visibility = [CC1Option, FC1Option]
8113
8114let Visibility = [CC1Option] in {
8115
8116def fblocks_runtime_optional : Flag<["-"], "fblocks-runtime-optional">,
8117  HelpText<"Weakly link in the blocks runtime">,
8118  MarshallingInfoFlag<LangOpts<"BlocksRuntimeOptional">>;
8119def fexternc_nounwind : Flag<["-"], "fexternc-nounwind">,
8120  HelpText<"Assume all functions with C linkage do not unwind">,
8121  MarshallingInfoFlag<LangOpts<"ExternCNoUnwind">>;
8122def split_dwarf_file : Separate<["-"], "split-dwarf-file">,
8123  HelpText<"Name of the split dwarf debug info file to encode in the object file">,
8124  MarshallingInfoString<CodeGenOpts<"SplitDwarfFile">>;
8125def fno_wchar : Flag<["-"], "fno-wchar">,
8126  HelpText<"Disable C++ builtin type wchar_t">,
8127  MarshallingInfoNegativeFlag<LangOpts<"WChar">, cplusplus.KeyPath>,
8128  ShouldParseIf<cplusplus.KeyPath>;
8129def fconstant_string_class : Separate<["-"], "fconstant-string-class">,
8130  MetaVarName<"<class name>">,
8131  HelpText<"Specify the class to use for constant Objective-C string objects.">,
8132  MarshallingInfoString<LangOpts<"ObjCConstantStringClass">>;
8133def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">,
8134  HelpText<"Objective-C++ Automatic Reference Counting standard library kind">,
8135  Values<"libc++,libstdc++,none">,
8136  NormalizedValues<["ARCXX_libcxx", "ARCXX_libstdcxx", "ARCXX_nolib"]>,
8137  MarshallingInfoEnum<PreprocessorOpts<"ObjCXXARCStandardLibrary">, "ARCXX_nolib">;
8138def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">,
8139  HelpText<"The target Objective-C runtime supports ARC weak operations">;
8140def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">,
8141  HelpText<"Objective-C dispatch method to use">,
8142  Values<"legacy,non-legacy,mixed">,
8143  NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["Legacy", "NonLegacy", "Mixed"]>,
8144  MarshallingInfoEnum<CodeGenOpts<"ObjCDispatchMethod">, "Legacy">;
8145def disable_objc_default_synthesize_properties : Flag<["-"], "disable-objc-default-synthesize-properties">,
8146  HelpText<"disable the default synthesis of Objective-C properties">,
8147  MarshallingInfoNegativeFlag<LangOpts<"ObjCDefaultSynthProperties">>;
8148def fencode_extended_block_signature : Flag<["-"], "fencode-extended-block-signature">,
8149  HelpText<"enable extended encoding of block type signature">,
8150  MarshallingInfoFlag<LangOpts<"EncodeExtendedBlockSig">>;
8151def function_alignment : Separate<["-"], "function-alignment">,
8152    HelpText<"default alignment for functions">,
8153    MarshallingInfoInt<LangOpts<"FunctionAlignment">>;
8154def fhalf_no_semantic_interposition : Flag<["-"], "fhalf-no-semantic-interposition">,
8155  HelpText<"Like -fno-semantic-interposition but don't use local aliases">,
8156  MarshallingInfoFlag<LangOpts<"HalfNoSemanticInterposition">>;
8157def fno_validate_pch : Flag<["-"], "fno-validate-pch">,
8158  HelpText<"Disable validation of precompiled headers">,
8159  MarshallingInfoFlag<PreprocessorOpts<"DisablePCHOrModuleValidation">, "DisableValidationForModuleKind::None">,
8160  Normalizer<"makeFlagToValueNormalizer(DisableValidationForModuleKind::All)">;
8161def fallow_pcm_with_errors : Flag<["-"], "fallow-pcm-with-compiler-errors">,
8162  HelpText<"Accept a PCM file that was created with compiler errors">,
8163  MarshallingInfoFlag<FrontendOpts<"AllowPCMWithCompilerErrors">>;
8164def fallow_pch_with_errors : Flag<["-"], "fallow-pch-with-compiler-errors">,
8165  HelpText<"Accept a PCH file that was created with compiler errors">,
8166  MarshallingInfoFlag<PreprocessorOpts<"AllowPCHWithCompilerErrors">>,
8167  ImpliedByAnyOf<[fallow_pcm_with_errors.KeyPath]>;
8168def fallow_pch_with_different_modules_cache_path :
8169  Flag<["-"], "fallow-pch-with-different-modules-cache-path">,
8170  HelpText<"Accept a PCH file that was created with a different modules cache path">,
8171  MarshallingInfoFlag<PreprocessorOpts<"AllowPCHWithDifferentModulesCachePath">>;
8172def fno_modules_share_filemanager : Flag<["-"], "fno-modules-share-filemanager">,
8173  HelpText<"Disable sharing the FileManager when building a module implicitly">,
8174  MarshallingInfoNegativeFlag<FrontendOpts<"ModulesShareFileManager">>;
8175def dump_deserialized_pch_decls : Flag<["-"], "dump-deserialized-decls">,
8176  HelpText<"Dump declarations that are deserialized from PCH, for testing">,
8177  MarshallingInfoFlag<PreprocessorOpts<"DumpDeserializedPCHDecls">>;
8178def error_on_deserialized_pch_decl : Separate<["-"], "error-on-deserialized-decl">,
8179  HelpText<"Emit error if a specific declaration is deserialized from PCH, for testing">;
8180def error_on_deserialized_pch_decl_EQ : Joined<["-"], "error-on-deserialized-decl=">,
8181  Alias<error_on_deserialized_pch_decl>;
8182def static_define : Flag<["-"], "static-define">,
8183  HelpText<"Should __STATIC__ be defined">,
8184  MarshallingInfoFlag<LangOpts<"Static">>;
8185def stack_protector : Separate<["-"], "stack-protector">,
8186  HelpText<"Enable stack protectors">,
8187  Values<"0,1,2,3">,
8188  NormalizedValuesScope<"LangOptions">,
8189  NormalizedValues<["SSPOff", "SSPOn", "SSPStrong", "SSPReq"]>,
8190  MarshallingInfoEnum<LangOpts<"StackProtector">, "SSPOff">;
8191def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
8192  HelpText<"Lower bound for a buffer to be considered for stack protection">,
8193  MarshallingInfoInt<CodeGenOpts<"SSPBufferSize">, "8">;
8194def ftype_visibility : Joined<["-"], "ftype-visibility=">,
8195  HelpText<"Default type visibility">,
8196  MarshallingInfoVisibility<LangOpts<"TypeVisibilityMode">, fvisibility_EQ.KeyPath>;
8197def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-to-externs">,
8198  HelpText<"Apply global symbol visibility to external declarations without an explicit visibility">,
8199  MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
8200def fbracket_depth : Separate<["-"], "fbracket-depth">,
8201  HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
8202  MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
8203defm const_strings : BoolOption<"f", "const-strings",
8204  LangOpts<"ConstStrings">, DefaultFalse,
8205  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
8206  NegFlag<SetFalse, [], [ClangOption], "Don't use">,
8207  BothFlags<[], [ClangOption], " a const qualified type for string literals in C and ObjC">>;
8208def fno_bitfield_type_align : Flag<["-"], "fno-bitfield-type-align">,
8209  HelpText<"Ignore bit-field types when aligning structures">,
8210  MarshallingInfoFlag<LangOpts<"NoBitFieldTypeAlign">>;
8211def ffake_address_space_map : Flag<["-"], "ffake-address-space-map">,
8212  HelpText<"Use a fake address space map; OpenCL testing purposes only">,
8213  MarshallingInfoFlag<LangOpts<"FakeAddressSpaceMap">>;
8214def faddress_space_map_mangling_EQ : Joined<["-"], "faddress-space-map-mangling=">,
8215  HelpText<"Set the mode for address space map based mangling; OpenCL testing purposes only">,
8216  Values<"target,no,yes">,
8217  NormalizedValuesScope<"LangOptions">,
8218  NormalizedValues<["ASMM_Target", "ASMM_Off", "ASMM_On"]>,
8219  MarshallingInfoEnum<LangOpts<"AddressSpaceMapMangling">, "ASMM_Target">;
8220def funknown_anytype : Flag<["-"], "funknown-anytype">,
8221  HelpText<"Enable parser support for the __unknown_anytype type; for testing purposes only">,
8222  MarshallingInfoFlag<LangOpts<"ParseUnknownAnytype">>;
8223def fdebugger_support : Flag<["-"], "fdebugger-support">,
8224  HelpText<"Enable special debugger support behavior">,
8225  MarshallingInfoFlag<LangOpts<"DebuggerSupport">>;
8226def fdebugger_cast_result_to_id : Flag<["-"], "fdebugger-cast-result-to-id">,
8227  HelpText<"Enable casting unknown expression results to id">,
8228  MarshallingInfoFlag<LangOpts<"DebuggerCastResultToId">>;
8229def fdebugger_objc_literal : Flag<["-"], "fdebugger-objc-literal">,
8230  HelpText<"Enable special debugger support for Objective-C subscripting and literals">,
8231  MarshallingInfoFlag<LangOpts<"DebuggerObjCLiteral">>;
8232defm deprecated_macro : BoolOption<"f", "deprecated-macro",
8233  LangOpts<"Deprecated">, DefaultFalse,
8234  PosFlag<SetTrue, [], [ClangOption], "Defines">,
8235  NegFlag<SetFalse, [], [ClangOption], "Undefines">,
8236  BothFlags<[], [ClangOption], " the __DEPRECATED macro">>;
8237def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">,
8238  HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">;
8239// TODO: Enforce values valid for MSVtorDispMode.
8240def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
8241  HelpText<"Control vtordisp placement on win32 targets">,
8242  MarshallingInfoInt<LangOpts<"VtorDispMode">, "1">;
8243def fnative_half_type: Flag<["-"], "fnative-half-type">,
8244  HelpText<"Use the native half type for __fp16 instead of promoting to float">,
8245  MarshallingInfoFlag<LangOpts<"NativeHalfType">>,
8246  ImpliedByAnyOf<[open_cl.KeyPath]>;
8247def fnative_half_arguments_and_returns : Flag<["-"], "fnative-half-arguments-and-returns">,
8248  HelpText<"Use the native __fp16 type for arguments and returns (and skip ABI-specific lowering)">,
8249  MarshallingInfoFlag<LangOpts<"NativeHalfArgsAndReturns">>,
8250  ImpliedByAnyOf<[open_cl.KeyPath, hlsl.KeyPath, hip.KeyPath]>;
8251def fdefault_calling_conv_EQ : Joined<["-"], "fdefault-calling-conv=">,
8252  HelpText<"Set default calling convention">,
8253  Values<"cdecl,fastcall,stdcall,vectorcall,regcall,rtdcall">,
8254  NormalizedValuesScope<"LangOptions">,
8255  NormalizedValues<["DCC_CDecl", "DCC_FastCall", "DCC_StdCall", "DCC_VectorCall", "DCC_RegCall", "DCC_RtdCall"]>,
8256  MarshallingInfoEnum<LangOpts<"DefaultCallingConv">, "DCC_None">;
8257
8258// These options cannot be marshalled, because they are used to set up the LangOptions defaults.
8259def finclude_default_header : Flag<["-"], "finclude-default-header">,
8260  HelpText<"Include default header file for OpenCL and HLSL">;
8261def fdeclare_opencl_builtins : Flag<["-"], "fdeclare-opencl-builtins">,
8262  HelpText<"Add OpenCL builtin function declarations (experimental)">;
8263
8264def fhlsl_strict_availability : Flag<["-"], "fhlsl-strict-availability">,
8265  HelpText<"Enables strict availability diagnostic mode for HLSL built-in functions.">,
8266  Group<hlsl_Group>,
8267  MarshallingInfoFlag<LangOpts<"HLSLStrictAvailability">>;
8268
8269def fwchar_type_EQ : Joined<["-"], "fwchar-type=">,
8270  HelpText<"Select underlying type for wchar_t">,
8271  Values<"char,short,int">,
8272  NormalizedValues<["1", "2", "4"]>,
8273  MarshallingInfoEnum<LangOpts<"WCharSize">, "0">;
8274defm signed_wchar : BoolOption<"f", "signed-wchar",
8275  LangOpts<"WCharIsSigned">, DefaultTrue,
8276  NegFlag<SetFalse, [], [ClangOption, CC1Option], "Use an unsigned">,
8277  PosFlag<SetTrue, [], [ClangOption], "Use a signed">,
8278  BothFlags<[], [ClangOption], " type for wchar_t">>;
8279def fcompatibility_qualified_id_block_param_type_checking : Flag<["-"], "fcompatibility-qualified-id-block-type-checking">,
8280  HelpText<"Allow using blocks with parameters of more specific type than "
8281           "the type system guarantees when a parameter is qualified id">,
8282  MarshallingInfoFlag<LangOpts<"CompatibilityQualifiedIdBlockParamTypeChecking">>;
8283def fpass_by_value_is_noalias: Flag<["-"], "fpass-by-value-is-noalias">,
8284  HelpText<"Allows assuming by-value parameters do not alias any other value. "
8285           "Has no effect on non-trivially-copyable classes in C++.">, Group<f_Group>,
8286  MarshallingInfoFlag<CodeGenOpts<"PassByValueIsNoAlias">>;
8287
8288// FIXME: Remove these entirely once functionality/tests have been excised.
8289def fobjc_gc_only : Flag<["-"], "fobjc-gc-only">, Group<f_Group>,
8290  HelpText<"Use GC exclusively for Objective-C related memory management">;
8291def fobjc_gc : Flag<["-"], "fobjc-gc">, Group<f_Group>,
8292  HelpText<"Enable Objective-C garbage collection">;
8293
8294def fexperimental_max_bitint_width_EQ:
8295  Joined<["-"], "fexperimental-max-bitint-width=">, Group<f_Group>,
8296  MetaVarName<"<N>">,
8297  HelpText<"Set the maximum bitwidth for _BitInt (this option is expected to be removed in the future)">,
8298  MarshallingInfoInt<LangOpts<"MaxBitIntWidth">>;
8299
8300} // let Visibility = [CC1Option]
8301
8302//===----------------------------------------------------------------------===//
8303// Header Search Options
8304//===----------------------------------------------------------------------===//
8305
8306let Visibility = [CC1Option] in {
8307
8308def nostdsysteminc : Flag<["-"], "nostdsysteminc">,
8309  HelpText<"Disable standard system #include directories">,
8310  MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardSystemIncludes">>;
8311def fdisable_module_hash : Flag<["-"], "fdisable-module-hash">,
8312  HelpText<"Disable the module hash">,
8313  MarshallingInfoFlag<HeaderSearchOpts<"DisableModuleHash">>;
8314def fmodules_hash_content : Flag<["-"], "fmodules-hash-content">,
8315  HelpText<"Enable hashing the content of a module file">,
8316  MarshallingInfoFlag<HeaderSearchOpts<"ModulesHashContent">>;
8317def fmodules_strict_context_hash : Flag<["-"], "fmodules-strict-context-hash">,
8318  HelpText<"Enable hashing of all compiler options that could impact the "
8319           "semantics of a module in an implicit build">,
8320  MarshallingInfoFlag<HeaderSearchOpts<"ModulesStrictContextHash">>;
8321def c_isystem : Separate<["-"], "c-isystem">, MetaVarName<"<directory>">,
8322  HelpText<"Add directory to the C SYSTEM include search path">;
8323def objc_isystem : Separate<["-"], "objc-isystem">,
8324  MetaVarName<"<directory>">,
8325  HelpText<"Add directory to the ObjC SYSTEM include search path">;
8326def objcxx_isystem : Separate<["-"], "objcxx-isystem">,
8327  MetaVarName<"<directory>">,
8328  HelpText<"Add directory to the ObjC++ SYSTEM include search path">;
8329def internal_isystem : Separate<["-"], "internal-isystem">,
8330  MetaVarName<"<directory>">,
8331  HelpText<"Add directory to the internal system include search path; these "
8332           "are assumed to not be user-provided and are used to model system "
8333           "and standard headers' paths.">;
8334def internal_externc_isystem : Separate<["-"], "internal-externc-isystem">,
8335  MetaVarName<"<directory>">,
8336  HelpText<"Add directory to the internal system include search path with "
8337           "implicit extern \"C\" semantics; these are assumed to not be "
8338           "user-provided and are used to model system and standard headers' "
8339           "paths.">;
8340
8341} // let Visibility = [CC1Option]
8342
8343//===----------------------------------------------------------------------===//
8344// Preprocessor Options
8345//===----------------------------------------------------------------------===//
8346
8347let Visibility = [CC1Option] in {
8348
8349def chain_include : Separate<["-"], "chain-include">, MetaVarName<"<file>">,
8350  HelpText<"Include and chain a header file after turning it into PCH">;
8351def preamble_bytes_EQ : Joined<["-"], "preamble-bytes=">,
8352  HelpText<"Assume that the precompiled header is a precompiled preamble "
8353           "covering the first N bytes of the main file">;
8354def detailed_preprocessing_record : Flag<["-"], "detailed-preprocessing-record">,
8355  HelpText<"include a detailed record of preprocessing actions">,
8356  MarshallingInfoFlag<PreprocessorOpts<"DetailedRecord">>;
8357def setup_static_analyzer : Flag<["-"], "setup-static-analyzer">,
8358  HelpText<"Set up preprocessor for static analyzer (done automatically when static analyzer is run).">,
8359  MarshallingInfoFlag<PreprocessorOpts<"SetUpStaticAnalyzer">>;
8360def disable_pragma_debug_crash : Flag<["-"], "disable-pragma-debug-crash">,
8361  HelpText<"Disable any #pragma clang __debug that can lead to crashing behavior. This is meant for testing.">,
8362  MarshallingInfoFlag<PreprocessorOpts<"DisablePragmaDebugCrash">>;
8363def source_date_epoch : Separate<["-"], "source-date-epoch">,
8364  MetaVarName<"<time since Epoch in seconds>">,
8365  HelpText<"Time to be used in __DATE__, __TIME__, and __TIMESTAMP__ macros">;
8366
8367} // let Visibility = [CC1Option]
8368
8369//===----------------------------------------------------------------------===//
8370// CUDA Options
8371//===----------------------------------------------------------------------===//
8372
8373let Visibility = [CC1Option] in {
8374
8375def fcuda_is_device : Flag<["-"], "fcuda-is-device">,
8376  HelpText<"Generate code for CUDA device">,
8377  MarshallingInfoFlag<LangOpts<"CUDAIsDevice">>;
8378def fcuda_include_gpubinary : Separate<["-"], "fcuda-include-gpubinary">,
8379  HelpText<"Incorporate CUDA device-side binary into host object file.">,
8380  MarshallingInfoString<CodeGenOpts<"CudaGpuBinaryFileName">>;
8381def fcuda_allow_variadic_functions : Flag<["-"], "fcuda-allow-variadic-functions">,
8382  HelpText<"Allow variadic functions in CUDA device code.">,
8383  MarshallingInfoFlag<LangOpts<"CUDAAllowVariadicFunctions">>;
8384def fno_cuda_host_device_constexpr : Flag<["-"], "fno-cuda-host-device-constexpr">,
8385  HelpText<"Don't treat unattributed constexpr functions as __host__ __device__.">,
8386  MarshallingInfoNegativeFlag<LangOpts<"CUDAHostDeviceConstexpr">>;
8387
8388} // let Visibility = [CC1Option]
8389
8390//===----------------------------------------------------------------------===//
8391// OpenMP Options
8392//===----------------------------------------------------------------------===//
8393
8394let Visibility = [CC1Option, FC1Option] in {
8395
8396def fopenmp_is_target_device : Flag<["-"], "fopenmp-is-target-device">,
8397  HelpText<"Generate code only for an OpenMP target device.">;
8398def : Flag<["-"], "fopenmp-is-device">, Alias<fopenmp_is_target_device>;
8399def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
8400  HelpText<"Path to the IR file produced by the frontend for the host.">;
8401
8402} // let Visibility = [CC1Option, FC1Option]
8403
8404//===----------------------------------------------------------------------===//
8405// SYCL Options
8406//===----------------------------------------------------------------------===//
8407
8408def fsycl_is_device : Flag<["-"], "fsycl-is-device">,
8409  HelpText<"Generate code for SYCL device.">,
8410  Visibility<[CC1Option]>,
8411  MarshallingInfoFlag<LangOpts<"SYCLIsDevice">>;
8412def fsycl_is_host : Flag<["-"], "fsycl-is-host">,
8413  HelpText<"SYCL host compilation">,
8414  Visibility<[CC1Option]>,
8415  MarshallingInfoFlag<LangOpts<"SYCLIsHost">>;
8416
8417def sycl_std_EQ : Joined<["-"], "sycl-std=">, Group<sycl_Group>,
8418  Flags<[NoArgumentUnused]>,
8419  Visibility<[ClangOption, CC1Option, CLOption]>,
8420  HelpText<"SYCL language standard to compile for.">,
8421  Values<"2020,2017,121,1.2.1,sycl-1.2.1">,
8422  NormalizedValues<["SYCL_2020", "SYCL_2017", "SYCL_2017", "SYCL_2017", "SYCL_2017"]>,
8423  NormalizedValuesScope<"LangOptions">,
8424  MarshallingInfoEnum<LangOpts<"SYCLVersion">, "SYCL_None">,
8425  ShouldParseIf<!strconcat(fsycl_is_device.KeyPath, "||", fsycl_is_host.KeyPath)>;
8426
8427defm gpu_approx_transcendentals : BoolFOption<"gpu-approx-transcendentals",
8428  LangOpts<"GPUDeviceApproxTranscendentals">, DefaultFalse,
8429  PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
8430  NegFlag<SetFalse, [], [ClangOption], "Don't use">,
8431  BothFlags<[], [ClangOption], " approximate transcendental functions">>;
8432def : Flag<["-"], "fcuda-approx-transcendentals">, Alias<fgpu_approx_transcendentals>;
8433def : Flag<["-"], "fno-cuda-approx-transcendentals">, Alias<fno_gpu_approx_transcendentals>;
8434
8435//===----------------------------------------------------------------------===//
8436// Frontend Options - cc1 + fc1
8437//===----------------------------------------------------------------------===//
8438
8439let Visibility = [CC1Option, FC1Option] in {
8440let Group = Action_Group in {
8441
8442def emit_obj : Flag<["-"], "emit-obj">,
8443  HelpText<"Emit native object files">;
8444def init_only : Flag<["-"], "init-only">,
8445  HelpText<"Only execute frontend initialization">;
8446def emit_llvm_bc : Flag<["-"], "emit-llvm-bc">,
8447  HelpText<"Build ASTs then convert to LLVM, emit .bc file">;
8448
8449} // let Group = Action_Group
8450
8451def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">,
8452  HelpText<"Load the named plugin (dynamic shared object)">;
8453def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">,
8454  HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">;
8455defm debug_pass_manager : BoolOption<"f", "debug-pass-manager",
8456  CodeGenOpts<"DebugPassManager">, DefaultFalse,
8457  PosFlag<SetTrue, [], [ClangOption], "Prints debug information for the new pass manager">,
8458  NegFlag<SetFalse, [], [ClangOption], "Disables debug printing for the new pass manager">>;
8459
8460def opt_record_file : Separate<["-"], "opt-record-file">,
8461  HelpText<"File name to use for YAML optimization record output">,
8462  MarshallingInfoString<CodeGenOpts<"OptRecordFile">>;
8463def opt_record_passes : Separate<["-"], "opt-record-passes">,
8464  HelpText<"Only record remark information for passes whose names match the given regular expression">;
8465def opt_record_format : Separate<["-"], "opt-record-format">,
8466  HelpText<"The format used for serializing remarks (default: YAML)">;
8467
8468} // let Visibility = [CC1Option, FC1Option]
8469
8470//===----------------------------------------------------------------------===//
8471// cc1as-only Options
8472//===----------------------------------------------------------------------===//
8473
8474let Visibility = [CC1AsOption] in {
8475
8476// Language Options
8477def n : Flag<["-"], "n">,
8478  HelpText<"Don't automatically start assembly file with a text section">;
8479
8480// Frontend Options
8481def filetype : Separate<["-"], "filetype">,
8482    HelpText<"Specify the output file type ('asm', 'null', or 'obj')">;
8483
8484// Transliterate Options
8485def show_encoding : Flag<["-"], "show-encoding">,
8486    HelpText<"Show instruction encoding information in transliterate mode">;
8487def show_inst : Flag<["-"], "show-inst">,
8488    HelpText<"Show internal instruction representation in transliterate mode">;
8489
8490// Assemble Options
8491def dwarf_debug_producer : Separate<["-"], "dwarf-debug-producer">,
8492  HelpText<"The string to embed in the Dwarf debug AT_producer record.">;
8493
8494def defsym : Separate<["--"], "defsym">,
8495  HelpText<"Define a value for a symbol">;
8496
8497} // let Visibility = [CC1AsOption]
8498
8499//===----------------------------------------------------------------------===//
8500// clang-cl Options
8501//===----------------------------------------------------------------------===//
8502
8503def cl_Group : OptionGroup<"<clang-cl options>">,
8504  HelpText<"CL.EXE COMPATIBILITY OPTIONS">;
8505
8506def cl_compile_Group : OptionGroup<"<clang-cl compile-only options>">,
8507  Group<cl_Group>;
8508
8509def cl_ignored_Group : OptionGroup<"<clang-cl ignored options>">,
8510  Group<cl_Group>;
8511
8512class CLFlag<string name, list<OptionVisibility> vis = [CLOption]> :
8513  Option<["/", "-"], name, KIND_FLAG>,
8514  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8515
8516class CLCompileFlag<string name, list<OptionVisibility> vis = [CLOption]> :
8517  Option<["/", "-"], name, KIND_FLAG>,
8518  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8519
8520class CLIgnoredFlag<string name, list<OptionVisibility> vis = [CLOption]> :
8521  Option<["/", "-"], name, KIND_FLAG>,
8522  Group<cl_ignored_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8523
8524class CLJoined<string name, list<OptionVisibility> vis = [CLOption]> :
8525  Option<["/", "-"], name, KIND_JOINED>,
8526  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8527
8528class CLCompileJoined<string name, list<OptionVisibility> vis = [CLOption]> :
8529  Option<["/", "-"], name, KIND_JOINED>,
8530  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8531
8532class CLIgnoredJoined<string name, list<OptionVisibility> vis = [CLOption]> :
8533  Option<["/", "-"], name, KIND_JOINED>,
8534  Group<cl_ignored_Group>, Flags<[NoXarchOption, HelpHidden]>, Visibility<vis>;
8535
8536class CLJoinedOrSeparate<string name, list<OptionVisibility> vis = [CLOption]> :
8537  Option<["/", "-"], name, KIND_JOINED_OR_SEPARATE>,
8538  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8539
8540class CLCompileJoinedOrSeparate<string name,
8541                                list<OptionVisibility> vis = [CLOption]> :
8542  Option<["/", "-"], name, KIND_JOINED_OR_SEPARATE>,
8543  Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8544
8545class CLRemainingArgsJoined<string name,
8546                            list<OptionVisibility> vis = [CLOption]> :
8547  Option<["/", "-"], name, KIND_REMAINING_ARGS_JOINED>,
8548  Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<vis>;
8549
8550// Aliases:
8551// (We don't put any of these in cl_compile_Group as the options they alias are
8552// already in the right group.)
8553
8554def _SLASH_Brepro : CLFlag<"Brepro">,
8555  HelpText<"Do not write current time into COFF output (breaks link.exe /incremental)">,
8556  Alias<mno_incremental_linker_compatible>;
8557def _SLASH_Brepro_ : CLFlag<"Brepro-">,
8558  HelpText<"Write current time into COFF output (default)">,
8559  Alias<mincremental_linker_compatible>;
8560def _SLASH_C : CLFlag<"C">,
8561  HelpText<"Do not discard comments when preprocessing">, Alias<C>;
8562def _SLASH_c : CLFlag<"c">, HelpText<"Compile only">, Alias<c>;
8563def _SLASH_d1PP : CLFlag<"d1PP">,
8564  HelpText<"Retain macro definitions in /E mode">, Alias<dD>;
8565def _SLASH_d1reportAllClassLayout : CLFlag<"d1reportAllClassLayout">,
8566  HelpText<"Dump record layout information">,
8567  Alias<Xclang>, AliasArgs<["-fdump-record-layouts"]>;
8568def _SLASH_diagnostics_caret : CLFlag<"diagnostics:caret">,
8569  HelpText<"Enable caret and column diagnostics (default)">;
8570def _SLASH_diagnostics_column : CLFlag<"diagnostics:column">,
8571  HelpText<"Disable caret diagnostics but keep column info">;
8572def _SLASH_diagnostics_classic : CLFlag<"diagnostics:classic">,
8573  HelpText<"Disable column and caret diagnostics">;
8574def _SLASH_D : CLJoinedOrSeparate<"D", [CLOption, DXCOption]>,
8575  HelpText<"Define macro">, MetaVarName<"<macro[=value]>">, Alias<D>;
8576def _SLASH_E : CLFlag<"E">, HelpText<"Preprocess to stdout">, Alias<E>;
8577def _SLASH_external_COLON_I : CLJoinedOrSeparate<"external:I">, Alias<isystem>,
8578  HelpText<"Add directory to include search path with warnings suppressed">,
8579  MetaVarName<"<dir>">;
8580def _SLASH_fp_contract : CLFlag<"fp:contract">, HelpText<"">, Alias<ffp_contract>, AliasArgs<["on"]>;
8581def _SLASH_fp_except : CLFlag<"fp:except">, HelpText<"">, Alias<ffp_exception_behavior_EQ>, AliasArgs<["strict"]>;
8582def _SLASH_fp_except_ : CLFlag<"fp:except-">, HelpText<"">, Alias<ffp_exception_behavior_EQ>, AliasArgs<["ignore"]>;
8583def _SLASH_fp_fast : CLFlag<"fp:fast">, HelpText<"">, Alias<ffast_math>;
8584def _SLASH_fp_precise : CLFlag<"fp:precise">, HelpText<"">, Alias<ffp_model_EQ>, AliasArgs<["precise"]>;
8585def _SLASH_fp_strict : CLFlag<"fp:strict">, HelpText<"">, Alias<ffp_model_EQ>, AliasArgs<["strict"]>;
8586def _SLASH_fsanitize_EQ_address : CLFlag<"fsanitize=address">,
8587  HelpText<"Enable AddressSanitizer">,
8588  Alias<fsanitize_EQ>, AliasArgs<["address"]>;
8589def _SLASH_GA : CLFlag<"GA">, Alias<ftlsmodel_EQ>, AliasArgs<["local-exec"]>,
8590  HelpText<"Assume thread-local variables are defined in the executable">;
8591def _SLASH_GR : CLFlag<"GR">, HelpText<"Emit RTTI data (default)">;
8592def _SLASH_GR_ : CLFlag<"GR-">, HelpText<"Do not emit RTTI data">;
8593def _SLASH_GF : CLIgnoredFlag<"GF">,
8594  HelpText<"Enable string pooling (default)">;
8595def _SLASH_GF_ : CLFlag<"GF-">, HelpText<"Disable string pooling">,
8596  Alias<fwritable_strings>;
8597def _SLASH_GS : CLFlag<"GS">,
8598  HelpText<"Enable buffer security check (default)">;
8599def _SLASH_GS_ : CLFlag<"GS-">, HelpText<"Disable buffer security check">;
8600def : CLFlag<"Gs">, HelpText<"Use stack probes (default)">,
8601  Alias<mstack_probe_size>, AliasArgs<["4096"]>;
8602def _SLASH_Gs : CLJoined<"Gs">,
8603  HelpText<"Set stack probe size (default 4096)">, Alias<mstack_probe_size>;
8604def _SLASH_Gy : CLFlag<"Gy">, HelpText<"Put each function in its own section">,
8605  Alias<ffunction_sections>;
8606def _SLASH_Gy_ : CLFlag<"Gy-">,
8607  HelpText<"Do not put each function in its own section (default)">,
8608  Alias<fno_function_sections>;
8609def _SLASH_Gw : CLFlag<"Gw">, HelpText<"Put each data item in its own section">,
8610  Alias<fdata_sections>;
8611def _SLASH_Gw_ : CLFlag<"Gw-">,
8612  HelpText<"Do not put each data item in its own section (default)">,
8613  Alias<fno_data_sections>;
8614def _SLASH_help : CLFlag<"help", [CLOption, DXCOption]>, Alias<help>,
8615  HelpText<"Display available options">;
8616def _SLASH_HELP : CLFlag<"HELP">, Alias<help>;
8617def _SLASH_hotpatch : CLFlag<"hotpatch">, Alias<fms_hotpatch>,
8618  HelpText<"Create hotpatchable image">;
8619def _SLASH_I : CLJoinedOrSeparate<"I", [CLOption, DXCOption]>,
8620  HelpText<"Add directory to include search path">, MetaVarName<"<dir>">,
8621  Alias<I>;
8622def _SLASH_J : CLFlag<"J">, HelpText<"Make char type unsigned">,
8623  Alias<funsigned_char>;
8624
8625// The _SLASH_O option handles all the /O flags, but we also provide separate
8626// aliased options to provide separate help messages.
8627def _SLASH_O : CLJoined<"O", [CLOption, DXCOption]>,
8628  HelpText<"Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-'">,
8629  MetaVarName<"<flags>">;
8630def : CLFlag<"O1">, Alias<_SLASH_O>, AliasArgs<["1"]>,
8631  HelpText<"Optimize for size  (like /Og     /Os /Oy /Ob2 /GF /Gy)">;
8632def : CLFlag<"O2">, Alias<_SLASH_O>, AliasArgs<["2"]>,
8633  HelpText<"Optimize for speed (like /Og /Oi /Ot /Oy /Ob2 /GF /Gy)">;
8634def : CLFlag<"Ob0">, Alias<_SLASH_O>, AliasArgs<["b0"]>,
8635  HelpText<"Disable function inlining">;
8636def : CLFlag<"Ob1">, Alias<_SLASH_O>, AliasArgs<["b1"]>,
8637  HelpText<"Only inline functions explicitly or implicitly marked inline">;
8638def : CLFlag<"Ob2">, Alias<_SLASH_O>, AliasArgs<["b2"]>,
8639  HelpText<"Inline functions as deemed beneficial by the compiler">;
8640def : CLFlag<"Ob3">, Alias<_SLASH_O>, AliasArgs<["b3"]>,
8641  HelpText<"Same as /Ob2">;
8642def : CLFlag<"Od", [CLOption, DXCOption]>, Alias<_SLASH_O>, AliasArgs<["d"]>,
8643  HelpText<"Disable optimization">;
8644def : CLFlag<"Og">, Alias<_SLASH_O>, AliasArgs<["g"]>,
8645  HelpText<"No effect">;
8646def : CLFlag<"Oi">, Alias<_SLASH_O>, AliasArgs<["i"]>,
8647  HelpText<"Enable use of builtin functions">;
8648def : CLFlag<"Oi-">, Alias<_SLASH_O>, AliasArgs<["i-"]>,
8649  HelpText<"Disable use of builtin functions">;
8650def : CLFlag<"Os">, Alias<_SLASH_O>, AliasArgs<["s"]>,
8651  HelpText<"Optimize for size (like clang -Os)">;
8652def : CLFlag<"Ot">, Alias<_SLASH_O>, AliasArgs<["t"]>,
8653  HelpText<"Optimize for speed (like clang -O3)">;
8654def : CLFlag<"Ox">, Alias<_SLASH_O>, AliasArgs<["x"]>,
8655  HelpText<"Deprecated (like /Og /Oi /Ot /Oy /Ob2); use /O2">;
8656def : CLFlag<"Oy">, Alias<_SLASH_O>, AliasArgs<["y"]>,
8657  HelpText<"Enable frame pointer omission (x86 only)">;
8658def : CLFlag<"Oy-">, Alias<_SLASH_O>, AliasArgs<["y-"]>,
8659  HelpText<"Disable frame pointer omission (x86 only, default)">;
8660
8661def _SLASH_QUESTION : CLFlag<"?">, Alias<help>,
8662  HelpText<"Display available options">;
8663def _SLASH_Qvec : CLFlag<"Qvec">,
8664  HelpText<"Enable the loop vectorization passes">, Alias<fvectorize>;
8665def _SLASH_Qvec_ : CLFlag<"Qvec-">,
8666  HelpText<"Disable the loop vectorization passes">, Alias<fno_vectorize>;
8667def _SLASH_showIncludes : CLFlag<"showIncludes">,
8668  HelpText<"Print info about included files to stderr">;
8669def _SLASH_showIncludes_user : CLFlag<"showIncludes:user">,
8670  HelpText<"Like /showIncludes but omit system headers">;
8671def _SLASH_showFilenames : CLFlag<"showFilenames">,
8672  HelpText<"Print the name of each compiled file">;
8673def _SLASH_showFilenames_ : CLFlag<"showFilenames-">,
8674  HelpText<"Do not print the name of each compiled file (default)">;
8675def _SLASH_source_charset : CLCompileJoined<"source-charset:">,
8676  HelpText<"Set source encoding, supports only UTF-8">,
8677  Alias<finput_charset_EQ>;
8678def _SLASH_execution_charset : CLCompileJoined<"execution-charset:">,
8679  HelpText<"Set runtime encoding, supports only UTF-8">,
8680  Alias<fexec_charset_EQ>;
8681def _SLASH_std : CLCompileJoined<"std:">,
8682  HelpText<"Set language version (c++14,c++17,c++20,c++23preview,c++latest,c11,c17)">;
8683def _SLASH_U : CLJoinedOrSeparate<"U">, HelpText<"Undefine macro">,
8684  MetaVarName<"<macro>">, Alias<U>;
8685def _SLASH_validate_charset : CLFlag<"validate-charset">,
8686  Alias<W_Joined>, AliasArgs<["invalid-source-encoding"]>;
8687def _SLASH_validate_charset_ : CLFlag<"validate-charset-">,
8688  Alias<W_Joined>, AliasArgs<["no-invalid-source-encoding"]>;
8689def _SLASH_external_W0 : CLFlag<"external:W0">, HelpText<"Ignore warnings from system headers (default)">, Alias<Wno_system_headers>;
8690def _SLASH_external_W1 : CLFlag<"external:W1">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
8691def _SLASH_external_W2 : CLFlag<"external:W2">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
8692def _SLASH_external_W3 : CLFlag<"external:W3">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
8693def _SLASH_external_W4 : CLFlag<"external:W4">, HelpText<"Enable -Wsystem-headers">, Alias<Wsystem_headers>;
8694def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">, Alias<w>;
8695def _SLASH_W1 : CLFlag<"W1">, HelpText<"Enable -Wall">, Alias<Wall>;
8696def _SLASH_W2 : CLFlag<"W2">, HelpText<"Enable -Wall">, Alias<Wall>;
8697def _SLASH_W3 : CLFlag<"W3">, HelpText<"Enable -Wall">, Alias<Wall>;
8698def _SLASH_W4 : CLFlag<"W4">, HelpText<"Enable -Wall and -Wextra">, Alias<WCL4>;
8699def _SLASH_Wall : CLFlag<"Wall">, HelpText<"Enable -Weverything">,
8700  Alias<W_Joined>, AliasArgs<["everything"]>;
8701def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">,
8702  Alias<W_Joined>, AliasArgs<["error"]>;
8703def _SLASH_WX_ : CLFlag<"WX-">,
8704  HelpText<"Do not treat warnings as errors (default)">,
8705  Alias<W_Joined>, AliasArgs<["no-error"]>;
8706def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias<w>;
8707def _SLASH_wd : CLCompileJoined<"wd">;
8708def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
8709  Alias<vtordisp_mode_EQ>;
8710def _SLASH_X : CLFlag<"X">,
8711  HelpText<"Do not add %INCLUDE% to include search path">, Alias<nostdlibinc>;
8712def _SLASH_Zc___STDC__ : CLFlag<"Zc:__STDC__">,
8713  HelpText<"Define __STDC__">,
8714  Alias<fms_define_stdc>;
8715def _SLASH_Zc_sizedDealloc : CLFlag<"Zc:sizedDealloc">,
8716  HelpText<"Enable C++14 sized global deallocation functions">,
8717  Alias<fsized_deallocation>;
8718def _SLASH_Zc_sizedDealloc_ : CLFlag<"Zc:sizedDealloc-">,
8719  HelpText<"Disable C++14 sized global deallocation functions">,
8720  Alias<fno_sized_deallocation>;
8721def _SLASH_Zc_alignedNew : CLFlag<"Zc:alignedNew">,
8722  HelpText<"Enable C++17 aligned allocation functions">,
8723  Alias<faligned_allocation>;
8724def _SLASH_Zc_alignedNew_ : CLFlag<"Zc:alignedNew-">,
8725  HelpText<"Disable C++17 aligned allocation functions">,
8726  Alias<fno_aligned_allocation>;
8727def _SLASH_Zc_char8_t : CLFlag<"Zc:char8_t">,
8728  HelpText<"Enable char8_t from C++2a">,
8729  Alias<fchar8__t>;
8730def _SLASH_Zc_char8_t_ : CLFlag<"Zc:char8_t-">,
8731  HelpText<"Disable char8_t from c++2a">,
8732  Alias<fno_char8__t>;
8733def _SLASH_Zc_strictStrings : CLFlag<"Zc:strictStrings">,
8734  HelpText<"Treat string literals as const">, Alias<W_Joined>,
8735  AliasArgs<["error=c++11-compat-deprecated-writable-strings"]>;
8736def _SLASH_Zc_threadSafeInit : CLFlag<"Zc:threadSafeInit">,
8737  HelpText<"Enable thread-safe initialization of static variables">,
8738  Alias<fthreadsafe_statics>;
8739def _SLASH_Zc_threadSafeInit_ : CLFlag<"Zc:threadSafeInit-">,
8740  HelpText<"Disable thread-safe initialization of static variables">,
8741  Alias<fno_threadsafe_statics>;
8742def _SLASH_Zc_tlsGuards : CLFlag<"Zc:tlsGuards">,
8743  HelpText<"Enable on-demand initialization of thread-local variables">,
8744  Alias<fms_tls_guards>;
8745def _SLASH_Zc_tlsGuards_ : CLFlag<"Zc:tlsGuards-">,
8746  HelpText<"Disable on-demand initialization of thread-local variables">,
8747  Alias<fno_ms_tls_guards>;
8748def _SLASH_Zc_trigraphs : CLFlag<"Zc:trigraphs">,
8749  HelpText<"Enable trigraphs">, Alias<ftrigraphs>;
8750def _SLASH_Zc_trigraphs_off : CLFlag<"Zc:trigraphs-">,
8751  HelpText<"Disable trigraphs (default)">, Alias<fno_trigraphs>;
8752def _SLASH_Zc_twoPhase : CLFlag<"Zc:twoPhase">,
8753  HelpText<"Enable two-phase name lookup in templates">,
8754  Alias<fno_delayed_template_parsing>;
8755def _SLASH_Zc_twoPhase_ : CLFlag<"Zc:twoPhase-">,
8756  HelpText<"Disable two-phase name lookup in templates (default)">,
8757  Alias<fdelayed_template_parsing>;
8758def _SLASH_Zc_wchar_t : CLFlag<"Zc:wchar_t">,
8759  HelpText<"Enable C++ builtin type wchar_t (default)">;
8760def _SLASH_Zc_wchar_t_ : CLFlag<"Zc:wchar_t-">,
8761  HelpText<"Disable C++ builtin type wchar_t">;
8762def _SLASH_Z7 : CLFlag<"Z7">, Alias<g_Flag>,
8763  HelpText<"Enable CodeView debug information in object files">;
8764def _SLASH_ZH_MD5 : CLFlag<"ZH:MD5">,
8765  HelpText<"Use MD5 for file checksums in debug info (default)">,
8766  Alias<gsrc_hash_EQ>, AliasArgs<["md5"]>;
8767def _SLASH_ZH_SHA1 : CLFlag<"ZH:SHA1">,
8768  HelpText<"Use SHA1 for file checksums in debug info">,
8769  Alias<gsrc_hash_EQ>, AliasArgs<["sha1"]>;
8770def _SLASH_ZH_SHA_256 : CLFlag<"ZH:SHA_256">,
8771  HelpText<"Use SHA256 for file checksums in debug info">,
8772  Alias<gsrc_hash_EQ>, AliasArgs<["sha256"]>;
8773def _SLASH_Zi : CLFlag<"Zi", [CLOption, DXCOption]>, Alias<g_Flag>,
8774  HelpText<"Like /Z7">;
8775def _SLASH_Zp : CLJoined<"Zp">,
8776  HelpText<"Set default maximum struct packing alignment">,
8777  Alias<fpack_struct_EQ>;
8778def _SLASH_Zp_flag : CLFlag<"Zp">,
8779  HelpText<"Set default maximum struct packing alignment to 1">,
8780  Alias<fpack_struct_EQ>, AliasArgs<["1"]>;
8781def _SLASH_Zs : CLFlag<"Zs">, HelpText<"Run the preprocessor, parser and semantic analysis stages">,
8782  Alias<fsyntax_only>;
8783def _SLASH_openmp_ : CLFlag<"openmp-">,
8784  HelpText<"Disable OpenMP support">, Alias<fno_openmp>;
8785def _SLASH_openmp : CLFlag<"openmp">, HelpText<"Enable OpenMP support">,
8786  Alias<fopenmp>;
8787def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">,
8788  HelpText<"Enable OpenMP support with experimental SIMD support">,
8789  Alias<fopenmp>;
8790def _SLASH_tune : CLCompileJoined<"tune:">,
8791  HelpText<"Set CPU for optimization without affecting instruction set">,
8792  Alias<mtune_EQ>;
8793def _SLASH_QIntel_jcc_erratum : CLFlag<"QIntel-jcc-erratum">,
8794  HelpText<"Align branches within 32-byte boundaries to mitigate the performance impact of the Intel JCC erratum.">,
8795  Alias<mbranches_within_32B_boundaries>;
8796def _SLASH_arm64EC : CLFlag<"arm64EC">,
8797  HelpText<"Set build target to arm64ec">;
8798def : CLFlag<"Qgather-">, Alias<mno_gather>,
8799      HelpText<"Disable generation of gather instructions in auto-vectorization(x86 only)">;
8800def : CLFlag<"Qscatter-">, Alias<mno_scatter>,
8801      HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;
8802
8803// Non-aliases:
8804
8805def _SLASH_arch : CLCompileJoined<"arch:">,
8806  HelpText<"Set architecture for code generation">;
8807
8808def _SLASH_M_Group : OptionGroup<"</M group>">, Group<cl_compile_Group>;
8809def _SLASH_volatile_Group : OptionGroup<"</volatile group>">,
8810  Group<cl_compile_Group>;
8811
8812def _SLASH_EH : CLJoined<"EH">, HelpText<"Set exception handling model">;
8813def _SLASH_EP : CLFlag<"EP">,
8814  HelpText<"Disable linemarker output and preprocess to stdout">;
8815def _SLASH_external_env : CLJoined<"external:env:">,
8816  HelpText<"Add dirs in env var <var> to include search path with warnings suppressed">,
8817  MetaVarName<"<var>">;
8818def _SLASH_FA : CLJoined<"FA">,
8819  HelpText<"Output assembly code file during compilation">;
8820def _SLASH_Fa : CLJoined<"Fa">,
8821  HelpText<"Set assembly output file name (with /FA)">,
8822  MetaVarName<"<file or dir/>">;
8823def _SLASH_FI : CLJoinedOrSeparate<"FI">,
8824  HelpText<"Include file before parsing">, Alias<include_>;
8825def _SLASH_Fe : CLJoined<"Fe">,
8826  HelpText<"Set output executable file name">,
8827  MetaVarName<"<file or dir/>">;
8828def _SLASH_Fe_COLON : CLJoinedOrSeparate<"Fe:">, Alias<_SLASH_Fe>;
8829def _SLASH_Fi : CLCompileJoined<"Fi">,
8830  HelpText<"Set preprocess output file name (with /P)">,
8831  MetaVarName<"<file>">;
8832def _SLASH_Fi_COLON : CLJoinedOrSeparate<"Fi:">, Alias<_SLASH_Fi>;
8833def _SLASH_Fo : CLCompileJoined<"Fo">,
8834  HelpText<"Set output object file (with /c)">,
8835  MetaVarName<"<file or dir/>">;
8836def _SLASH_Fo_COLON : CLCompileJoinedOrSeparate<"Fo:">, Alias<_SLASH_Fo>;
8837def _SLASH_guard : CLJoined<"guard:">,
8838  HelpText<"Enable Control Flow Guard with /guard:cf, or only the table with /guard:cf,nochecks. "
8839           "Enable EH Continuation Guard with /guard:ehcont">;
8840def _SLASH_GX : CLFlag<"GX">,
8841  HelpText<"Deprecated; use /EHsc">;
8842def _SLASH_GX_ : CLFlag<"GX-">,
8843  HelpText<"Deprecated (like not passing /EH)">;
8844def _SLASH_imsvc : CLJoinedOrSeparate<"imsvc">,
8845  HelpText<"Add <dir> to system include search path, as if in %INCLUDE%">,
8846  MetaVarName<"<dir>">;
8847def _SLASH_JMC : CLFlag<"JMC">, Alias<fjmc>,
8848  HelpText<"Enable just-my-code debugging">;
8849def _SLASH_JMC_ : CLFlag<"JMC-">, Alias<fno_jmc>,
8850  HelpText<"Disable just-my-code debugging (default)">;
8851def _SLASH_LD : CLFlag<"LD">, HelpText<"Create DLL">;
8852def _SLASH_LDd : CLFlag<"LDd">, HelpText<"Create debug DLL">;
8853def _SLASH_link : CLRemainingArgsJoined<"link">,
8854  HelpText<"Forward options to the linker">, MetaVarName<"<options>">;
8855def _SLASH_MD : Option<["/", "-"], "MD", KIND_FLAG>, Group<_SLASH_M_Group>,
8856  Flags<[NoXarchOption]>, Visibility<[CLOption]>, HelpText<"Use DLL run-time">;
8857def _SLASH_MDd : Option<["/", "-"], "MDd", KIND_FLAG>, Group<_SLASH_M_Group>,
8858  Flags<[NoXarchOption]>, Visibility<[CLOption]>,
8859  HelpText<"Use DLL debug run-time">;
8860def _SLASH_MT : Option<["/", "-"], "MT", KIND_FLAG>, Group<_SLASH_M_Group>,
8861  Flags<[NoXarchOption]>, Visibility<[CLOption]>,
8862  HelpText<"Use static run-time">;
8863def _SLASH_MTd : Option<["/", "-"], "MTd", KIND_FLAG>, Group<_SLASH_M_Group>,
8864  Flags<[NoXarchOption]>, Visibility<[CLOption]>,
8865  HelpText<"Use static debug run-time">;
8866def _SLASH_o : CLJoinedOrSeparate<"o">,
8867  HelpText<"Deprecated (set output file name); use /Fe or /Fe">,
8868  MetaVarName<"<file or dir/>">;
8869def _SLASH_P : CLFlag<"P">, HelpText<"Preprocess to file">;
8870def _SLASH_permissive : CLFlag<"permissive">,
8871  HelpText<"Enable some non conforming code to compile">;
8872def _SLASH_permissive_ : CLFlag<"permissive-">,
8873  HelpText<"Disable non conforming code from compiling (default)">;
8874def _SLASH_Tc : CLCompileJoinedOrSeparate<"Tc">,
8875  HelpText<"Treat <file> as C source file">, MetaVarName<"<file>">;
8876def _SLASH_TC : CLCompileFlag<"TC">, HelpText<"Treat all source files as C">;
8877def _SLASH_Tp : CLCompileJoinedOrSeparate<"Tp">,
8878  HelpText<"Treat <file> as C++ source file">, MetaVarName<"<file>">;
8879def _SLASH_TP : CLCompileFlag<"TP">, HelpText<"Treat all source files as C++">;
8880def _SLASH_diasdkdir : CLJoinedOrSeparate<"diasdkdir">,
8881  HelpText<"Path to the DIA SDK">, MetaVarName<"<dir>">;
8882def _SLASH_vctoolsdir : CLJoinedOrSeparate<"vctoolsdir">,
8883  HelpText<"Path to the VCToolChain">, MetaVarName<"<dir>">;
8884def _SLASH_vctoolsversion : CLJoinedOrSeparate<"vctoolsversion">,
8885  HelpText<"For use with /winsysroot, defaults to newest found">;
8886def _SLASH_winsdkdir : CLJoinedOrSeparate<"winsdkdir">,
8887  HelpText<"Path to the Windows SDK">, MetaVarName<"<dir>">;
8888def _SLASH_winsdkversion : CLJoinedOrSeparate<"winsdkversion">,
8889  HelpText<"Full version of the Windows SDK, defaults to newest found">;
8890def _SLASH_winsysroot : CLJoinedOrSeparate<"winsysroot">,
8891  HelpText<"Same as \"/diasdkdir <dir>/DIA SDK\" /vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsversion> \"/winsdkdir <dir>/Windows Kits/10\"">,
8892  MetaVarName<"<dir>">;
8893def _SLASH_volatile_iso : Option<["/", "-"], "volatile:iso", KIND_FLAG>,
8894  Visibility<[CLOption]>, Alias<fno_ms_volatile>,
8895  HelpText<"Volatile loads and stores have standard semantics">;
8896def _SLASH_vmb : CLFlag<"vmb">,
8897  HelpText<"Use a best-case representation method for member pointers">;
8898def _SLASH_vmg : CLFlag<"vmg">,
8899  HelpText<"Use a most-general representation for member pointers">;
8900def _SLASH_vms : CLFlag<"vms">,
8901  HelpText<"Set the default most-general representation to single inheritance">;
8902def _SLASH_vmm : CLFlag<"vmm">,
8903  HelpText<"Set the default most-general representation to "
8904           "multiple inheritance">;
8905def _SLASH_vmv : CLFlag<"vmv">,
8906  HelpText<"Set the default most-general representation to "
8907           "virtual inheritance">;
8908def _SLASH_volatile_ms  : Option<["/", "-"], "volatile:ms", KIND_FLAG>,
8909  Visibility<[CLOption]>, Alias<fms_volatile>,
8910  HelpText<"Volatile loads and stores have acquire and release semantics">;
8911def _SLASH_clang : CLJoined<"clang:">,
8912  HelpText<"Pass <arg> to the clang driver">, MetaVarName<"<arg>">;
8913def _SLASH_Zl : CLFlag<"Zl">, Alias<fms_omit_default_lib>,
8914  HelpText<"Do not let object file auto-link default libraries">;
8915
8916def _SLASH_Yc : CLJoined<"Yc">,
8917  HelpText<"Generate a pch file for all code up to and including <filename>">,
8918  MetaVarName<"<filename>">;
8919def _SLASH_Yu : CLJoined<"Yu">,
8920  HelpText<"Load a pch file and use it instead of all code up to "
8921           "and including <filename>">,
8922  MetaVarName<"<filename>">;
8923def _SLASH_Y_ : CLFlag<"Y-">,
8924  HelpText<"Disable precompiled headers, overrides /Yc and /Yu">;
8925def _SLASH_Zc_dllexportInlines : CLFlag<"Zc:dllexportInlines">,
8926  HelpText<"dllexport/dllimport inline member functions of dllexport/import classes (default)">;
8927def _SLASH_Zc_dllexportInlines_ : CLFlag<"Zc:dllexportInlines-">,
8928  HelpText<"Do not dllexport/dllimport inline member functions of dllexport/import classes">;
8929def _SLASH_Fp : CLJoined<"Fp">,
8930  HelpText<"Set pch file name (with /Yc and /Yu)">, MetaVarName<"<file>">;
8931def _SLASH_Fp_COLON : CLJoinedOrSeparate<"Fp:">, Alias<_SLASH_Fp>;
8932
8933def _SLASH_Gd : CLFlag<"Gd">,
8934  HelpText<"Set __cdecl as a default calling convention">;
8935def _SLASH_Gr : CLFlag<"Gr">,
8936  HelpText<"Set __fastcall as a default calling convention">;
8937def _SLASH_Gz : CLFlag<"Gz">,
8938  HelpText<"Set __stdcall as a default calling convention">;
8939def _SLASH_Gv : CLFlag<"Gv">,
8940  HelpText<"Set __vectorcall as a default calling convention">;
8941def _SLASH_Gregcall : CLFlag<"Gregcall">,
8942  HelpText<"Set __regcall as a default calling convention">;
8943def _SLASH_Gregcall4 : CLFlag<"Gregcall4">,
8944  HelpText<"Set __regcall4 as a default calling convention to respect __regcall ABI v.4">;
8945
8946// GNU Driver aliases
8947
8948def : Separate<["-"], "Xmicrosoft-visualc-tools-root">, Alias<_SLASH_vctoolsdir>;
8949def : Separate<["-"], "Xmicrosoft-visualc-tools-version">,
8950    Alias<_SLASH_vctoolsversion>;
8951def : Separate<["-"], "Xmicrosoft-windows-sdk-root">,
8952    Alias<_SLASH_winsdkdir>;
8953def : Separate<["-"], "Xmicrosoft-windows-sdk-version">,
8954    Alias<_SLASH_winsdkversion>;
8955def : Separate<["-"], "Xmicrosoft-windows-sys-root">,
8956    Alias<_SLASH_winsysroot>;
8957
8958// Ignored:
8959
8960def _SLASH_analyze_ : CLIgnoredFlag<"analyze-">;
8961def _SLASH_bigobj : CLIgnoredFlag<"bigobj">;
8962def _SLASH_cgthreads : CLIgnoredJoined<"cgthreads">;
8963def _SLASH_d2FastFail : CLIgnoredFlag<"d2FastFail">;
8964def _SLASH_d2Zi_PLUS : CLIgnoredFlag<"d2Zi+">;
8965def _SLASH_errorReport : CLIgnoredJoined<"errorReport">;
8966def _SLASH_FC : CLIgnoredFlag<"FC">;
8967def _SLASH_Fd : CLIgnoredJoined<"Fd">;
8968def _SLASH_FS : CLIgnoredFlag<"FS">;
8969def _SLASH_kernel_ : CLIgnoredFlag<"kernel-">;
8970def _SLASH_nologo : CLIgnoredFlag<"nologo">;
8971def _SLASH_RTC : CLIgnoredJoined<"RTC">;
8972def _SLASH_sdl : CLIgnoredFlag<"sdl">;
8973def _SLASH_sdl_ : CLIgnoredFlag<"sdl-">;
8974def _SLASH_utf8 : CLIgnoredFlag<"utf-8">,
8975  HelpText<"Set source and runtime encoding to UTF-8 (default)">;
8976def _SLASH_w : CLIgnoredJoined<"w">;
8977def _SLASH_Wv_ : CLIgnoredJoined<"Wv">;
8978def _SLASH_Zc___cplusplus : CLIgnoredFlag<"Zc:__cplusplus">;
8979def _SLASH_Zc_auto : CLIgnoredFlag<"Zc:auto">;
8980def _SLASH_Zc_forScope : CLIgnoredFlag<"Zc:forScope">;
8981def _SLASH_Zc_inline : CLIgnoredFlag<"Zc:inline">;
8982def _SLASH_Zc_rvalueCast : CLIgnoredFlag<"Zc:rvalueCast">;
8983def _SLASH_Zc_ternary : CLIgnoredFlag<"Zc:ternary">;
8984def _SLASH_Zm : CLIgnoredJoined<"Zm">;
8985def _SLASH_Zo : CLIgnoredFlag<"Zo">;
8986def _SLASH_Zo_ : CLIgnoredFlag<"Zo-">;
8987
8988
8989// Unsupported:
8990
8991def _SLASH_await : CLFlag<"await">;
8992def _SLASH_await_COLON : CLJoined<"await:">;
8993def _SLASH_constexpr : CLJoined<"constexpr:">;
8994def _SLASH_AI : CLJoinedOrSeparate<"AI">;
8995def _SLASH_Bt : CLFlag<"Bt">;
8996def _SLASH_Bt_plus : CLFlag<"Bt+">;
8997def _SLASH_clr : CLJoined<"clr">;
8998def _SLASH_d1 : CLJoined<"d1">;
8999def _SLASH_d2 : CLJoined<"d2">;
9000def _SLASH_doc : CLJoined<"doc">;
9001def _SLASH_experimental : CLJoined<"experimental:">;
9002def _SLASH_exportHeader : CLFlag<"exportHeader">;
9003def _SLASH_external : CLJoined<"external:">;
9004def _SLASH_favor : CLJoined<"favor">;
9005def _SLASH_fsanitize_address_use_after_return : CLJoined<"fsanitize-address-use-after-return">;
9006def _SLASH_fno_sanitize_address_vcasan_lib : CLJoined<"fno-sanitize-address-vcasan-lib">;
9007def _SLASH_F : CLJoinedOrSeparate<"F">;
9008def _SLASH_Fm : CLJoined<"Fm">;
9009def _SLASH_Fr : CLJoined<"Fr">;
9010def _SLASH_FR : CLJoined<"FR">;
9011def _SLASH_FU : CLJoinedOrSeparate<"FU">;
9012def _SLASH_Fx : CLFlag<"Fx">;
9013def _SLASH_G1 : CLFlag<"G1">;
9014def _SLASH_G2 : CLFlag<"G2">;
9015def _SLASH_Ge : CLFlag<"Ge">;
9016def _SLASH_Gh : CLFlag<"Gh">;
9017def _SLASH_GH : CLFlag<"GH">;
9018def _SLASH_GL : CLFlag<"GL">;
9019def _SLASH_GL_ : CLFlag<"GL-">;
9020def _SLASH_Gm : CLFlag<"Gm">;
9021def _SLASH_Gm_ : CLFlag<"Gm-">;
9022def _SLASH_GT : CLFlag<"GT">;
9023def _SLASH_GZ : CLFlag<"GZ">;
9024def _SLASH_H : CLFlag<"H">;
9025def _SLASH_headername : CLJoined<"headerName:">;
9026def _SLASH_headerUnit : CLJoinedOrSeparate<"headerUnit">;
9027def _SLASH_headerUnitAngle : CLJoinedOrSeparate<"headerUnit:angle">;
9028def _SLASH_headerUnitQuote : CLJoinedOrSeparate<"headerUnit:quote">;
9029def _SLASH_homeparams : CLFlag<"homeparams">;
9030def _SLASH_kernel : CLFlag<"kernel">;
9031def _SLASH_LN : CLFlag<"LN">;
9032def _SLASH_MP : CLJoined<"MP">;
9033def _SLASH_Qfast_transcendentals : CLFlag<"Qfast_transcendentals">;
9034def _SLASH_QIfist : CLFlag<"QIfist">;
9035def _SLASH_Qimprecise_fwaits : CLFlag<"Qimprecise_fwaits">;
9036def _SLASH_Qpar : CLFlag<"Qpar">;
9037def _SLASH_Qpar_report : CLJoined<"Qpar-report">;
9038def _SLASH_Qsafe_fp_loads : CLFlag<"Qsafe_fp_loads">;
9039def _SLASH_Qspectre : CLFlag<"Qspectre">;
9040def _SLASH_Qspectre_load : CLFlag<"Qspectre-load">;
9041def _SLASH_Qspectre_load_cf : CLFlag<"Qspectre-load-cf">;
9042def _SLASH_Qvec_report : CLJoined<"Qvec-report">;
9043def _SLASH_reference : CLJoinedOrSeparate<"reference">;
9044def _SLASH_sourceDependencies : CLJoinedOrSeparate<"sourceDependencies">;
9045def _SLASH_sourceDependenciesDirectives : CLJoinedOrSeparate<"sourceDependencies:directives">;
9046def _SLASH_translateInclude : CLFlag<"translateInclude">;
9047def _SLASH_u : CLFlag<"u">;
9048def _SLASH_V : CLFlag<"V">;
9049def _SLASH_WL : CLFlag<"WL">;
9050def _SLASH_Wp64 : CLFlag<"Wp64">;
9051def _SLASH_Yd : CLFlag<"Yd">;
9052def _SLASH_Yl : CLJoined<"Yl">;
9053def _SLASH_Za : CLFlag<"Za">;
9054def _SLASH_Zc : CLJoined<"Zc:">;
9055def _SLASH_Ze : CLFlag<"Ze">;
9056def _SLASH_Zg : CLFlag<"Zg">;
9057def _SLASH_ZI : CLFlag<"ZI">;
9058def _SLASH_ZW : CLJoined<"ZW">;
9059
9060//===----------------------------------------------------------------------===//
9061// clang-dxc Options
9062//===----------------------------------------------------------------------===//
9063
9064def dxc_Group : OptionGroup<"clang-dxc options">, Visibility<[DXCOption]>,
9065  HelpText<"dxc compatibility options.">;
9066class DXCFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
9067  Group<dxc_Group>, Visibility<[DXCOption]>;
9068class DXCJoinedOrSeparate<string name> : Option<["/", "-"], name,
9069  KIND_JOINED_OR_SEPARATE>, Group<dxc_Group>,
9070  Visibility<[DXCOption]>;
9071
9072def dxc_no_stdinc : DXCFlag<"hlsl-no-stdinc">,
9073  HelpText<"HLSL only. Disables all standard includes containing non-native compiler types and functions.">;
9074def dxc_Fo : DXCJoinedOrSeparate<"Fo">,
9075  HelpText<"Output object file">;
9076def dxc_Fc : DXCJoinedOrSeparate<"Fc">,
9077  HelpText<"Output assembly listing file">;
9078def dxil_validator_version : Option<["/", "-"], "validator-version", KIND_SEPARATE>,
9079  Group<dxc_Group>, Flags<[HelpHidden]>,
9080  Visibility<[DXCOption, ClangOption, CC1Option]>,
9081  HelpText<"Override validator version for module. Format: <major.minor>;"
9082           "Default: DXIL.dll version or current internal version">,
9083  MarshallingInfoString<TargetOpts<"DxilValidatorVersion">, "\"1.8\"">;
9084def target_profile : DXCJoinedOrSeparate<"T">, MetaVarName<"<profile>">,
9085  HelpText<"Set target profile">,
9086  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,"
9087         "vs_6_0, vs_6_1, vs_6_2, vs_6_3, vs_6_4, vs_6_5, vs_6_6, vs_6_7,"
9088         "gs_6_0, gs_6_1, gs_6_2, gs_6_3, gs_6_4, gs_6_5, gs_6_6, gs_6_7,"
9089         "hs_6_0, hs_6_1, hs_6_2, hs_6_3, hs_6_4, hs_6_5, hs_6_6, hs_6_7,"
9090         "ds_6_0, ds_6_1, ds_6_2, ds_6_3, ds_6_4, ds_6_5, ds_6_6, ds_6_7,"
9091         "cs_6_0, cs_6_1, cs_6_2, cs_6_3, cs_6_4, cs_6_5, cs_6_6, cs_6_7,"
9092         "lib_6_3, lib_6_4, lib_6_5, lib_6_6, lib_6_7, lib_6_x,"
9093         "ms_6_5, ms_6_6, ms_6_7,"
9094         "as_6_5, as_6_6, as_6_7">;
9095def emit_pristine_llvm : DXCFlag<"emit-pristine-llvm">,
9096  HelpText<"Emit pristine LLVM IR from the frontend by not running any LLVM passes at all."
9097           "Same as -S + -emit-llvm + -disable-llvm-passes.">;
9098def fcgl : DXCFlag<"fcgl">, Alias<emit_pristine_llvm>;
9099def enable_16bit_types : DXCFlag<"enable-16bit-types">, Alias<fnative_half_type>,
9100  HelpText<"Enable 16-bit types and disable min precision types."
9101           "Available in HLSL 2018 and shader model 6.2.">;
9102def hlsl_entrypoint : Option<["-"], "hlsl-entry", KIND_SEPARATE>,
9103                      Group<dxc_Group>,
9104                      Visibility<[ClangOption, CC1Option]>,
9105                      MarshallingInfoString<TargetOpts<"HLSLEntry">, "\"main\"">,
9106                      HelpText<"Entry point name for hlsl">;
9107def dxc_entrypoint : Option<["--", "/", "-"], "E", KIND_JOINED_OR_SEPARATE>,
9108                     Group<dxc_Group>,
9109                     Visibility<[DXCOption]>,
9110                     HelpText<"Entry point name">;
9111def dxc_hlsl_version : Option<["/", "-"], "HV", KIND_JOINED_OR_SEPARATE>,
9112                     Group<dxc_Group>,
9113                     Visibility<[DXCOption]>,
9114                     HelpText<"HLSL Version">,
9115                     Values<"2016, 2017, 2018, 2021, 202x, 202y">;
9116def dxc_validator_path_EQ : Joined<["--"], "dxv-path=">, Group<dxc_Group>,
9117  HelpText<"DXIL validator installation path">;
9118def dxc_disable_validation : DXCFlag<"Vd">,
9119  HelpText<"Disable validation">;
9120def : Option<["/", "-"], "Qembed_debug", KIND_FLAG>, Group<dxc_Group>,
9121  Flags<[Ignored]>, Visibility<[DXCOption]>,
9122  HelpText<"Embed PDB in shader container (ignored)">;
9123def spirv : DXCFlag<"spirv">,
9124  HelpText<"Generate SPIR-V code">;
9125def fspv_target_env_EQ : Joined<["-"], "fspv-target-env=">, Group<dxc_Group>,
9126  HelpText<"Specify the target environment">,
9127  Values<"vulkan1.2, vulkan1.3">;
9128def no_wasm_opt : Flag<["--"], "no-wasm-opt">,
9129  Group<m_Group>,
9130  HelpText<"Disable the wasm-opt optimizer">,
9131  MarshallingInfoFlag<LangOpts<"NoWasmOpt">>;
9132def wasm_opt : Flag<["--"], "wasm-opt">,
9133  Group<m_Group>,
9134  HelpText<"Enable the wasm-opt optimizer (default)">,
9135  MarshallingInfoNegativeFlag<LangOpts<"NoWasmOpt">>;
9136