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/////////
17// Flags
18
19// The option is a "driver"-only option, and should not be forwarded to other
20// tools via `-Xarch` options.
21def NoXarchOption : OptionFlag;
22
23// LinkerInput - The option is a linker input.
24def LinkerInput : OptionFlag;
25
26// NoArgumentUnused - Don't report argument unused warnings for this option; this
27// is useful for options like -static or -dynamic which a user may always end up
28// passing, even if the platform defaults to (or only supports) that option.
29def NoArgumentUnused : OptionFlag;
30
31// Unsupported - The option is unsupported, and the driver will reject command
32// lines that use it.
33def Unsupported : OptionFlag;
34
35// Ignored - The option is unsupported, and the driver will silently ignore it.
36def Ignored : OptionFlag;
37
38// CoreOption - This is considered a "core" Clang option, available in both
39// clang and clang-cl modes.
40def CoreOption : OptionFlag;
41
42// CLOption - This is a cl.exe compatibility option. Options with this flag
43// are made available when the driver is running in CL compatibility mode.
44def CLOption : OptionFlag;
45
46// CC1Option - This option should be accepted by clang -cc1.
47def CC1Option : OptionFlag;
48
49// CC1AsOption - This option should be accepted by clang -cc1as.
50def CC1AsOption : OptionFlag;
51
52// NoDriverOption - This option should not be accepted by the driver.
53def NoDriverOption : OptionFlag;
54
55// If an option affects linking, but has a primary group (so Link_Group cannot
56// be used), add this flag.
57def LinkOption : OptionFlag;
58
59// FlangOption - This is considered a "core" Flang option, available in
60// flang mode.
61def FlangOption : OptionFlag;
62
63// FlangOnlyOption - This option should only be used by Flang (i.e. it is not
64// available for Clang)
65def FlangOnlyOption : OptionFlag;
66
67// FC1Option - This option should be accepted by flang -fc1.
68def FC1Option : OptionFlag;
69
70// A short name to show in documentation. The name will be interpreted as rST.
71class DocName<string name> { string DocName = name; }
72
73// A brief description to show in documentation, interpreted as rST.
74class DocBrief<code descr> { code DocBrief = descr; }
75
76// Indicates that this group should be flattened into its parent when generating
77// documentation.
78class DocFlatten { bit DocFlatten = 1; }
79
80// Indicates that this warning is ignored, but accepted with a warning for
81// GCC compatibility.
82class IgnoredGCCCompat : Flags<[HelpHidden]> {}
83
84/////////
85// Groups
86
87def Action_Group : OptionGroup<"<action group>">, DocName<"Actions">,
88                   DocBrief<[{The action to perform on the input.}]>;
89
90// Meta-group for options which are only used for compilation,
91// and not linking etc.
92def CompileOnly_Group : OptionGroup<"<CompileOnly group>">,
93                        DocName<"Compilation flags">, DocBrief<[{
94Flags controlling the behavior of Clang during compilation. These flags have
95no effect during actions that do not perform compilation.}]>;
96
97def Preprocessor_Group : OptionGroup<"<Preprocessor group>">,
98                         Group<CompileOnly_Group>,
99                         DocName<"Preprocessor flags">, DocBrief<[{
100Flags controlling the behavior of the Clang preprocessor.}]>;
101
102def IncludePath_Group : OptionGroup<"<I/i group>">, Group<Preprocessor_Group>,
103                        DocName<"Include path management">,
104                        DocBrief<[{
105Flags controlling how ``#include``\s are resolved to files.}]>;
106
107def I_Group : OptionGroup<"<I group>">, Group<IncludePath_Group>, DocFlatten;
108def i_Group : OptionGroup<"<i group>">, Group<IncludePath_Group>, DocFlatten;
109def clang_i_Group : OptionGroup<"<clang i group>">, Group<i_Group>, DocFlatten;
110
111def M_Group : OptionGroup<"<M group>">, Group<Preprocessor_Group>,
112              DocName<"Dependency file generation">, DocBrief<[{
113Flags controlling generation of a dependency file for ``make``-like build
114systems.}]>;
115
116def d_Group : OptionGroup<"<d group>">, Group<Preprocessor_Group>,
117              DocName<"Dumping preprocessor state">, DocBrief<[{
118Flags allowing the state of the preprocessor to be dumped in various ways.}]>;
119
120def Diag_Group : OptionGroup<"<W/R group>">, Group<CompileOnly_Group>,
121                 DocName<"Diagnostic flags">, DocBrief<[{
122Flags controlling which warnings, errors, and remarks Clang will generate.
123See the :doc:`full list of warning and remark flags <DiagnosticsReference>`.}]>;
124
125def R_Group : OptionGroup<"<R group>">, Group<Diag_Group>, DocFlatten;
126def R_value_Group : OptionGroup<"<R (with value) group>">, Group<R_Group>,
127                    DocFlatten;
128def W_Group : OptionGroup<"<W group>">, Group<Diag_Group>, DocFlatten;
129def W_value_Group : OptionGroup<"<W (with value) group>">, Group<W_Group>,
130                    DocFlatten;
131
132def f_Group : OptionGroup<"<f group>">, Group<CompileOnly_Group>,
133              DocName<"Target-independent compilation options">;
134
135def f_clang_Group : OptionGroup<"<f (clang-only) group>">,
136                    Group<CompileOnly_Group>, DocFlatten;
137def pedantic_Group : OptionGroup<"<pedantic group>">, Group<f_Group>,
138                     DocFlatten;
139def opencl_Group : OptionGroup<"<opencl group>">, Group<f_Group>,
140                   DocName<"OpenCL flags">;
141
142def sycl_Group : OptionGroup<"<SYCL group>">, Group<f_Group>,
143                 DocName<"SYCL flags">;
144
145def m_Group : OptionGroup<"<m group>">, Group<CompileOnly_Group>,
146              DocName<"Target-dependent compilation options">;
147
148// Feature groups - these take command line options that correspond directly to
149// target specific features and can be translated directly from command line
150// options.
151def m_aarch64_Features_Group : OptionGroup<"<aarch64 features group>">,
152                               Group<m_Group>, DocName<"AARCH64">;
153def m_amdgpu_Features_Group : OptionGroup<"<amdgpu features group>">,
154                              Group<m_Group>, DocName<"AMDGPU">;
155def m_arm_Features_Group : OptionGroup<"<arm features group>">,
156                           Group<m_Group>, DocName<"ARM">;
157def m_hexagon_Features_Group : OptionGroup<"<hexagon features group>">,
158                               Group<m_Group>, DocName<"Hexagon">;
159// The features added by this group will not be added to target features.
160// These are explicitly handled.
161def m_hexagon_Features_HVX_Group : OptionGroup<"<hexagon features group>">,
162                                   Group<m_Group>, DocName<"Hexagon">;
163def m_m68k_Features_Group: OptionGroup<"<m68k features group>">,
164                           Group<m_Group>, DocName<"M68k">;
165def m_mips_Features_Group : OptionGroup<"<mips features group>">,
166                            Group<m_Group>, DocName<"MIPS">;
167def m_ppc_Features_Group : OptionGroup<"<ppc features group>">,
168                           Group<m_Group>, DocName<"PowerPC">;
169def m_wasm_Features_Group : OptionGroup<"<wasm features group>">,
170                            Group<m_Group>, DocName<"WebAssembly">;
171// The features added by this group will not be added to target features.
172// These are explicitly handled.
173def m_wasm_Features_Driver_Group : OptionGroup<"<wasm driver features group>">,
174                                   Group<m_Group>, DocName<"WebAssembly Driver">;
175def m_x86_Features_Group : OptionGroup<"<x86 features group>">,
176                           Group<m_Group>, Flags<[CoreOption]>, DocName<"X86">;
177def m_riscv_Features_Group : OptionGroup<"<riscv features group>">,
178                             Group<m_Group>, DocName<"RISCV">;
179
180def m_libc_Group : OptionGroup<"<m libc group>">, Group<m_mips_Features_Group>,
181                   Flags<[HelpHidden]>;
182
183def O_Group : OptionGroup<"<O group>">, Group<CompileOnly_Group>,
184              DocName<"Optimization level">, DocBrief<[{
185Flags controlling how much optimization should be performed.}]>;
186
187def DebugInfo_Group : OptionGroup<"<g group>">, Group<CompileOnly_Group>,
188                      DocName<"Debug information generation">, DocBrief<[{
189Flags controlling how much and what kind of debug information should be
190generated.}]>;
191
192def g_Group : OptionGroup<"<g group>">, Group<DebugInfo_Group>,
193              DocName<"Kind and level of debug information">;
194def gN_Group : OptionGroup<"<gN group>">, Group<g_Group>,
195               DocName<"Debug level">;
196def ggdbN_Group : OptionGroup<"<ggdbN group>">, Group<gN_Group>, DocFlatten;
197def gTune_Group : OptionGroup<"<gTune group>">, Group<g_Group>,
198                  DocName<"Debugger to tune debug information for">;
199def g_flags_Group : OptionGroup<"<g flags group>">, Group<DebugInfo_Group>,
200                    DocName<"Debug information flags">;
201
202def StaticAnalyzer_Group : OptionGroup<"<Static analyzer group>">,
203                           DocName<"Static analyzer flags">, DocBrief<[{
204Flags controlling the behavior of the Clang Static Analyzer.}]>;
205
206// gfortran options that we recognize in the driver and pass along when
207// invoking GCC to compile Fortran code.
208def gfortran_Group : OptionGroup<"<gfortran group>">,
209                     DocName<"Fortran compilation flags">, DocBrief<[{
210Flags that will be passed onto the ``gfortran`` compiler when Clang is given
211a Fortran input.}]>;
212
213def Link_Group : OptionGroup<"<T/e/s/t/u group>">, DocName<"Linker flags">,
214                 DocBrief<[{Flags that are passed on to the linker}]>;
215def T_Group : OptionGroup<"<T group>">, Group<Link_Group>, DocFlatten;
216def u_Group : OptionGroup<"<u group>">, Group<Link_Group>, DocFlatten;
217
218def reserved_lib_Group : OptionGroup<"<reserved libs group>">,
219                         Flags<[Unsupported]>;
220
221// Temporary groups for clang options which we know we don't support,
222// but don't want to verbosely warn the user about.
223def clang_ignored_f_Group : OptionGroup<"<clang ignored f group>">,
224  Group<f_Group>, Flags<[Ignored]>;
225def clang_ignored_m_Group : OptionGroup<"<clang ignored m group>">,
226  Group<m_Group>, Flags<[Ignored]>;
227
228// Group for clang options in the process of deprecation.
229// Please include the version that deprecated the flag as comment to allow
230// easier garbage collection.
231def clang_ignored_legacy_options_Group : OptionGroup<"<clang legacy flags>">,
232  Group<f_Group>, Flags<[Ignored]>;
233
234// Retired with clang-5.0
235def : Flag<["-"], "fslp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;
236def : Flag<["-"], "fno-slp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;
237
238// Retired with clang-10.0. Previously controlled X86 MPX ISA.
239def mmpx : Flag<["-"], "mmpx">, Group<clang_ignored_legacy_options_Group>;
240def mno_mpx : Flag<["-"], "mno-mpx">, Group<clang_ignored_legacy_options_Group>;
241
242// Group that ignores all gcc optimizations that won't be implemented
243def clang_ignored_gcc_optimization_f_Group : OptionGroup<
244  "<clang_ignored_gcc_optimization_f_Group>">, Group<f_Group>, Flags<[Ignored]>;
245
246class DiagnosticOpts<string base>
247  : KeyPathAndMacro<"DiagnosticOpts->", base, "DIAG_"> {}
248class LangOpts<string base>
249  : KeyPathAndMacro<"LangOpts->", base, "LANG_"> {}
250class TargetOpts<string base>
251  : KeyPathAndMacro<"TargetOpts->", base, "TARGET_"> {}
252class FrontendOpts<string base>
253  : KeyPathAndMacro<"FrontendOpts.", base, "FRONTEND_"> {}
254class PreprocessorOutputOpts<string base>
255  : KeyPathAndMacro<"PreprocessorOutputOpts.", base, "PREPROCESSOR_OUTPUT_"> {}
256class DependencyOutputOpts<string base>
257  : KeyPathAndMacro<"DependencyOutputOpts.", base, "DEPENDENCY_OUTPUT_"> {}
258class CodeGenOpts<string base>
259  : KeyPathAndMacro<"CodeGenOpts.", base, "CODEGEN_"> {}
260class HeaderSearchOpts<string base>
261  : KeyPathAndMacro<"HeaderSearchOpts->", base, "HEADER_SEARCH_"> {}
262class PreprocessorOpts<string base>
263  : KeyPathAndMacro<"PreprocessorOpts->", base, "PREPROCESSOR_"> {}
264class FileSystemOpts<string base>
265  : KeyPathAndMacro<"FileSystemOpts.", base, "FILE_SYSTEM_"> {}
266class AnalyzerOpts<string base>
267  : KeyPathAndMacro<"AnalyzerOpts->", base, "ANALYZER_"> {}
268class MigratorOpts<string base>
269  : KeyPathAndMacro<"MigratorOpts.", base, "MIGRATOR_"> {}
270
271// A boolean option which is opt-in in CC1. The positive option exists in CC1 and
272// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
273// This is useful if the option is usually disabled.
274// Use this only when the option cannot be declared via BoolFOption.
275multiclass OptInCC1FFlag<string name, string pos_prefix, string neg_prefix="",
276                      string help="", list<OptionFlag> flags=[]> {
277  def f#NAME : Flag<["-"], "f"#name>, Flags<[CC1Option] # flags>,
278               Group<f_Group>, HelpText<pos_prefix # help>;
279  def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<flags>,
280                  Group<f_Group>, HelpText<neg_prefix # help>;
281}
282
283// A boolean option which is opt-out in CC1. The negative option exists in CC1 and
284// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
285// Use this only when the option cannot be declared via BoolFOption.
286multiclass OptOutCC1FFlag<string name, string pos_prefix, string neg_prefix,
287                       string help="", list<OptionFlag> flags=[]> {
288  def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
289               Group<f_Group>, HelpText<pos_prefix # help>;
290  def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[CC1Option] # flags>,
291                  Group<f_Group>, HelpText<neg_prefix # help>;
292}
293
294// A boolean option which is opt-in in FC1. The positive option exists in FC1 and
295// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
296// This is useful if the option is usually disabled.
297multiclass OptInFC1FFlag<string name, string pos_prefix, string neg_prefix="",
298                      string help="", list<OptionFlag> flags=[]> {
299  def f#NAME : Flag<["-"], "f"#name>, Flags<[FC1Option] # flags>,
300               Group<f_Group>, HelpText<pos_prefix # help>;
301  def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<flags>,
302                  Group<f_Group>, HelpText<neg_prefix # help>;
303}
304
305// A boolean option which is opt-out in FC1. The negative option exists in FC1 and
306// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
307multiclass OptOutFC1FFlag<string name, string pos_prefix, string neg_prefix,
308                       string help="", list<OptionFlag> flags=[]> {
309  def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
310               Group<f_Group>, HelpText<pos_prefix # help>;
311  def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[FC1Option] # flags>,
312                  Group<f_Group>, HelpText<neg_prefix # help>;
313}
314
315// Creates a positive and negative flags where both of them are prefixed with
316// "m", have help text specified for positive and negative option, and a Group
317// optionally specified by the opt_group argument, otherwise Group<m_Group>.
318multiclass SimpleMFlag<string name, string pos_prefix, string neg_prefix,
319                       string help, OptionGroup opt_group = m_Group> {
320  def m#NAME : Flag<["-"], "m"#name>, Group<opt_group>,
321    HelpText<pos_prefix # help>;
322  def mno_#NAME : Flag<["-"], "mno-"#name>, Group<opt_group>,
323    HelpText<neg_prefix # help>;
324}
325
326//===----------------------------------------------------------------------===//
327// BoolOption
328//===----------------------------------------------------------------------===//
329
330// The default value of a marshalled key path.
331class Default<code value> { code Value = value; }
332
333// Convenience variables for boolean defaults.
334def DefaultTrue : Default<"true"> {}
335def DefaultFalse : Default<"false"> {}
336
337// The value set to the key path when the flag is present on the command line.
338class Set<bit value> { bit Value = value; }
339def SetTrue : Set<true> {}
340def SetFalse : Set<false> {}
341
342// Definition of single command line flag. This is an implementation detail, use
343// SetTrueBy or SetFalseBy instead.
344class FlagDef<bit polarity, bit value, list<OptionFlag> option_flags,
345              string help, list<code> implied_by_expressions = []> {
346  // The polarity. Besides spelling, this also decides whether the TableGen
347  // record will be prefixed with "no_".
348  bit Polarity = polarity;
349
350  // The value assigned to key path when the flag is present on command line.
351  bit Value = value;
352
353  // OptionFlags that control visibility of the flag in different tools.
354  list<OptionFlag> OptionFlags = option_flags;
355
356  // The help text associated with the flag.
357  string Help = help;
358
359  // List of expressions that, when true, imply this flag.
360  list<code> ImpliedBy = implied_by_expressions;
361}
362
363// Additional information to be appended to both positive and negative flag.
364class BothFlags<list<OptionFlag> option_flags, string help = ""> {
365  list<OptionFlag> OptionFlags = option_flags;
366  string Help = help;
367}
368
369// Functor that appends the suffix to the base flag definition.
370class ApplySuffix<FlagDef flag, BothFlags suffix> {
371  FlagDef Result
372    = FlagDef<flag.Polarity, flag.Value,
373              flag.OptionFlags # suffix.OptionFlags,
374              flag.Help # suffix.Help, flag.ImpliedBy>;
375}
376
377// Definition of the command line flag with positive spelling, e.g. "-ffoo".
378class PosFlag<Set value, list<OptionFlag> flags = [], string help = "",
379              list<code> implied_by_expressions = []>
380  : FlagDef<true, value.Value, flags, help, implied_by_expressions> {}
381
382// Definition of the command line flag with negative spelling, e.g. "-fno-foo".
383class NegFlag<Set value, list<OptionFlag> flags = [], string help = "",
384              list<code> implied_by_expressions = []>
385  : FlagDef<false, value.Value, flags, help, implied_by_expressions> {}
386
387// Expanded FlagDef that's convenient for creation of TableGen records.
388class FlagDefExpanded<FlagDef flag, string prefix, string name, string spelling>
389  : FlagDef<flag.Polarity, flag.Value, flag.OptionFlags, flag.Help,
390            flag.ImpliedBy> {
391  // Name of the TableGen record.
392  string RecordName = prefix # !if(flag.Polarity, "", "no_") # name;
393
394  // Spelling of the flag.
395  string Spelling = prefix # !if(flag.Polarity, "", "no-") # spelling;
396
397  // Can the flag be implied by another flag?
398  bit CanBeImplied = !not(!empty(flag.ImpliedBy));
399
400  // C++ code that will be assigned to the keypath when the flag is present.
401  code ValueAsCode = !if(flag.Value, "true", "false");
402}
403
404// TableGen record for a single marshalled flag.
405class MarshalledFlagRec<FlagDefExpanded flag, FlagDefExpanded other,
406                        FlagDefExpanded implied, KeyPathAndMacro kpm,
407                        Default default>
408  : Flag<["-"], flag.Spelling>, Flags<flag.OptionFlags>, HelpText<flag.Help>,
409    MarshallingInfoBooleanFlag<kpm, default.Value, flag.ValueAsCode,
410                               other.ValueAsCode, other.RecordName>,
411    ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode> {}
412
413// Generates TableGen records for two command line flags that control the same
414// key path via the marshalling infrastructure.
415// Names of the records consist of the specified prefix, "no_" for the negative
416// flag, and NAME.
417// Used for -cc1 frontend options. Driver-only options do not map to
418// CompilerInvocation.
419multiclass BoolOption<string prefix = "", string spelling_base,
420                      KeyPathAndMacro kpm, Default default,
421                      FlagDef flag1_base, FlagDef flag2_base,
422                      BothFlags suffix = BothFlags<[], "">> {
423  defvar flag1 = FlagDefExpanded<ApplySuffix<flag1_base, suffix>.Result, prefix,
424                                 NAME, spelling_base>;
425
426  defvar flag2 = FlagDefExpanded<ApplySuffix<flag2_base, suffix>.Result, prefix,
427                                 NAME, spelling_base>;
428
429  // The flags must have different polarity, different values, and only
430  // one can be implied.
431  assert !xor(flag1.Polarity, flag2.Polarity),
432         "the flags must have different polarity: flag1: " #
433             flag1.Polarity # ", flag2: " # flag2.Polarity;
434  assert !ne(flag1.Value, flag2.Value),
435         "the flags must have different values: flag1: " #
436             flag1.Value # ", flag2: " # flag2.Value;
437  assert !not(!and(flag1.CanBeImplied, flag2.CanBeImplied)),
438         "only one of the flags can be implied: flag1: " #
439             flag1.CanBeImplied # ", flag2: " # flag2.CanBeImplied;
440
441  defvar implied = !if(flag1.CanBeImplied, flag1, flag2);
442
443  def flag1.RecordName : MarshalledFlagRec<flag1, flag2, implied, kpm, default>;
444  def flag2.RecordName : MarshalledFlagRec<flag2, flag1, implied, kpm, default>;
445}
446
447/// Creates a BoolOption where both of the flags are prefixed with "f", are in
448/// the Group<f_Group>.
449/// Used for -cc1 frontend options. Driver-only options do not map to
450/// CompilerInvocation.
451multiclass BoolFOption<string flag_base, KeyPathAndMacro kpm,
452                       Default default, FlagDef flag1, FlagDef flag2,
453                       BothFlags both = BothFlags<[], "">> {
454  defm NAME : BoolOption<"f", flag_base, kpm, default, flag1, flag2, both>,
455              Group<f_Group>;
456}
457
458// Creates a BoolOption where both of the flags are prefixed with "g" and have
459// the Group<g_Group>.
460// Used for -cc1 frontend options. Driver-only options do not map to
461// CompilerInvocation.
462multiclass BoolGOption<string flag_base, KeyPathAndMacro kpm,
463                       Default default, FlagDef flag1, FlagDef flag2,
464                       BothFlags both = BothFlags<[], "">> {
465  defm NAME : BoolOption<"g", flag_base, kpm, default, flag1, flag2, both>,
466              Group<g_Group>;
467}
468
469// FIXME: Diagnose if target does not support protected visibility.
470class MarshallingInfoVisibility<KeyPathAndMacro kpm, code default>
471  : MarshallingInfoEnum<kpm, default>,
472    Values<"default,hidden,internal,protected">,
473    NormalizedValues<["DefaultVisibility", "HiddenVisibility",
474                      "HiddenVisibility", "ProtectedVisibility"]> {}
475
476// Key paths that are constant during parsing of options with the same key path prefix.
477defvar cplusplus = LangOpts<"CPlusPlus">;
478defvar cpp11 = LangOpts<"CPlusPlus11">;
479defvar cpp17 = LangOpts<"CPlusPlus17">;
480defvar cpp20 = LangOpts<"CPlusPlus20">;
481defvar c99 = LangOpts<"C99">;
482defvar c2x = LangOpts<"C2x">;
483defvar lang_std = LangOpts<"LangStd">;
484defvar open_cl = LangOpts<"OpenCL">;
485defvar cuda = LangOpts<"CUDA">;
486defvar render_script = LangOpts<"RenderScript">;
487defvar hip = LangOpts<"HIP">;
488defvar gnu_mode = LangOpts<"GNUMode">;
489defvar asm_preprocessor = LangOpts<"AsmPreprocessor">;
490
491defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")");
492
493/////////
494// Options
495
496// The internal option ID must be a valid C++ identifier and results in a
497// clang::driver::options::OPT_XX enum constant for XX.
498//
499// We want to unambiguously be able to refer to options from the driver source
500// code, for this reason the option name is mangled into an ID. This mangling
501// isn't guaranteed to have an inverse, but for practical purposes it does.
502//
503// The mangling scheme is to ignore the leading '-', and perform the following
504// substitutions:
505//   _ => __
506//   - => _
507//   / => _SLASH
508//   # => _HASH
509//   ? => _QUESTION
510//   , => _COMMA
511//   = => _EQ
512//   C++ => CXX
513//   . => _
514
515// Developer Driver Options
516
517def internal_Group : OptionGroup<"<clang internal options>">, Flags<[HelpHidden]>;
518def internal_driver_Group : OptionGroup<"<clang driver internal options>">,
519  Group<internal_Group>, HelpText<"DRIVER OPTIONS">;
520def internal_debug_Group :
521  OptionGroup<"<clang debug/development internal options>">,
522  Group<internal_Group>, HelpText<"DEBUG/DEVELOPMENT OPTIONS">;
523
524class InternalDriverOpt : Group<internal_driver_Group>,
525  Flags<[NoXarchOption, HelpHidden]>;
526def driver_mode : Joined<["--"], "driver-mode=">, Group<internal_driver_Group>,
527  Flags<[CoreOption, NoXarchOption, HelpHidden]>,
528  HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', or 'cl'">;
529def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group<internal_driver_Group>,
530  Flags<[CoreOption, NoXarchOption, HelpHidden]>,
531  HelpText<"Set the rsp quoting to either 'posix', or 'windows'">;
532def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, InternalDriverOpt,
533  HelpText<"Name for native GCC compiler">,
534  MetaVarName<"<gcc-path>">;
535
536class InternalDebugOpt : Group<internal_debug_Group>,
537  Flags<[NoXarchOption, HelpHidden, CoreOption]>;
538def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt,
539  HelpText<"Simulate installation in the given directory">;
540def ccc_print_phases : Flag<["-"], "ccc-print-phases">, InternalDebugOpt,
541  HelpText<"Dump list of actions to perform">;
542def ccc_print_bindings : Flag<["-"], "ccc-print-bindings">, InternalDebugOpt,
543  HelpText<"Show bindings of tools to actions">;
544
545def ccc_arcmt_check : Flag<["-"], "ccc-arcmt-check">, InternalDriverOpt,
546  HelpText<"Check for ARC migration issues that need manual handling">;
547def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, InternalDriverOpt,
548  HelpText<"Apply modifications to files to conform to ARC">;
549def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt,
550  HelpText<"Apply modifications and produces temporary files that conform to ARC">;
551def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">,
552  HelpText<"Output path for the plist report">,  Flags<[CC1Option]>,
553  MarshallingInfoString<FrontendOpts<"ARCMTMigrateReportOut">>;
554def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">,
555  HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>,
556  MarshallingInfoFlag<FrontendOpts<"ARCMTMigrateEmitARCErrors">>;
557def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt,
558  HelpText<"Auto-generates preprocessed source files and a reproduction script">;
559def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt,
560  HelpText<"Emit a compilation database fragment to the specified directory">;
561
562def round_trip_args : Flag<["-"], "round-trip-args">, Flags<[CC1Option, NoDriverOption]>,
563  HelpText<"Enable command line arguments round-trip.">;
564def no_round_trip_args : Flag<["-"], "no-round-trip-args">, Flags<[CC1Option, NoDriverOption]>,
565  HelpText<"Disable command line arguments round-trip.">;
566
567def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>,
568  HelpText<"Run the migrator">;
569def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">,
570  InternalDriverOpt,
571  HelpText<"Apply modifications and produces temporary files to migrate to "
572   "modern ObjC syntax">;
573
574def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">, Flags<[CC1Option]>,
575  HelpText<"Enable migration to modern ObjC literals">,
576  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Literals">;
577def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">, Flags<[CC1Option]>,
578  HelpText<"Enable migration to modern ObjC subscripting">,
579  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Subscripting">;
580def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">, Flags<[CC1Option]>,
581  HelpText<"Enable migration to modern ObjC property">,
582  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Property">;
583def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">, Flags<[CC1Option]>,
584  HelpText<"Enable migration to modern ObjC">,
585  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_MigrateDecls">;
586def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">, Flags<[CC1Option]>,
587  HelpText<"Enable migration to modern ObjC readonly property">,
588  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadonlyProperty">;
589def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">, Flags<[CC1Option]>,
590  HelpText<"Enable migration to modern ObjC readwrite property">,
591  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadwriteProperty">;
592def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">, Flags<[CC1Option]>,
593  HelpText<"Enable migration of setter/getter messages to property-dot syntax">,
594  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_PropertyDotSyntax">;
595def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">, Flags<[CC1Option]>,
596  HelpText<"Enable migration to property and method annotations">,
597  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Annotation">;
598def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">, Flags<[CC1Option]>,
599  HelpText<"Enable migration to infer instancetype for method result type">,
600  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Instancetype">;
601def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">, Flags<[CC1Option]>,
602  HelpText<"Enable migration to NS_ENUM/NS_OPTIONS macros">,
603  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsMacros">;
604def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">, Flags<[CC1Option]>,
605  HelpText<"Enable migration to add protocol conformance on classes">,
606  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ProtocolConformance">;
607def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">, Flags<[CC1Option]>,
608  HelpText<"Make migration to 'atomic' properties">,
609  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_AtomicProperty">;
610def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">, Flags<[CC1Option]>,
611  HelpText<"Enable migration to annotate property with NS_RETURNS_INNER_POINTER">,
612  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReturnsInnerPointerProperty">;
613def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">, Flags<[CC1Option]>,
614  HelpText<"Enable migration to use NS_NONATOMIC_IOSONLY macro for setting property's 'atomic' attribute">,
615  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty">;
616def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">, Flags<[CC1Option]>,
617  HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">,
618  MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_DesignatedInitializer">;
619
620def objcmt_whitelist_dir_path: Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>,
621  HelpText<"Only modify files with a filename contained in the provided directory path">,
622  MarshallingInfoString<FrontendOpts<"ObjCMTWhiteListPath">>;
623// The misspelt "white-list" [sic] alias is due for removal.
624def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>,
625    Alias<objcmt_whitelist_dir_path>;
626
627// Make sure all other -ccc- options are rejected.
628def ccc_ : Joined<["-"], "ccc-">, Group<internal_Group>, Flags<[Unsupported]>;
629
630// Standard Options
631
632def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption, CoreOption, FlangOption]>,
633    HelpText<"Print (but do not run) the commands to run for this compilation">;
634def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>,
635    Flags<[NoXarchOption, CoreOption]>;
636def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group<gfortran_Group>;
637def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"<prefix>">,
638    HelpText<"Search $prefix/$triple-$file and $prefix$file for executables, libraries, "
639    "includes, and data files used by the compiler. $prefix may or may not be a directory">;
640def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>,
641  HelpText<"Search for GCC installation in the specified directory on targets which commonly use GCC. "
642  "The directory usually contains 'lib{,32,64}/gcc{,-cross}/$triple' and 'include'. If specified, "
643  "sysroot is skipped for GCC detection. Note: executables (e.g. ld) used by the compiler are not "
644  "overridden by the selected GCC installation">;
645def CC : Flag<["-"], "CC">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
646    HelpText<"Include comments from within macros in preprocessed output">,
647    MarshallingInfoFlag<PreprocessorOutputOpts<"ShowMacroComments">>;
648def C : Flag<["-"], "C">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
649    HelpText<"Include comments in preprocessed output">,
650    MarshallingInfoFlag<PreprocessorOutputOpts<"ShowComments">>;
651def D : JoinedOrSeparate<["-"], "D">, Group<Preprocessor_Group>,
652    Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"<macro>=<value>">,
653    HelpText<"Define <macro> to <value> (or 1 if <value> omitted)">;
654def E : Flag<["-"], "E">, Flags<[NoXarchOption,CC1Option, FlangOption, FC1Option]>, Group<Action_Group>,
655    HelpText<"Only run the preprocessor">;
656def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>,
657    HelpText<"Add directory to framework include search path">;
658def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption]>, Group<m_Group>,
659    MetaVarName<"<size>">, HelpText<"Put objects of at most <size> bytes "
660    "into small data section (MIPS / Hexagon)">;
661def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>, Group<m_Group>, Alias<G>;
662def H : Flag<["-"], "H">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
663    HelpText<"Show header includes and nesting depth">,
664    MarshallingInfoFlag<DependencyOutputOpts<"ShowHeaderIncludes">>;
665def fshow_skipped_includes : Flag<["-"], "fshow-skipped-includes">,
666  Flags<[CC1Option]>, HelpText<"Show skipped includes in -H output.">,
667  DocBrief<[{#include files may be "skipped" due to include guard optimization
668             or #pragma once. This flag makes -H show also such includes.}]>,
669  MarshallingInfoFlag<DependencyOutputOpts<"ShowSkippedHeaderIncludes">>;
670
671def I_ : Flag<["-"], "I-">, Group<I_Group>,
672    HelpText<"Restrict all prior -I flags to double-quoted inclusion and "
673             "remove current directory from include path">;
674def I : JoinedOrSeparate<["-"], "I">, Group<I_Group>,
675    Flags<[CC1Option,CC1AsOption,FlangOption,FC1Option]>, MetaVarName<"<dir>">,
676    HelpText<"Add directory to the end of the list of include search paths">,
677    DocBrief<[{Add directory to include search path. For C++ inputs, if
678there are multiple -I options, these directories are searched
679in the order they are given before the standard system directories
680are searched. If the same directory is in the SYSTEM include search
681paths, for example if also specified with -isystem, the -I option
682will be ignored}]>;
683def L : JoinedOrSeparate<["-"], "L">, Flags<[RenderJoined]>, Group<Link_Group>,
684    MetaVarName<"<dir>">, HelpText<"Add directory to library search path">;
685def MD : Flag<["-"], "MD">, Group<M_Group>,
686    HelpText<"Write a depfile containing user and system headers">;
687def MMD : Flag<["-"], "MMD">, Group<M_Group>,
688    HelpText<"Write a depfile containing user headers">;
689def M : Flag<["-"], "M">, Group<M_Group>,
690    HelpText<"Like -MD, but also implies -E and writes to stdout by default">;
691def MM : Flag<["-"], "MM">, Group<M_Group>,
692    HelpText<"Like -MMD, but also implies -E and writes to stdout by default">;
693def MF : JoinedOrSeparate<["-"], "MF">, Group<M_Group>,
694    HelpText<"Write depfile output from -MMD, -MD, -MM, or -M to <file>">,
695    MetaVarName<"<file>">;
696def MG : Flag<["-"], "MG">, Group<M_Group>, Flags<[CC1Option]>,
697    HelpText<"Add missing headers to depfile">,
698    MarshallingInfoFlag<DependencyOutputOpts<"AddMissingHeaderDeps">>;
699def MJ : JoinedOrSeparate<["-"], "MJ">, Group<M_Group>,
700    HelpText<"Write a compilation database entry per input">;
701def MP : Flag<["-"], "MP">, Group<M_Group>, Flags<[CC1Option]>,
702    HelpText<"Create phony target for each dependency (other than main file)">,
703    MarshallingInfoFlag<DependencyOutputOpts<"UsePhonyTargets">>;
704def MQ : JoinedOrSeparate<["-"], "MQ">, Group<M_Group>, Flags<[CC1Option]>,
705    HelpText<"Specify name of main file output to quote in depfile">;
706def MT : JoinedOrSeparate<["-"], "MT">, Group<M_Group>, Flags<[CC1Option]>,
707    HelpText<"Specify name of main file output in depfile">,
708    MarshallingInfoStringVector<DependencyOutputOpts<"Targets">>;
709def MV : Flag<["-"], "MV">, Group<M_Group>, Flags<[CC1Option]>,
710    HelpText<"Use NMake/Jom format for the depfile">,
711    MarshallingInfoFlag<DependencyOutputOpts<"OutputFormat">, "DependencyOutputFormat::Make">,
712    Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">;
713def Mach : Flag<["-"], "Mach">, Group<Link_Group>;
714def O0 : Flag<["-"], "O0">, Group<O_Group>, Flags<[CC1Option, HelpHidden]>;
715def O4 : Flag<["-"], "O4">, Group<O_Group>, Flags<[CC1Option, HelpHidden]>;
716def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>,
717  HelpText<"Treat source input files as Objective-C++ inputs">;
718def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>,
719  HelpText<"Treat source input files as Objective-C inputs">;
720def O : Joined<["-"], "O">, Group<O_Group>, Flags<[CC1Option]>;
721def O_flag : Flag<["-"], "O">, Flags<[CC1Option]>, Alias<O>, AliasArgs<["1"]>;
722def Ofast : Joined<["-"], "Ofast">, Group<O_Group>, Flags<[CC1Option]>;
723def P : Flag<["-"], "P">, Flags<[CC1Option,FlangOption,FC1Option]>, Group<Preprocessor_Group>,
724  HelpText<"Disable linemarker output in -E mode">,
725  MarshallingInfoNegativeFlag<PreprocessorOutputOpts<"ShowLineMarkers">>;
726def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>,
727  HelpText<"Emit metadata containing compiler name and version">;
728def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>,
729  HelpText<"Do not emit metadata containing compiler name and version">;
730def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>,
731  Flags<[CoreOption, CC1Option]>;
732def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>,
733  Flags<[CoreOption, CC1Option]>;
734def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>,
735  HelpText<"Don't emit warning for unused driver arguments">;
736def Q : Flag<["-"], "Q">, IgnoredGCCCompat;
737def Rpass_EQ : Joined<["-"], "Rpass=">, Group<R_value_Group>, Flags<[CC1Option]>,
738  HelpText<"Report transformations performed by optimization passes whose "
739           "name matches the given POSIX regular expression">;
740def Rpass_missed_EQ : Joined<["-"], "Rpass-missed=">, Group<R_value_Group>,
741  Flags<[CC1Option]>,
742  HelpText<"Report missed transformations by optimization passes whose "
743           "name matches the given POSIX regular expression">;
744def Rpass_analysis_EQ : Joined<["-"], "Rpass-analysis=">, Group<R_value_Group>,
745  Flags<[CC1Option]>,
746  HelpText<"Report transformation analysis from optimization passes whose "
747           "name matches the given POSIX regular expression">;
748def R_Joined : Joined<["-"], "R">, Group<R_Group>, Flags<[CC1Option, CoreOption]>,
749  MetaVarName<"<remark>">, HelpText<"Enable the specified remark">;
750def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option]>, Group<Action_Group>,
751  HelpText<"Only run preprocess and compilation steps">;
752def Tbss : JoinedOrSeparate<["-"], "Tbss">, Group<T_Group>,
753  MetaVarName<"<addr>">, HelpText<"Set starting address of BSS to <addr>">;
754def Tdata : JoinedOrSeparate<["-"], "Tdata">, Group<T_Group>,
755  MetaVarName<"<addr>">, HelpText<"Set starting address of DATA to <addr>">;
756def Ttext : JoinedOrSeparate<["-"], "Ttext">, Group<T_Group>,
757  MetaVarName<"<addr>">, HelpText<"Set starting address of TEXT to <addr>">;
758def T : JoinedOrSeparate<["-"], "T">, Group<T_Group>,
759  MetaVarName<"<script>">, HelpText<"Specify <script> as linker script">;
760def U : JoinedOrSeparate<["-"], "U">, Group<Preprocessor_Group>,
761  Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"<macro>">, HelpText<"Undefine macro <macro>">;
762def V : JoinedOrSeparate<["-"], "V">, Flags<[NoXarchOption, Unsupported]>;
763def Wa_COMMA : CommaJoined<["-"], "Wa,">,
764  HelpText<"Pass the comma separated arguments in <arg> to the assembler">,
765  MetaVarName<"<arg>">;
766def Wall : Flag<["-"], "Wall">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
767def WCL4 : Flag<["-"], "WCL4">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
768def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<W_Group>, Flags<[CC1Option]>,
769  HelpText<"Enable warnings for deprecated constructs and define __DEPRECATED">;
770def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>, Flags<[CC1Option]>;
771def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>,
772  HelpText<"Pass the comma separated arguments in <arg> to the linker">,
773  MetaVarName<"<arg>">, Group<Link_Group>;
774// FIXME: This is broken; these should not be Joined arguments.
775def Wno_nonportable_cfstrings : Joined<["-"], "Wno-nonportable-cfstrings">, Group<W_Group>,
776  Flags<[CC1Option]>;
777def Wnonportable_cfstrings : Joined<["-"], "Wnonportable-cfstrings">, Group<W_Group>,
778  Flags<[CC1Option]>;
779def Wp_COMMA : CommaJoined<["-"], "Wp,">,
780  HelpText<"Pass the comma separated arguments in <arg> to the preprocessor">,
781  MetaVarName<"<arg>">, Group<Preprocessor_Group>;
782def Wundef_prefix_EQ : CommaJoined<["-"], "Wundef-prefix=">, Group<W_value_Group>,
783  Flags<[CC1Option, CoreOption, HelpHidden]>, MetaVarName<"<arg>">,
784  HelpText<"Enable warnings for undefined macros with a prefix in the comma separated list <arg>">,
785  MarshallingInfoStringVector<DiagnosticOpts<"UndefPrefixes">>;
786def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
787def Wno_write_strings : Flag<["-"], "Wno-write-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
788def W_Joined : Joined<["-"], "W">, Group<W_Group>, Flags<[CC1Option, CoreOption, FC1Option, FlangOption]>,
789  MetaVarName<"<warning>">, HelpText<"Enable the specified warning">;
790def Xanalyzer : Separate<["-"], "Xanalyzer">,
791  HelpText<"Pass <arg> to the static analyzer">, MetaVarName<"<arg>">,
792  Group<StaticAnalyzer_Group>;
793def Xarch__ : JoinedAndSeparate<["-"], "Xarch_">, Flags<[NoXarchOption]>;
794def Xarch_host : Separate<["-"], "Xarch_host">, Flags<[NoXarchOption]>,
795  HelpText<"Pass <arg> to the CUDA/HIP host compilation">, MetaVarName<"<arg>">;
796def Xarch_device : Separate<["-"], "Xarch_device">, Flags<[NoXarchOption]>,
797  HelpText<"Pass <arg> to the CUDA/HIP device compilation">, MetaVarName<"<arg>">;
798def Xassembler : Separate<["-"], "Xassembler">,
799  HelpText<"Pass <arg> to the assembler">, MetaVarName<"<arg>">,
800  Group<CompileOnly_Group>;
801def Xclang : Separate<["-"], "Xclang">,
802  HelpText<"Pass <arg> to the clang compiler">, MetaVarName<"<arg>">,
803  Flags<[NoXarchOption, CoreOption]>, Group<CompileOnly_Group>;
804def Xcuda_fatbinary : Separate<["-"], "Xcuda-fatbinary">,
805  HelpText<"Pass <arg> to fatbinary invocation">, MetaVarName<"<arg>">;
806def Xcuda_ptxas : Separate<["-"], "Xcuda-ptxas">,
807  HelpText<"Pass <arg> to the ptxas assembler">, MetaVarName<"<arg>">;
808def Xopenmp_target : Separate<["-"], "Xopenmp-target">,
809  HelpText<"Pass <arg> to the target offloading toolchain.">, MetaVarName<"<arg>">;
810def Xopenmp_target_EQ : JoinedAndSeparate<["-"], "Xopenmp-target=">,
811  HelpText<"Pass <arg> to the target offloading toolchain identified by <triple>.">,
812  MetaVarName<"<triple> <arg>">;
813def z : Separate<["-"], "z">, Flags<[LinkerInput, RenderAsInput]>,
814  HelpText<"Pass -z <arg> to the linker">, MetaVarName<"<arg>">,
815  Group<Link_Group>;
816def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>,
817  HelpText<"Pass <arg> to the linker">, MetaVarName<"<arg>">,
818  Group<Link_Group>;
819def Xpreprocessor : Separate<["-"], "Xpreprocessor">, Group<Preprocessor_Group>,
820  HelpText<"Pass <arg> to the preprocessor">, MetaVarName<"<arg>">;
821def X_Flag : Flag<["-"], "X">, Group<Link_Group>;
822def X_Joined : Joined<["-"], "X">, IgnoredGCCCompat;
823def Z_Flag : Flag<["-"], "Z">, Group<Link_Group>;
824// FIXME: All we do with this is reject it. Remove.
825def Z_Joined : Joined<["-"], "Z">;
826def all__load : Flag<["-"], "all_load">;
827def allowable__client : Separate<["-"], "allowable_client">;
828def ansi : Flag<["-", "--"], "ansi">, Group<CompileOnly_Group>;
829def arch__errors__fatal : Flag<["-"], "arch_errors_fatal">;
830def arch : Separate<["-"], "arch">, Flags<[NoXarchOption]>;
831def arch__only : Separate<["-"], "arch_only">;
832def a : Joined<["-"], "a">;
833def autocomplete : Joined<["--"], "autocomplete=">;
834def bind__at__load : Flag<["-"], "bind_at_load">;
835def bundle__loader : Separate<["-"], "bundle_loader">;
836def bundle : Flag<["-"], "bundle">;
837def b : JoinedOrSeparate<["-"], "b">, Flags<[LinkerInput, RenderAsInput]>,
838  HelpText<"Pass -b <arg> to the linker on AIX (only).">, MetaVarName<"<arg>">,
839  Group<Link_Group>;
840def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group<opencl_Group>, Flags<[CC1Option]>,
841  HelpText<"OpenCL only. This option disables all optimizations. By default optimizations are enabled.">;
842def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group<opencl_Group>, Flags<[CC1Option]>,
843  HelpText<"OpenCL only. This option is added for compatibility with OpenCL 1.0.">;
844def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">, Group<opencl_Group>, Flags<[CC1Option]>,
845  HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">,
846  MarshallingInfoFlag<LangOpts<"SinglePrecisionConstants">>;
847def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">, Group<opencl_Group>, Flags<[CC1Option]>,
848  HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">,
849  MarshallingInfoFlag<LangOpts<"CLFiniteMathOnly">>;
850def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">, Group<opencl_Group>, Flags<[CC1Option]>,
851  HelpText<"OpenCL only. Generate kernel argument metadata.">,
852  MarshallingInfoFlag<CodeGenOpts<"EmitOpenCLArgMetadata">>;
853def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">, Group<opencl_Group>, Flags<[CC1Option]>,
854  HelpText<"OpenCL only. Allow unsafe floating-point optimizations.  Also implies -cl-no-signed-zeros and -cl-mad-enable.">,
855  MarshallingInfoFlag<LangOpts<"CLUnsafeMath">>;
856def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">, Group<opencl_Group>, Flags<[CC1Option]>,
857  HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__.">,
858  MarshallingInfoFlag<LangOpts<"FastRelaxedMath">>;
859def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>, Flags<[CC1Option]>,
860  HelpText<"OpenCL only. Allow use of less precise MAD computations in the generated binary.">,
861  MarshallingInfoFlag<CodeGenOpts<"LessPreciseFPMAD">>,
862  ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, cl_fast_relaxed_math.KeyPath]>;
863def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>, Flags<[CC1Option]>,
864  HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">,
865  MarshallingInfoFlag<LangOpts<"CLNoSignedZero">>;
866def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>, Flags<[CC1Option]>,
867  HelpText<"OpenCL language standard to compile for.">,
868  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">;
869def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>,
870  HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
871def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>, Flags<[CC1Option]>,
872  HelpText<"OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.">,
873  MarshallingInfoFlag<CodeGenOpts<"OpenCLCorrectlyRoundedDivSqrt">>;
874def cl_uniform_work_group_size : Flag<["-"], "cl-uniform-work-group-size">, Group<opencl_Group>, Flags<[CC1Option]>,
875  HelpText<"OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel">,
876  MarshallingInfoFlag<CodeGenOpts<"UniformWGSize">>;
877def cl_no_stdinc : Flag<["-"], "cl-no-stdinc">, Group<opencl_Group>,
878  HelpText<"OpenCL only. Disables all standard includes containing non-native compiler types and functions.">;
879def client__name : JoinedOrSeparate<["-"], "client_name">;
880def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>;
881def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">;
882def config : Separate<["--"], "config">, Flags<[NoXarchOption]>,
883  HelpText<"Specifies configuration file">;
884def config_system_dir_EQ : Joined<["--"], "config-system-dir=">, Flags<[NoXarchOption, HelpHidden]>,
885  HelpText<"System directory for configuration files">;
886def config_user_dir_EQ : Joined<["--"], "config-user-dir=">, Flags<[NoXarchOption, HelpHidden]>,
887  HelpText<"User directory for configuration files">;
888def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>, Flags<[CoreOption]>;
889def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
890def current__version : JoinedOrSeparate<["-"], "current_version">;
891def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
892  HelpText<"Add directory to the C++ SYSTEM include search path">, Flags<[CC1Option]>,
893  MetaVarName<"<directory>">;
894def c : Flag<["-"], "c">, Flags<[NoXarchOption, FlangOption]>, Group<Action_Group>,
895  HelpText<"Only run preprocess, compile, and assemble steps">;
896def fconvergent_functions : Flag<["-"], "fconvergent-functions">, Group<f_Group>, Flags<[CC1Option]>,
897  HelpText<"Assume functions may be convergent">;
898
899def gpu_use_aux_triple_only : Flag<["--"], "gpu-use-aux-triple-only">,
900  InternalDriverOpt, HelpText<"Prepare '-aux-triple' only without populating "
901                              "'-aux-target-cpu' and '-aux-target-feature'.">;
902def cuda_device_only : Flag<["--"], "cuda-device-only">,
903  HelpText<"Compile CUDA code for device only">;
904def cuda_host_only : Flag<["--"], "cuda-host-only">,
905  HelpText<"Compile CUDA code for host only.  Has no effect on non-CUDA "
906           "compilations.">;
907def cuda_compile_host_device : Flag<["--"], "cuda-compile-host-device">,
908  HelpText<"Compile CUDA code for both host and device (default).  Has no "
909           "effect on non-CUDA compilations.">;
910def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">, Flags<[NoXarchOption]>,
911  HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
912def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXarchOption]>,
913  HelpText<"Do not include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
914def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
915  HelpText<"CUDA offloading device architecture (e.g. sm_35), or HIP offloading target ID in the form of a "
916           "device architecture followed by target ID features delimited by a colon. Each target ID feature "
917           "is a pre-defined string followed by a plus or minus sign (e.g. gfx908:xnack+:sramecc-).  May be "
918           "specified more than once.">;
919def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">, Flags<[NoXarchOption]>,
920  Alias<offload_arch_EQ>;
921def hip_link : Flag<["--"], "hip-link">,
922  HelpText<"Link clang-offload-bundler bundles for HIP">;
923def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">, Flags<[NoXarchOption]>,
924  HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. "
925           "'all' resets the list to its default value.">;
926def emit_static_lib : Flag<["--"], "emit-static-lib">,
927  HelpText<"Enable linker job to emit a static library.">;
928def no_cuda_gpu_arch_EQ : Joined<["--"], "no-cuda-gpu-arch=">, Flags<[NoXarchOption]>,
929  Alias<no_offload_arch_EQ>;
930def cuda_noopt_device_debug : Flag<["--"], "cuda-noopt-device-debug">,
931  HelpText<"Enable device-side debug info generation. Disables ptxas optimizations.">;
932def no_cuda_version_check : Flag<["--"], "no-cuda-version-check">,
933  HelpText<"Don't error out if the detected version of the CUDA install is "
934           "too low for the requested CUDA gpu architecture.">;
935def no_cuda_noopt_device_debug : Flag<["--"], "no-cuda-noopt-device-debug">;
936def cuda_path_EQ : Joined<["--"], "cuda-path=">, Group<i_Group>,
937  HelpText<"CUDA installation path">;
938def cuda_path_ignore_env : Flag<["--"], "cuda-path-ignore-env">, Group<i_Group>,
939  HelpText<"Ignore environment variables to detect CUDA installation">;
940def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Group<i_Group>,
941  HelpText<"Path to ptxas (used for compiling CUDA code)">;
942def fgpu_flush_denormals_to_zero : Flag<["-"], "fgpu-flush-denormals-to-zero">,
943  HelpText<"Flush denormal floating point values to zero in CUDA/HIP device mode.">;
944def fno_gpu_flush_denormals_to_zero : Flag<["-"], "fno-gpu-flush-denormals-to-zero">;
945def fcuda_flush_denormals_to_zero : Flag<["-"], "fcuda-flush-denormals-to-zero">,
946  Alias<fgpu_flush_denormals_to_zero>;
947def fno_cuda_flush_denormals_to_zero : Flag<["-"], "fno-cuda-flush-denormals-to-zero">,
948  Alias<fno_gpu_flush_denormals_to_zero>;
949defm gpu_rdc : BoolFOption<"gpu-rdc",
950  LangOpts<"GPURelocatableDeviceCode">, DefaultFalse,
951  PosFlag<SetTrue, [CC1Option], "Generate relocatable device code, also known as separate compilation mode">,
952  NegFlag<SetFalse>>;
953def : Flag<["-"], "fcuda-rdc">, Alias<fgpu_rdc>;
954def : Flag<["-"], "fno-cuda-rdc">, Alias<fno_gpu_rdc>;
955defm cuda_short_ptr : BoolFOption<"cuda-short-ptr",
956  TargetOpts<"NVPTXUseShortPointers">, DefaultFalse,
957  PosFlag<SetTrue, [CC1Option], "Use 32-bit pointers for accessing const/local/shared address spaces">,
958  NegFlag<SetFalse>>;
959def rocm_path_EQ : Joined<["--"], "rocm-path=">, Group<i_Group>,
960  HelpText<"ROCm installation path, used for finding and automatically linking required bitcode libraries.">;
961def hip_path_EQ : Joined<["--"], "hip-path=">, Group<i_Group>,
962  HelpText<"HIP runtime installation path, used for finding HIP version and adding HIP include path.">;
963def amdgpu_arch_tool_EQ : Joined<["--"], "amdgpu-arch-tool=">, Group<i_Group>,
964  HelpText<"Tool used for detecting AMD GPU arch in the system.">;
965def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Group<Link_Group>,
966  HelpText<"ROCm device library path. Alternative to rocm-path.">;
967def : Joined<["--"], "hip-device-lib-path=">, Alias<rocm_device_lib_path_EQ>;
968def hip_device_lib_EQ : Joined<["--"], "hip-device-lib=">, Group<Link_Group>,
969  HelpText<"HIP device library">;
970def hip_version_EQ : Joined<["--"], "hip-version=">,
971  HelpText<"HIP version in the format of major.minor.patch">;
972def fhip_dump_offload_linker_script : Flag<["-"], "fhip-dump-offload-linker-script">,
973  Group<f_Group>, Flags<[NoArgumentUnused, HelpHidden]>;
974defm hip_new_launch_api : BoolFOption<"hip-new-launch-api",
975  LangOpts<"HIPUseNewLaunchAPI">, DefaultFalse,
976  PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
977  BothFlags<[], " new kernel launching API for HIP">>;
978defm hip_fp32_correctly_rounded_divide_sqrt : BoolFOption<"hip-fp32-correctly-rounded-divide-sqrt",
979  CodeGenOpts<"HIPCorrectlyRoundedDivSqrt">, DefaultTrue,
980  PosFlag<SetTrue, [], "Specify">,
981  NegFlag<SetFalse, [CC1Option], "Don't specify">,
982  BothFlags<[], " that single precision floating-point divide and sqrt used in "
983  "the program source are correctly rounded (HIP device compilation only)">>,
984  ShouldParseIf<hip.KeyPath>;
985defm gpu_allow_device_init : BoolFOption<"gpu-allow-device-init",
986  LangOpts<"GPUAllowDeviceInit">, DefaultFalse,
987  PosFlag<SetTrue, [CC1Option], "Allow">, NegFlag<SetFalse, [], "Don't allow">,
988  BothFlags<[], " device side init function in HIP (experimental)">>,
989  ShouldParseIf<hip.KeyPath>;
990defm gpu_defer_diag : BoolFOption<"gpu-defer-diag",
991  LangOpts<"GPUDeferDiag">, DefaultFalse,
992  PosFlag<SetTrue, [CC1Option], "Defer">, NegFlag<SetFalse, [], "Don't defer">,
993  BothFlags<[], " host/device related diagnostic messages for CUDA/HIP">>;
994defm gpu_exclude_wrong_side_overloads : BoolFOption<"gpu-exclude-wrong-side-overloads",
995  LangOpts<"GPUExcludeWrongSideOverloads">, DefaultFalse,
996  PosFlag<SetTrue, [CC1Option], "Always exclude wrong side overloads">,
997  NegFlag<SetFalse, [], "Exclude wrong side overloads only if there are same side overloads">,
998  BothFlags<[HelpHidden], " in overloading resolution for CUDA/HIP">>;
999def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">,
1000  Flags<[CC1Option]>,
1001  HelpText<"Default max threads per block for kernel launch bounds for HIP">,
1002  MarshallingInfoInt<LangOpts<"GPUMaxThreadsPerBlock">, "1024">,
1003  ShouldParseIf<hip.KeyPath>;
1004def fgpu_inline_threshold_EQ : Joined<["-"], "fgpu-inline-threshold=">,
1005  Flags<[HelpHidden]>,
1006  HelpText<"Inline threshold for device compilation for CUDA/HIP">;
1007def gpu_instrument_lib_EQ : Joined<["--"], "gpu-instrument-lib=">,
1008  HelpText<"Instrument device library for HIP, which is a LLVM bitcode containing "
1009  "__cyg_profile_func_enter and __cyg_profile_func_exit">;
1010def fgpu_sanitize : Flag<["-"], "fgpu-sanitize">, Group<f_Group>,
1011  HelpText<"Enable sanitizer for AMDGPU target">;
1012def fno_gpu_sanitize : Flag<["-"], "fno-gpu-sanitize">, Group<f_Group>;
1013def gpu_bundle_output : Flag<["--"], "gpu-bundle-output">,
1014  Group<f_Group>, HelpText<"Bundle output files of HIP device compilation">;
1015def no_gpu_bundle_output : Flag<["--"], "no-gpu-bundle-output">,
1016  Group<f_Group>, HelpText<"Do not bundle output files of HIP device compilation">;
1017def cuid_EQ : Joined<["-"], "cuid=">, Flags<[CC1Option]>,
1018  HelpText<"An ID for compilation unit, which should be the same for the same "
1019           "compilation unit but different for different compilation units. "
1020           "It is used to externalize device-side static variables for single "
1021           "source offloading languages CUDA and HIP so that they can be "
1022           "accessed by the host code of the same compilation unit.">,
1023  MarshallingInfoString<LangOpts<"CUID">>;
1024def fuse_cuid_EQ : Joined<["-"], "fuse-cuid=">,
1025  HelpText<"Method to generate ID's for compilation units for single source "
1026           "offloading languages CUDA and HIP: 'hash' (ID's generated by hashing "
1027           "file path and command line options) | 'random' (ID's generated as "
1028           "random numbers) | 'none' (disabled). Default is 'hash'. This option "
1029           "will be overridden by option '-cuid=[ID]' if it is specified." >;
1030def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path=">, Group<i_Group>,
1031  HelpText<"Path to libomptarget-amdgcn bitcode library">;
1032def libomptarget_nvptx_bc_path_EQ : Joined<["--"], "libomptarget-nvptx-bc-path=">, Group<i_Group>,
1033  HelpText<"Path to libomptarget-nvptx bitcode library">;
1034def dD : Flag<["-"], "dD">, Group<d_Group>, Flags<[CC1Option]>,
1035  HelpText<"Print macro definitions in -E mode in addition to normal output">;
1036def dI : Flag<["-"], "dI">, Group<d_Group>, Flags<[CC1Option]>,
1037  HelpText<"Print include directives in -E mode in addition to normal output">,
1038  MarshallingInfoFlag<PreprocessorOutputOpts<"ShowIncludeDirectives">>;
1039def dM : Flag<["-"], "dM">, Group<d_Group>, Flags<[CC1Option]>,
1040  HelpText<"Print macro definitions in -E mode instead of normal output">;
1041def dead__strip : Flag<["-"], "dead_strip">;
1042def dependency_file : Separate<["-"], "dependency-file">, Flags<[CC1Option]>,
1043  HelpText<"Filename (or -) to write dependency output to">,
1044  MarshallingInfoString<DependencyOutputOpts<"OutputFile">>;
1045def dependency_dot : Separate<["-"], "dependency-dot">, Flags<[CC1Option]>,
1046  HelpText<"Filename to write DOT-formatted header dependencies to">,
1047  MarshallingInfoString<DependencyOutputOpts<"DOTOutputFile">>;
1048def module_dependency_dir : Separate<["-"], "module-dependency-dir">,
1049  Flags<[CC1Option]>, HelpText<"Directory to dump module dependencies to">,
1050  MarshallingInfoString<DependencyOutputOpts<"ModuleDependencyOutputDir">>;
1051def dsym_dir : JoinedOrSeparate<["-"], "dsym-dir">,
1052  Flags<[NoXarchOption, RenderAsInput]>,
1053  HelpText<"Directory to output dSYM's (if any) to">, MetaVarName<"<dir>">;
1054def dumpmachine : Flag<["-"], "dumpmachine">;
1055def dumpspecs : Flag<["-"], "dumpspecs">, Flags<[Unsupported]>;
1056def dumpversion : Flag<["-"], "dumpversion">;
1057def dylib__file : Separate<["-"], "dylib_file">;
1058def dylinker__install__name : JoinedOrSeparate<["-"], "dylinker_install_name">;
1059def dylinker : Flag<["-"], "dylinker">;
1060def dynamiclib : Flag<["-"], "dynamiclib">;
1061def dynamic : Flag<["-"], "dynamic">, Flags<[NoArgumentUnused]>;
1062def d_Flag : Flag<["-"], "d">, Group<d_Group>;
1063def d_Joined : Joined<["-"], "d">, Group<d_Group>;
1064def emit_ast : Flag<["-"], "emit-ast">,
1065  HelpText<"Emit Clang AST files for source inputs">;
1066def emit_llvm : Flag<["-"], "emit-llvm">, Flags<[CC1Option]>, Group<Action_Group>,
1067  HelpText<"Use the LLVM representation for assembler and object files">;
1068def emit_interface_stubs : Flag<["-"], "emit-interface-stubs">, Flags<[CC1Option]>, Group<Action_Group>,
1069  HelpText<"Generate Interface Stub Files.">;
1070def emit_merged_ifs : Flag<["-"], "emit-merged-ifs">,
1071  Flags<[CC1Option]>, Group<Action_Group>,
1072  HelpText<"Generate Interface Stub Files, emit merged text not binary.">;
1073def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version=">, Flags<[CC1Option]>;
1074def exported__symbols__list : Separate<["-"], "exported_symbols_list">;
1075def e : JoinedOrSeparate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
1076def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>, Flags<[CC1Option]>,
1077  HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
1078  MarshallingInfoInt<LangOpts<"MaxTokens">>;
1079def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
1080def fno_PIC : Flag<["-"], "fno-PIC">, Group<f_Group>;
1081def fPIE : Flag<["-"], "fPIE">, Group<f_Group>;
1082def fno_PIE : Flag<["-"], "fno-PIE">, Group<f_Group>;
1083defm access_control : BoolFOption<"access-control",
1084  LangOpts<"AccessControl">, DefaultTrue,
1085  NegFlag<SetFalse, [CC1Option], "Disable C++ access control">,
1086  PosFlag<SetTrue>>;
1087def falign_functions : Flag<["-"], "falign-functions">, Group<f_Group>;
1088def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group<f_Group>;
1089def falign_loops_EQ : Joined<["-"], "falign-loops=">, Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<N>">,
1090  HelpText<"N must be a power of two. Align loops to the boundary">,
1091  MarshallingInfoInt<CodeGenOpts<"LoopAlignment">>;
1092def fno_align_functions: Flag<["-"], "fno-align-functions">, Group<f_Group>;
1093defm allow_editor_placeholders : BoolFOption<"allow-editor-placeholders",
1094  LangOpts<"AllowEditorPlaceholders">, DefaultFalse,
1095  PosFlag<SetTrue, [CC1Option], "Treat editor placeholders as valid source code">,
1096  NegFlag<SetFalse>>;
1097def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group<f_Group>;
1098def fapple_kext : Flag<["-"], "fapple-kext">, Group<f_Group>, Flags<[CC1Option]>,
1099  HelpText<"Use Apple's kernel extensions ABI">,
1100  MarshallingInfoFlag<LangOpts<"AppleKext">>;
1101defm apple_pragma_pack : BoolFOption<"apple-pragma-pack",
1102  LangOpts<"ApplePragmaPack">, DefaultFalse,
1103  PosFlag<SetTrue, [CC1Option], "Enable Apple gcc-compatible #pragma pack handling">,
1104  NegFlag<SetFalse>>;
1105defm xl_pragma_pack : BoolFOption<"xl-pragma-pack",
1106  LangOpts<"XLPragmaPack">, DefaultFalse,
1107  PosFlag<SetTrue, [CC1Option], "Enable IBM XL #pragma pack handling">,
1108  NegFlag<SetFalse>>;
1109def shared_libsan : Flag<["-"], "shared-libsan">,
1110  HelpText<"Dynamically link the sanitizer runtime">;
1111def static_libsan : Flag<["-"], "static-libsan">,
1112  HelpText<"Statically link the sanitizer runtime">;
1113def : Flag<["-"], "shared-libasan">, Alias<shared_libsan>;
1114def fasm : Flag<["-"], "fasm">, Group<f_Group>;
1115
1116def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group<f_Group>;
1117def fastcp : Flag<["-"], "fastcp">, Group<f_Group>;
1118def fastf : Flag<["-"], "fastf">, Group<f_Group>;
1119def fast : Flag<["-"], "fast">, Group<f_Group>;
1120def fasynchronous_unwind_tables : Flag<["-"], "fasynchronous-unwind-tables">, Group<f_Group>;
1121
1122defm double_square_bracket_attributes : BoolFOption<"double-square-bracket-attributes",
1123  LangOpts<"DoubleSquareBracketAttributes">, Default<!strconcat(cpp11.KeyPath, "||", c2x.KeyPath)>,
1124  PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
1125  BothFlags<[NoXarchOption, CC1Option], " '[[]]' attributes in all C and C++ language modes">>;
1126
1127defm autolink : BoolFOption<"autolink",
1128  CodeGenOpts<"Autolink">, DefaultTrue,
1129  NegFlag<SetFalse, [CC1Option], "Disable generation of linker directives for automatic library linking">,
1130  PosFlag<SetTrue>>;
1131
1132// C++ Coroutines TS
1133defm coroutines_ts : BoolFOption<"coroutines-ts",
1134  LangOpts<"Coroutines">, Default<cpp20.KeyPath>,
1135  PosFlag<SetTrue, [CC1Option], "Enable support for the C++ Coroutines TS">,
1136  NegFlag<SetFalse>>;
1137
1138def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">,
1139    Group<f_Group>, Flags<[NoXarchOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
1140    HelpText<"Embed LLVM bitcode (option: off, all, bitcode, marker)">,
1141    Values<"off,all,bitcode,marker">, NormalizedValuesScope<"CodeGenOptions">,
1142    NormalizedValues<["Embed_Off", "Embed_All", "Embed_Bitcode", "Embed_Marker"]>,
1143    MarshallingInfoEnum<CodeGenOpts<"EmbedBitcode">, "Embed_Off">;
1144def fembed_bitcode : Flag<["-"], "fembed-bitcode">, Group<f_Group>,
1145  Alias<fembed_bitcode_EQ>, AliasArgs<["all"]>,
1146  HelpText<"Embed LLVM IR bitcode as data">;
1147def fembed_bitcode_marker : Flag<["-"], "fembed-bitcode-marker">,
1148  Alias<fembed_bitcode_EQ>, AliasArgs<["marker"]>,
1149  HelpText<"Embed placeholder LLVM IR data as a marker">;
1150defm gnu_inline_asm : BoolFOption<"gnu-inline-asm",
1151  LangOpts<"GNUAsm">, DefaultTrue,
1152  NegFlag<SetFalse, [CC1Option], "Disable GNU style inline asm">, PosFlag<SetTrue>>;
1153
1154def fprofile_sample_use : Flag<["-"], "fprofile-sample-use">, Group<f_Group>,
1155    Flags<[CoreOption]>;
1156def fno_profile_sample_use : Flag<["-"], "fno-profile-sample-use">, Group<f_Group>,
1157    Flags<[CoreOption]>;
1158def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
1159    Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
1160    HelpText<"Enable sample-based profile guided optimizations">,
1161    MarshallingInfoString<CodeGenOpts<"SampleProfileFile">>;
1162def fprofile_sample_accurate : Flag<["-"], "fprofile-sample-accurate">,
1163    Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
1164    HelpText<"Specifies that the sample profile is accurate">,
1165    DocBrief<[{Specifies that the sample profile is accurate. If the sample
1166               profile is accurate, callsites without profile samples are marked
1167               as cold. Otherwise, treat callsites without profile samples as if
1168               we have no profile}]>,
1169   MarshallingInfoFlag<CodeGenOpts<"ProfileSampleAccurate">>;
1170def fno_profile_sample_accurate : Flag<["-"], "fno-profile-sample-accurate">,
1171  Group<f_Group>, Flags<[NoXarchOption]>;
1172def fauto_profile : Flag<["-"], "fauto-profile">, Group<f_Group>,
1173    Alias<fprofile_sample_use>;
1174def fno_auto_profile : Flag<["-"], "fno-auto-profile">, Group<f_Group>,
1175    Alias<fno_profile_sample_use>;
1176def fauto_profile_EQ : Joined<["-"], "fauto-profile=">,
1177    Alias<fprofile_sample_use_EQ>;
1178def fauto_profile_accurate : Flag<["-"], "fauto-profile-accurate">,
1179    Group<f_Group>, Alias<fprofile_sample_accurate>;
1180def fno_auto_profile_accurate : Flag<["-"], "fno-auto-profile-accurate">,
1181    Group<f_Group>, Alias<fno_profile_sample_accurate>;
1182def fdebug_compilation_dir_EQ : Joined<["-"], "fdebug-compilation-dir=">,
1183    Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
1184    HelpText<"The compilation directory to embed in the debug info">,
1185    MarshallingInfoString<CodeGenOpts<"DebugCompilationDir">>;
1186def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
1187    Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
1188    Alias<fdebug_compilation_dir_EQ>;
1189def fcoverage_compilation_dir_EQ : Joined<["-"], "fcoverage-compilation-dir=">,
1190    Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
1191    HelpText<"The compilation directory to embed in the coverage mapping.">,
1192    MarshallingInfoString<CodeGenOpts<"CoverageCompilationDir">>;
1193def ffile_compilation_dir_EQ : Joined<["-"], "ffile-compilation-dir=">, Group<f_Group>,
1194    Flags<[CoreOption]>,
1195    HelpText<"The compilation directory to embed in the debug info and coverage mapping.">;
1196defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling",
1197  CodeGenOpts<"DebugInfoForProfiling">, DefaultFalse,
1198  PosFlag<SetTrue, [CC1Option], "Emit extra debug info to make sample profile more accurate">,
1199  NegFlag<SetFalse>>;
1200def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">,
1201    Group<f_Group>, Flags<[CoreOption]>,
1202    HelpText<"Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1203def fprofile_instr_generate_EQ : Joined<["-"], "fprofile-instr-generate=">,
1204    Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<file>">,
1205    HelpText<"Generate instrumented code to collect execution counts into <file> (overridden by LLVM_PROFILE_FILE env var)">;
1206def fprofile_instr_use : Flag<["-"], "fprofile-instr-use">, Group<f_Group>,
1207    Flags<[CoreOption]>;
1208def fprofile_instr_use_EQ : Joined<["-"], "fprofile-instr-use=">,
1209    Group<f_Group>, Flags<[CoreOption]>,
1210    HelpText<"Use instrumentation data for profile-guided optimization">;
1211def fprofile_remapping_file_EQ : Joined<["-"], "fprofile-remapping-file=">,
1212    Group<f_Group>, Flags<[CC1Option, CoreOption]>, MetaVarName<"<file>">,
1213    HelpText<"Use the remappings described in <file> to match the profile data against names in the program">,
1214    MarshallingInfoString<CodeGenOpts<"ProfileRemappingFile">>;
1215defm coverage_mapping : BoolFOption<"coverage-mapping",
1216  CodeGenOpts<"CoverageMapping">, DefaultFalse,
1217  PosFlag<SetTrue, [CC1Option], "Generate coverage mapping to enable code coverage analysis">,
1218  NegFlag<SetFalse, [], "Disable code coverage analysis">, BothFlags<[CoreOption]>>;
1219def fprofile_generate : Flag<["-"], "fprofile-generate">,
1220    Group<f_Group>, Flags<[CoreOption]>,
1221    HelpText<"Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1222def fprofile_generate_EQ : Joined<["-"], "fprofile-generate=">,
1223    Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<directory>">,
1224    HelpText<"Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1225def fcs_profile_generate : Flag<["-"], "fcs-profile-generate">,
1226    Group<f_Group>, Flags<[CoreOption]>,
1227    HelpText<"Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1228def fcs_profile_generate_EQ : Joined<["-"], "fcs-profile-generate=">,
1229    Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<directory>">,
1230    HelpText<"Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
1231def fprofile_use : Flag<["-"], "fprofile-use">, Group<f_Group>,
1232    Alias<fprofile_instr_use>;
1233def fprofile_use_EQ : Joined<["-"], "fprofile-use=">,
1234    Group<f_Group>, Flags<[NoXarchOption]>, MetaVarName<"<pathname>">,
1235    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>.">;
1236def fno_profile_instr_generate : Flag<["-"], "fno-profile-instr-generate">,
1237    Group<f_Group>, Flags<[CoreOption]>,
1238    HelpText<"Disable generation of profile instrumentation.">;
1239def fno_profile_generate : Flag<["-"], "fno-profile-generate">,
1240    Group<f_Group>, Flags<[CoreOption]>,
1241    HelpText<"Disable generation of profile instrumentation.">;
1242def fno_profile_instr_use : Flag<["-"], "fno-profile-instr-use">,
1243    Group<f_Group>, Flags<[CoreOption]>,
1244    HelpText<"Disable using instrumentation data for profile-guided optimization">;
1245def fno_profile_use : Flag<["-"], "fno-profile-use">,
1246    Alias<fno_profile_instr_use>;
1247defm profile_arcs : BoolFOption<"profile-arcs",
1248  CodeGenOpts<"EmitGcovArcs">, DefaultFalse,
1249  PosFlag<SetTrue, [CC1Option, LinkOption]>, NegFlag<SetFalse>>;
1250defm test_coverage : BoolFOption<"test-coverage",
1251  CodeGenOpts<"EmitGcovNotes">, DefaultFalse,
1252  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
1253def fprofile_filter_files_EQ : Joined<["-"], "fprofile-filter-files=">,
1254    Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1255    HelpText<"Instrument only functions from files where names match any regex separated by a semi-colon">,
1256    MarshallingInfoString<CodeGenOpts<"ProfileFilterFiles">>,
1257    ShouldParseIf<!strconcat(fprofile_arcs.KeyPath, "||", ftest_coverage.KeyPath)>;
1258def fprofile_exclude_files_EQ : Joined<["-"], "fprofile-exclude-files=">,
1259    Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1260    HelpText<"Instrument only functions from files where names don't match all the regexes separated by a semi-colon">,
1261    MarshallingInfoString<CodeGenOpts<"ProfileExcludeFiles">>,
1262    ShouldParseIf<!strconcat(fprofile_arcs.KeyPath, "||", ftest_coverage.KeyPath)>;
1263def fprofile_update_EQ : Joined<["-"], "fprofile-update=">,
1264    Group<f_Group>, Flags<[CC1Option, CoreOption]>, Values<"atomic,prefer-atomic,single">,
1265    MetaVarName<"<method>">, HelpText<"Set update method of profile counters (atomic,prefer-atomic,single)">,
1266    MarshallingInfoFlag<CodeGenOpts<"AtomicProfileUpdate">>;
1267defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
1268  CodeGenOpts<"PseudoProbeForProfiling">, DefaultFalse,
1269  PosFlag<SetTrue, [], "Emit">, NegFlag<SetFalse, [], "Do not emit">,
1270  BothFlags<[NoXarchOption, CC1Option], " pseudo probes for sample profiling">>;
1271def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
1272    Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1273    HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
1274def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
1275    Group<f_Group>, Flags<[CC1Option, CoreOption]>,
1276    HelpText<"Filename defining the list of functions/files to instrument">,
1277    MarshallingInfoStringVector<LangOpts<"ProfileListFiles">>;
1278def fswift_async_fp_EQ : Joined<["-"], "fswift-async-fp=">,
1279    Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>, MetaVarName<"<option>">,
1280    HelpText<"Control emission of Swift async extended frame info (option: auto, always, never)">,
1281    Values<"auto,always,never">,
1282    NormalizedValuesScope<"CodeGenOptions::SwiftAsyncFramePointerKind">,
1283    NormalizedValues<["Auto", "Always", "Never"]>,
1284    MarshallingInfoEnum<CodeGenOpts<"SwiftAsyncFramePointer">, "Always">;
1285
1286defm addrsig : BoolFOption<"addrsig",
1287  CodeGenOpts<"Addrsig">, DefaultFalse,
1288  PosFlag<SetTrue, [CC1Option], "Emit">, NegFlag<SetFalse, [], "Don't emit">,
1289  BothFlags<[CoreOption], " an address-significance table">>;
1290defm blocks : OptInCC1FFlag<"blocks", "Enable the 'blocks' language feature", "", "", [CoreOption]>;
1291def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group<f_Group>;
1292defm borland_extensions : BoolFOption<"borland-extensions",
1293  LangOpts<"Borland">, DefaultFalse,
1294  PosFlag<SetTrue, [CC1Option], "Accept non-standard constructs supported by the Borland compiler">,
1295  NegFlag<SetFalse>>;
1296def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>, Flags<[CoreOption]>;
1297def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group<f_Group>,
1298  Flags<[NoXarchOption]>, HelpText<"Load the clang builtins module map file.">;
1299defm caret_diagnostics : BoolFOption<"caret-diagnostics",
1300  DiagnosticOpts<"ShowCarets">, DefaultTrue,
1301  NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>>;
1302def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group<f_clang_Group>,
1303  Flags<[CC1Option]>, MetaVarName<"<version>">, Values<"<major>.<minor>,latest">,
1304  HelpText<"Attempt to match the ABI of Clang <version>">;
1305def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>;
1306defm color_diagnostics : OptInCC1FFlag<"color-diagnostics", "Enable", "Disable", " colors in diagnostics",
1307  [CoreOption, FlangOption]>;
1308def fdiagnostics_color : Flag<["-"], "fdiagnostics-color">, Group<f_Group>,
1309  Flags<[CoreOption, NoXarchOption]>;
1310def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group<f_Group>;
1311def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group<f_Group>,
1312  Flags<[CoreOption, CC1Option]>, HelpText<"Use ANSI escape codes for diagnostics">,
1313  MarshallingInfoFlag<DiagnosticOpts<"UseANSIEscapeCodes">>;
1314def fcomment_block_commands : CommaJoined<["-"], "fcomment-block-commands=">, Group<f_clang_Group>, Flags<[CC1Option]>,
1315  HelpText<"Treat each comma separated argument in <arg> as a documentation comment block command">,
1316  MetaVarName<"<arg>">, MarshallingInfoStringVector<LangOpts<"CommentOpts.BlockCommandNames">>;
1317def fparse_all_comments : Flag<["-"], "fparse-all-comments">, Group<f_clang_Group>, Flags<[CC1Option]>,
1318  MarshallingInfoFlag<LangOpts<"CommentOpts.ParseAllComments">>;
1319def frecord_command_line : Flag<["-"], "frecord-command-line">,
1320  Group<f_clang_Group>;
1321def fno_record_command_line : Flag<["-"], "fno-record-command-line">,
1322  Group<f_clang_Group>;
1323def : Flag<["-"], "frecord-gcc-switches">, Alias<frecord_command_line>;
1324def : Flag<["-"], "fno-record-gcc-switches">, Alias<fno_record_command_line>;
1325def fcommon : Flag<["-"], "fcommon">, Group<f_Group>,
1326  Flags<[CoreOption, CC1Option]>, HelpText<"Place uninitialized global variables in a common block">,
1327  MarshallingInfoNegativeFlag<CodeGenOpts<"NoCommon">>;
1328def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group<f_Group>;
1329defm complete_member_pointers : BoolOption<"f", "complete-member-pointers",
1330  LangOpts<"CompleteMemberPointers">, DefaultFalse,
1331  PosFlag<SetTrue, [CC1Option], "Require">, NegFlag<SetFalse, [], "Do not require">,
1332  BothFlags<[CoreOption], " member pointer base types to be complete if they"
1333            " would be significant under the Microsoft ABI">>,
1334  Group<f_clang_Group>;
1335def fcf_runtime_abi_EQ : Joined<["-"], "fcf-runtime-abi=">, Group<f_Group>,
1336    Flags<[CC1Option]>, Values<"unspecified,standalone,objc,swift,swift-5.0,swift-4.2,swift-4.1">,
1337    NormalizedValuesScope<"LangOptions::CoreFoundationABI">,
1338    NormalizedValues<["ObjectiveC", "ObjectiveC", "ObjectiveC", "Swift5_0", "Swift5_0", "Swift4_2", "Swift4_1"]>,
1339    MarshallingInfoEnum<LangOpts<"CFRuntime">, "ObjectiveC">;
1340defm constant_cfstrings : BoolFOption<"constant-cfstrings",
1341  LangOpts<"NoConstantCFStrings">, DefaultFalse,
1342  NegFlag<SetTrue, [CC1Option], "Disable creation of CodeFoundation-type constant strings">,
1343  PosFlag<SetFalse>>;
1344def fconstant_string_class_EQ : Joined<["-"], "fconstant-string-class=">, Group<f_Group>;
1345def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group<f_Group>;
1346def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group<f_Group>;
1347def fexperimental_new_constant_interpreter : Flag<["-"], "fexperimental-new-constant-interpreter">, Group<f_Group>,
1348  HelpText<"Enable the experimental new constant interpreter">, Flags<[CC1Option]>,
1349  MarshallingInfoFlag<LangOpts<"EnableNewConstInterp">>;
1350def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">,
1351                                    Group<f_Group>;
1352def fno_crash_diagnostics : Flag<["-"], "fno-crash-diagnostics">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
1353  HelpText<"Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash">;
1354def fcrash_diagnostics_dir : Joined<["-"], "fcrash-diagnostics-dir=">,
1355  Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
1356  HelpText<"Put crash-report files in <dir>">, MetaVarName<"<dir>">;
1357def fcreate_profile : Flag<["-"], "fcreate-profile">, Group<f_Group>;
1358defm cxx_exceptions: BoolFOption<"cxx-exceptions",
1359  LangOpts<"CXXExceptions">, DefaultFalse,
1360  PosFlag<SetTrue, [CC1Option], "Enable C++ exceptions">, NegFlag<SetFalse>>;
1361defm async_exceptions: BoolFOption<"async-exceptions",
1362  LangOpts<"EHAsynch">, DefaultFalse,
1363  PosFlag<SetTrue, [CC1Option], "Enable EH Asynchronous exceptions">, NegFlag<SetFalse>>;
1364defm cxx_modules : BoolFOption<"cxx-modules",
1365  LangOpts<"CPlusPlusModules">, Default<cpp20.KeyPath>,
1366  NegFlag<SetFalse, [CC1Option], "Disable">, PosFlag<SetTrue, [], "Enable">,
1367  BothFlags<[NoXarchOption], " modules for C++">>,
1368  ShouldParseIf<cplusplus.KeyPath>;
1369def fdebug_pass_arguments : Flag<["-"], "fdebug-pass-arguments">, Group<f_Group>;
1370def fdebug_pass_structure : Flag<["-"], "fdebug-pass-structure">, Group<f_Group>;
1371def fdepfile_entry : Joined<["-"], "fdepfile-entry=">,
1372    Group<f_clang_Group>, Flags<[CC1Option]>;
1373def fdiagnostics_fixit_info : Flag<["-"], "fdiagnostics-fixit-info">, Group<f_clang_Group>;
1374def fno_diagnostics_fixit_info : Flag<["-"], "fno-diagnostics-fixit-info">, Group<f_Group>,
1375  Flags<[CC1Option]>, HelpText<"Do not include fixit information in diagnostics">,
1376  MarshallingInfoNegativeFlag<DiagnosticOpts<"ShowFixits">>;
1377def fdiagnostics_parseable_fixits : Flag<["-"], "fdiagnostics-parseable-fixits">, Group<f_clang_Group>,
1378    Flags<[CoreOption, CC1Option]>, HelpText<"Print fix-its in machine parseable form">,
1379    MarshallingInfoFlag<DiagnosticOpts<"ShowParseableFixits">>;
1380def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">,
1381    Group<f_clang_Group>,  Flags<[CC1Option]>,
1382    HelpText<"Print source range spans in numeric form">,
1383    MarshallingInfoFlag<DiagnosticOpts<"ShowSourceRanges">>;
1384defm diagnostics_show_hotness : BoolFOption<"diagnostics-show-hotness",
1385  CodeGenOpts<"DiagnosticsWithHotness">, DefaultFalse,
1386  PosFlag<SetTrue, [CC1Option], "Enable profile hotness information in diagnostic line">,
1387  NegFlag<SetFalse>>;
1388def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">,
1389    Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<value>">,
1390    HelpText<"Prevent optimization remarks from being output if they do not have at least this profile count. "
1391    "Use 'auto' to apply the threshold from profile summary">;
1392defm diagnostics_show_option : BoolFOption<"diagnostics-show-option",
1393    DiagnosticOpts<"ShowOptionNames">, DefaultTrue,
1394    NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue, [], "Print option name with mappable diagnostics">>;
1395defm diagnostics_show_note_include_stack : BoolFOption<"diagnostics-show-note-include-stack",
1396    DiagnosticOpts<"ShowNoteIncludeStack">, DefaultFalse,
1397    PosFlag<SetTrue, [], "Display include stacks for diagnostic notes">,
1398    NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
1399def fdiagnostics_format_EQ : Joined<["-"], "fdiagnostics-format=">, Group<f_clang_Group>;
1400def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">, Group<f_clang_Group>;
1401def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">,
1402    Group<f_Group>, Flags<[CC1Option]>,
1403    HelpText<"Print a template comparison tree for differing templates">,
1404    MarshallingInfoFlag<DiagnosticOpts<"ShowTemplateTree">>;
1405def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">, Group<f_clang_Group>,
1406  HelpText<"Discard value names in LLVM IR">, Flags<[NoXarchOption]>;
1407def fno_discard_value_names : Flag<["-"], "fno-discard-value-names">, Group<f_clang_Group>,
1408  HelpText<"Do not discard value names in LLVM IR">, Flags<[NoXarchOption]>;
1409defm dollars_in_identifiers : BoolFOption<"dollars-in-identifiers",
1410  LangOpts<"DollarIdents">, Default<!strconcat("!", asm_preprocessor.KeyPath)>,
1411  PosFlag<SetTrue, [], "Allow">, NegFlag<SetFalse, [], "Disallow">,
1412  BothFlags<[CC1Option], " '$' in identifiers">>;
1413def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
1414def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
1415defm dwarf_directory_asm : BoolFOption<"dwarf-directory-asm",
1416  CodeGenOpts<"NoDwarfDirectoryAsm">, DefaultFalse,
1417  NegFlag<SetTrue, [CC1Option]>, PosFlag<SetFalse>>;
1418defm elide_constructors : BoolFOption<"elide-constructors",
1419  LangOpts<"ElideConstructors">, DefaultTrue,
1420  NegFlag<SetFalse, [CC1Option], "Disable C++ copy constructor elision">,
1421  PosFlag<SetTrue>>;
1422def fno_elide_type : Flag<["-"], "fno-elide-type">, Group<f_Group>,
1423    Flags<[CC1Option]>,
1424    HelpText<"Do not elide types when printing diagnostics">,
1425    MarshallingInfoNegativeFlag<DiagnosticOpts<"ElideType">>;
1426def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group<f_Group>;
1427defm eliminate_unused_debug_types : OptOutCC1FFlag<"eliminate-unused-debug-types",
1428  "Do not emit ", "Emit ", " debug info for defined but unused types">;
1429def femit_all_decls : Flag<["-"], "femit-all-decls">, Group<f_Group>, Flags<[CC1Option]>,
1430  HelpText<"Emit all declarations, even if unused">,
1431  MarshallingInfoFlag<LangOpts<"EmitAllDecls">>;
1432defm emulated_tls : BoolFOption<"emulated-tls",
1433  CodeGenOpts<"EmulatedTLS">, DefaultFalse,
1434  PosFlag<SetTrue, [CC1Option], "Use emutls functions to access thread_local variables">,
1435  NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
1436def fencoding_EQ : Joined<["-"], "fencoding=">, Group<f_Group>;
1437def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<f_Group>, Flags<[CoreOption]>;
1438defm exceptions : BoolFOption<"exceptions",
1439  LangOpts<"Exceptions">, DefaultFalse,
1440  PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1441  BothFlags<[], " support for exception handling">>;
1442def fdwarf_exceptions : Flag<["-"], "fdwarf-exceptions">, Group<f_Group>,
1443  HelpText<"Use DWARF style exceptions">;
1444def fsjlj_exceptions : Flag<["-"], "fsjlj-exceptions">, Group<f_Group>,
1445  HelpText<"Use SjLj style exceptions">;
1446def fseh_exceptions : Flag<["-"], "fseh-exceptions">, Group<f_Group>,
1447  HelpText<"Use SEH style exceptions">;
1448def fwasm_exceptions : Flag<["-"], "fwasm-exceptions">, Group<f_Group>,
1449  HelpText<"Use WebAssembly style exceptions">;
1450def exception_model : Separate<["-"], "exception-model">,
1451  Flags<[CC1Option, NoDriverOption]>, HelpText<"The exception model: dwarf|sjlj|seh|wasm">,
1452  Values<"dwarf,sjlj,seh,wasm">,
1453  NormalizedValuesScope<"LangOptions::ExceptionHandlingKind">,
1454  NormalizedValues<["DwarfCFI", "SjLj", "WinEH", "Wasm"]>,
1455  MarshallingInfoEnum<LangOpts<"ExceptionHandling">, "None">;
1456def exception_model_EQ : Joined<["-"], "exception-model=">,
1457  Flags<[CC1Option, NoDriverOption]>, Alias<exception_model>;
1458def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group<f_Group>, Flags<[CC1Option]>,
1459  HelpText<"Enable support for ignoring exception handling constructs">,
1460  MarshallingInfoFlag<LangOpts<"IgnoreExceptions">>;
1461def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">,
1462    Group<clang_ignored_gcc_optimization_f_Group>;
1463def : Flag<["-"], "fexpensive-optimizations">, Group<clang_ignored_gcc_optimization_f_Group>;
1464def : Flag<["-"], "fno-expensive-optimizations">, Group<clang_ignored_gcc_optimization_f_Group>;
1465def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group<f_Group>;
1466def : Flag<["-"], "fdefer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
1467def : Flag<["-"], "fno-defer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
1468def : Flag<["-"], "fextended-identifiers">, Group<clang_ignored_f_Group>;
1469def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>, Flags<[Unsupported]>;
1470def fhosted : Flag<["-"], "fhosted">, Group<f_Group>;
1471def fdenormal_fp_math_EQ : Joined<["-"], "fdenormal-fp-math=">, Group<f_Group>, Flags<[CC1Option]>;
1472def ffp_model_EQ : Joined<["-"], "ffp-model=">, Group<f_Group>, Flags<[NoXarchOption]>,
1473  HelpText<"Controls the semantics of floating-point calculations.">;
1474def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<f_Group>, Flags<[CC1Option]>,
1475  HelpText<"Specifies the exception behavior of floating-point operations.">,
1476  Values<"ignore,maytrap,strict">, NormalizedValuesScope<"LangOptions">,
1477  NormalizedValues<["FPE_Ignore", "FPE_MayTrap", "FPE_Strict"]>,
1478  MarshallingInfoEnum<LangOpts<"FPExceptionMode">, "FPE_Ignore">;
1479defm fast_math : BoolFOption<"fast-math",
1480  LangOpts<"FastMath">, DefaultFalse,
1481  PosFlag<SetTrue, [CC1Option], "Allow aggressive, lossy floating-point optimizations",
1482          [cl_fast_relaxed_math.KeyPath]>,
1483  NegFlag<SetFalse>>;
1484def menable_unsafe_fp_math : Flag<["-"], "menable-unsafe-fp-math">, Flags<[CC1Option]>,
1485  HelpText<"Allow unsafe floating-point math optimizations which may decrease precision">,
1486  MarshallingInfoFlag<LangOpts<"UnsafeFPMath">>,
1487  ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, ffast_math.KeyPath]>;
1488defm math_errno : BoolFOption<"math-errno",
1489  LangOpts<"MathErrno">, DefaultFalse,
1490  PosFlag<SetTrue, [CC1Option], "Require math functions to indicate errors by setting errno">,
1491  NegFlag<SetFalse>>,
1492  ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
1493def fextend_args_EQ : Joined<["-"], "fextend-arguments=">, Group<f_Group>,
1494  Flags<[CC1Option, NoArgumentUnused]>,
1495  HelpText<"Controls how scalar integer arguments are extended in calls "
1496           "to unprototyped and varargs functions">,
1497  Values<"32,64">,
1498  NormalizedValues<["ExtendTo32", "ExtendTo64"]>,
1499  NormalizedValuesScope<"LangOptions::ExtendArgsKind">,
1500  MarshallingInfoEnum<LangOpts<"ExtendIntArgs">,"ExtendTo32">;
1501def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group<f_Group>, Flags<[CoreOption]>;
1502def fsignaling_math : Flag<["-"], "fsignaling-math">, Group<f_Group>;
1503def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group<f_Group>;
1504defm jump_tables : BoolFOption<"jump-tables",
1505  CodeGenOpts<"NoUseJumpTables">, DefaultFalse,
1506  NegFlag<SetTrue, [CC1Option], "Do not use">, PosFlag<SetFalse, [], "Use">,
1507  BothFlags<[], " jump tables for lowering switches">>;
1508defm force_enable_int128 : BoolFOption<"force-enable-int128",
1509  TargetOpts<"ForceEnableInt128">, DefaultFalse,
1510  PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1511  BothFlags<[], " support for int128_t type">>;
1512defm keep_static_consts : BoolFOption<"keep-static-consts",
1513  CodeGenOpts<"KeepStaticConsts">, DefaultFalse,
1514  PosFlag<SetTrue, [CC1Option], "Keep">, NegFlag<SetFalse, [], "Don't keep">,
1515  BothFlags<[NoXarchOption], " static const variables if unused">>;
1516defm fixed_point : BoolFOption<"fixed-point",
1517  LangOpts<"FixedPoint">, DefaultFalse,
1518  PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1519  BothFlags<[], " fixed point types">>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
1520defm cxx_static_destructors : BoolFOption<"c++-static-destructors",
1521  LangOpts<"RegisterStaticDestructors">, DefaultTrue,
1522  NegFlag<SetFalse, [CC1Option], "Disable C++ static destructor registration">,
1523  PosFlag<SetTrue>>;
1524def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group<f_Group>,
1525  Flags<[CC1Option]>, MarshallingInfoString<CodeGenOpts<"SymbolPartition">>;
1526
1527defm memory_profile : OptInCC1FFlag<"memory-profile", "Enable", "Disable", " heap memory profiling">;
1528def fmemory_profile_EQ : Joined<["-"], "fmemory-profile=">,
1529    Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<directory>">,
1530    HelpText<"Enable heap memory profiling and dump results into <directory>">;
1531
1532// Begin sanitizer flags. These should all be core options exposed in all driver
1533// modes.
1534let Flags = [CC1Option, CoreOption] in {
1535
1536def fsanitize_EQ : CommaJoined<["-"], "fsanitize=">, Group<f_clang_Group>,
1537                   MetaVarName<"<check>">,
1538                   HelpText<"Turn on runtime checks for various forms of undefined "
1539                            "or suspicious behavior. See user manual for available checks">;
1540def fno_sanitize_EQ : CommaJoined<["-"], "fno-sanitize=">, Group<f_clang_Group>,
1541                      Flags<[CoreOption, NoXarchOption]>;
1542
1543def fsanitize_ignorelist_EQ : Joined<["-"], "fsanitize-ignorelist=">,
1544  Group<f_clang_Group>, HelpText<"Path to ignorelist file for sanitizers">;
1545def : Joined<["-"], "fsanitize-blacklist=">,
1546  Group<f_clang_Group>, Flags<[HelpHidden]>, Alias<fsanitize_ignorelist_EQ>,
1547  HelpText<"Alias for -fsanitize-ignorelist=">;
1548
1549def fsanitize_system_ignorelist_EQ : Joined<["-"], "fsanitize-system-ignorelist=">,
1550  HelpText<"Path to system ignorelist file for sanitizers">, Flags<[CC1Option]>;
1551def : Joined<["-"], "fsanitize-system-blacklist=">,
1552  HelpText<"Alias for -fsanitize-system-ignorelist=">,
1553  Flags<[CC1Option, HelpHidden]>, Alias<fsanitize_system_ignorelist_EQ>;
1554
1555def fno_sanitize_ignorelist : Flag<["-"], "fno-sanitize-ignorelist">,
1556  Group<f_clang_Group>, HelpText<"Don't use ignorelist file for sanitizers">;
1557def : Flag<["-"], "fno-sanitize-blacklist">,
1558  Group<f_clang_Group>, Flags<[HelpHidden]>, Alias<fno_sanitize_ignorelist>;
1559
1560def fsanitize_coverage : CommaJoined<["-"], "fsanitize-coverage=">,
1561  Group<f_clang_Group>,
1562  HelpText<"Specify the type of coverage instrumentation for Sanitizers">;
1563def fno_sanitize_coverage : CommaJoined<["-"], "fno-sanitize-coverage=">,
1564  Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1565  HelpText<"Disable features of coverage instrumentation for Sanitizers">,
1566  Values<"func,bb,edge,indirect-calls,trace-bb,trace-cmp,trace-div,trace-gep,"
1567         "8bit-counters,trace-pc,trace-pc-guard,no-prune,inline-8bit-counters,"
1568         "inline-bool-flag">;
1569def fsanitize_coverage_allowlist : Joined<["-"], "fsanitize-coverage-allowlist=">,
1570    Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1571    HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
1572    MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageAllowlistFiles">>;
1573def : Joined<["-"], "fsanitize-coverage-whitelist=">,
1574  Group<f_clang_Group>, Flags<[CoreOption, HelpHidden]>, Alias<fsanitize_coverage_allowlist>,
1575  HelpText<"Deprecated, use -fsanitize-coverage-allowlist= instead">;
1576def fsanitize_coverage_ignorelist : Joined<["-"], "fsanitize-coverage-ignorelist=">,
1577    Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1578    HelpText<"Disable sanitizer coverage instrumentation for modules and functions "
1579             "that match the provided special case list, even the allowed ones">,
1580    MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageIgnorelistFiles">>;
1581def : Joined<["-"], "fsanitize-coverage-blacklist=">,
1582  Group<f_clang_Group>, Flags<[CoreOption, HelpHidden]>,
1583  Alias<fsanitize_coverage_ignorelist>,
1584  HelpText<"Deprecated, use -fsanitize-coverage-ignorelist= instead">;
1585def fsanitize_memory_track_origins_EQ : Joined<["-"], "fsanitize-memory-track-origins=">,
1586                                        Group<f_clang_Group>,
1587                                        HelpText<"Enable origins tracking in MemorySanitizer">,
1588                                        MarshallingInfoInt<CodeGenOpts<"SanitizeMemoryTrackOrigins">>;
1589def fsanitize_memory_track_origins : Flag<["-"], "fsanitize-memory-track-origins">,
1590                                     Group<f_clang_Group>,
1591                                     HelpText<"Enable origins tracking in MemorySanitizer">;
1592def fno_sanitize_memory_track_origins : Flag<["-"], "fno-sanitize-memory-track-origins">,
1593                                        Group<f_clang_Group>,
1594                                        Flags<[CoreOption, NoXarchOption]>,
1595                                        HelpText<"Disable origins tracking in MemorySanitizer">;
1596def fsanitize_address_outline_instrumentation : Flag<["-"], "fsanitize-address-outline-instrumentation">,
1597                                                Group<f_clang_Group>,
1598                                                HelpText<"Always generate function calls for address sanitizer instrumentation">;
1599def fno_sanitize_address_outline_instrumentation : Flag<["-"], "fno-sanitize-address-outline-instrumentation">,
1600                                                   Group<f_clang_Group>,
1601                                                   HelpText<"Use default code inlining logic for the address sanitizer">;
1602def fsanitize_hwaddress_experimental_aliasing
1603  : Flag<["-"], "fsanitize-hwaddress-experimental-aliasing">,
1604    Group<f_clang_Group>,
1605    HelpText<"Enable aliasing mode in HWAddressSanitizer">;
1606def fno_sanitize_hwaddress_experimental_aliasing
1607  : Flag<["-"], "fno-sanitize-hwaddress-experimental-aliasing">,
1608    Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1609    HelpText<"Disable aliasing mode in HWAddressSanitizer">;
1610defm sanitize_memory_use_after_dtor : BoolOption<"f", "sanitize-memory-use-after-dtor",
1611  CodeGenOpts<"SanitizeMemoryUseAfterDtor">, DefaultFalse,
1612  PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
1613  BothFlags<[], " use-after-destroy detection in MemorySanitizer">>,
1614  Group<f_clang_Group>;
1615def fsanitize_address_field_padding : Joined<["-"], "fsanitize-address-field-padding=">,
1616                                        Group<f_clang_Group>,
1617                                        HelpText<"Level of field padding for AddressSanitizer">,
1618                                        MarshallingInfoInt<LangOpts<"SanitizeAddressFieldPadding">>;
1619defm sanitize_address_use_after_scope : BoolOption<"f", "sanitize-address-use-after-scope",
1620  CodeGenOpts<"SanitizeAddressUseAfterScope">, DefaultFalse,
1621  PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Disable">,
1622  BothFlags<[], " use-after-scope detection in AddressSanitizer">>,
1623  Group<f_clang_Group>;
1624def sanitize_address_use_after_return_EQ
1625  : Joined<["-"], "fsanitize-address-use-after-return=">,
1626    MetaVarName<"<mode>">,
1627    Flags<[CC1Option]>,
1628    HelpText<"Select the mode of detecting stack use-after-return in AddressSanitizer: never | runtime (default) | always">,
1629    Group<f_clang_Group>,
1630    Values<"never,runtime,always">,
1631    NormalizedValuesScope<"llvm::AsanDetectStackUseAfterReturnMode">,
1632    NormalizedValues<["Never", "Runtime", "Always"]>,
1633    MarshallingInfoEnum<CodeGenOpts<"SanitizeAddressUseAfterReturn">, "Runtime">;
1634defm sanitize_address_poison_custom_array_cookie : BoolOption<"f", "sanitize-address-poison-custom-array-cookie",
1635  CodeGenOpts<"SanitizeAddressPoisonCustomArrayCookie">, DefaultFalse,
1636  PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
1637  BothFlags<[], " poisoning array cookies when using custom operator new[] in AddressSanitizer">>,
1638  Group<f_clang_Group>;
1639def fsanitize_address_globals_dead_stripping : Flag<["-"], "fsanitize-address-globals-dead-stripping">,
1640  Group<f_clang_Group>, HelpText<"Enable linker dead stripping of globals in AddressSanitizer">,
1641  MarshallingInfoFlag<CodeGenOpts<"SanitizeAddressGlobalsDeadStripping">, "false">;
1642defm sanitize_address_use_odr_indicator : BoolOption<"f", "sanitize-address-use-odr-indicator",
1643  CodeGenOpts<"SanitizeAddressUseOdrIndicator">, DefaultFalse,
1644  PosFlag<SetTrue, [], "Enable ODR indicator globals to avoid false ODR violation"
1645            " reports in partially sanitized programs at the cost of an increase in binary size">,
1646  NegFlag<SetFalse, [], "Disable ODR indicator globals">>,
1647  Group<f_clang_Group>;
1648def sanitize_address_destructor_EQ
1649    : Joined<["-"], "fsanitize-address-destructor=">,
1650      Flags<[CC1Option]>,
1651      HelpText<"Set destructor type used in ASan instrumentation">,
1652      Group<f_clang_Group>,
1653      Values<"none,global">,
1654      NormalizedValuesScope<"llvm::AsanDtorKind">,
1655      NormalizedValues<["None", "Global"]>,
1656      MarshallingInfoEnum<CodeGenOpts<"SanitizeAddressDtor">, "Global">;
1657// Note: This flag was introduced when it was necessary to distinguish between
1658//       ABI for correct codegen.  This is no longer needed, but the flag is
1659//       not removed since targeting either ABI will behave the same.
1660//       This way we cause no disturbance to existing scripts & code, and if we
1661//       want to use this flag in the future we will cause no disturbance then
1662//       either.
1663def fsanitize_hwaddress_abi_EQ
1664    : Joined<["-"], "fsanitize-hwaddress-abi=">,
1665      Group<f_clang_Group>,
1666      HelpText<"Select the HWAddressSanitizer ABI to target (interceptor or platform, default interceptor). This option is currently unused.">;
1667def fsanitize_recover_EQ : CommaJoined<["-"], "fsanitize-recover=">,
1668                           Group<f_clang_Group>,
1669                           HelpText<"Enable recovery for specified sanitizers">;
1670def fno_sanitize_recover_EQ : CommaJoined<["-"], "fno-sanitize-recover=">,
1671                              Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
1672                              HelpText<"Disable recovery for specified sanitizers">;
1673def fsanitize_recover : Flag<["-"], "fsanitize-recover">, Group<f_clang_Group>,
1674                        Alias<fsanitize_recover_EQ>, AliasArgs<["all"]>;
1675def fno_sanitize_recover : Flag<["-"], "fno-sanitize-recover">,
1676                           Flags<[CoreOption, NoXarchOption]>, Group<f_clang_Group>,
1677                           Alias<fno_sanitize_recover_EQ>, AliasArgs<["all"]>;
1678def fsanitize_trap_EQ : CommaJoined<["-"], "fsanitize-trap=">, Group<f_clang_Group>,
1679                        HelpText<"Enable trapping for specified sanitizers">;
1680def fno_sanitize_trap_EQ : CommaJoined<["-"], "fno-sanitize-trap=">, Group<f_clang_Group>,
1681                           Flags<[CoreOption, NoXarchOption]>,
1682                           HelpText<"Disable trapping for specified sanitizers">;
1683def fsanitize_trap : Flag<["-"], "fsanitize-trap">, Group<f_clang_Group>,
1684                     Alias<fsanitize_trap_EQ>, AliasArgs<["all"]>,
1685                     HelpText<"Enable trapping for all sanitizers">;
1686def fno_sanitize_trap : Flag<["-"], "fno-sanitize-trap">, Group<f_clang_Group>,
1687                        Alias<fno_sanitize_trap_EQ>, AliasArgs<["all"]>,
1688                        Flags<[CoreOption, NoXarchOption]>,
1689                        HelpText<"Disable trapping for all sanitizers">;
1690def fsanitize_undefined_trap_on_error
1691    : Flag<["-"], "fsanitize-undefined-trap-on-error">, Group<f_clang_Group>,
1692      Alias<fsanitize_trap_EQ>, AliasArgs<["undefined"]>;
1693def fno_sanitize_undefined_trap_on_error
1694    : Flag<["-"], "fno-sanitize-undefined-trap-on-error">, Group<f_clang_Group>,
1695      Alias<fno_sanitize_trap_EQ>, AliasArgs<["undefined"]>;
1696defm sanitize_minimal_runtime : BoolOption<"f", "sanitize-minimal-runtime",
1697  CodeGenOpts<"SanitizeMinimalRuntime">, DefaultFalse,
1698  PosFlag<SetTrue>, NegFlag<SetFalse>>,
1699  Group<f_clang_Group>;
1700def fsanitize_link_runtime : Flag<["-"], "fsanitize-link-runtime">,
1701                           Group<f_clang_Group>;
1702def fno_sanitize_link_runtime : Flag<["-"], "fno-sanitize-link-runtime">,
1703                              Group<f_clang_Group>;
1704def fsanitize_link_cxx_runtime : Flag<["-"], "fsanitize-link-c++-runtime">,
1705                                 Group<f_clang_Group>;
1706def fno_sanitize_link_cxx_runtime : Flag<["-"], "fno-sanitize-link-c++-runtime">,
1707                                    Group<f_clang_Group>;
1708defm sanitize_cfi_cross_dso : BoolOption<"f", "sanitize-cfi-cross-dso",
1709  CodeGenOpts<"SanitizeCfiCrossDso">, DefaultFalse,
1710  PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Disable">,
1711  BothFlags<[], " control flow integrity (CFI) checks for cross-DSO calls.">>,
1712  Group<f_clang_Group>;
1713def fsanitize_cfi_icall_generalize_pointers : Flag<["-"], "fsanitize-cfi-icall-generalize-pointers">,
1714                                              Group<f_clang_Group>,
1715                                              HelpText<"Generalize pointers in CFI indirect call type signature checks">,
1716                                              MarshallingInfoFlag<CodeGenOpts<"SanitizeCfiICallGeneralizePointers">>;
1717defm sanitize_cfi_canonical_jump_tables : BoolOption<"f", "sanitize-cfi-canonical-jump-tables",
1718  CodeGenOpts<"SanitizeCfiCanonicalJumpTables">, DefaultFalse,
1719  PosFlag<SetTrue, [], "Make">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Do not make">,
1720  BothFlags<[], " the jump table addresses canonical in the symbol table">>,
1721  Group<f_clang_Group>;
1722defm sanitize_stats : BoolOption<"f", "sanitize-stats",
1723  CodeGenOpts<"SanitizeStats">, DefaultFalse,
1724  PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [CoreOption, NoXarchOption], "Disable">,
1725  BothFlags<[], " sanitizer statistics gathering.">>,
1726  Group<f_clang_Group>;
1727def fsanitize_thread_memory_access : Flag<["-"], "fsanitize-thread-memory-access">,
1728                                     Group<f_clang_Group>,
1729                                     HelpText<"Enable memory access instrumentation in ThreadSanitizer (default)">;
1730def fno_sanitize_thread_memory_access : Flag<["-"], "fno-sanitize-thread-memory-access">,
1731                                        Group<f_clang_Group>,
1732                                        Flags<[CoreOption, NoXarchOption]>,
1733                                        HelpText<"Disable memory access instrumentation in ThreadSanitizer">;
1734def fsanitize_thread_func_entry_exit : Flag<["-"], "fsanitize-thread-func-entry-exit">,
1735                                       Group<f_clang_Group>,
1736                                       HelpText<"Enable function entry/exit instrumentation in ThreadSanitizer (default)">;
1737def fno_sanitize_thread_func_entry_exit : Flag<["-"], "fno-sanitize-thread-func-entry-exit">,
1738                                          Group<f_clang_Group>,
1739                                          Flags<[CoreOption, NoXarchOption]>,
1740                                          HelpText<"Disable function entry/exit instrumentation in ThreadSanitizer">;
1741def fsanitize_thread_atomics : Flag<["-"], "fsanitize-thread-atomics">,
1742                               Group<f_clang_Group>,
1743                               HelpText<"Enable atomic operations instrumentation in ThreadSanitizer (default)">;
1744def fno_sanitize_thread_atomics : Flag<["-"], "fno-sanitize-thread-atomics">,
1745                                  Group<f_clang_Group>,
1746                                  Flags<[CoreOption, NoXarchOption]>,
1747                                  HelpText<"Disable atomic operations instrumentation in ThreadSanitizer">;
1748def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-undefined-strip-path-components=">,
1749  Group<f_clang_Group>, MetaVarName<"<number>">,
1750  HelpText<"Strip (or keep only, if negative) a given number of path components "
1751           "when emitting check metadata.">,
1752  MarshallingInfoInt<CodeGenOpts<"EmitCheckPathComponentsToStrip">, "0", "int">;
1753
1754} // end -f[no-]sanitize* flags
1755
1756def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">,
1757  Group<f_Group>;
1758def fno_unsafe_math_optimizations : Flag<["-"], "fno-unsafe-math-optimizations">,
1759  Group<f_Group>;
1760def fassociative_math : Flag<["-"], "fassociative-math">, Group<f_Group>;
1761def fno_associative_math : Flag<["-"], "fno-associative-math">, Group<f_Group>;
1762defm reciprocal_math : BoolFOption<"reciprocal-math",
1763  LangOpts<"AllowRecip">, DefaultFalse,
1764  PosFlag<SetTrue, [CC1Option], "Allow division operations to be reassociated",
1765          [menable_unsafe_fp_math.KeyPath]>,
1766  NegFlag<SetFalse>>;
1767defm approx_func : BoolFOption<"approx-func", LangOpts<"ApproxFunc">, DefaultFalse,
1768   PosFlag<SetTrue, [CC1Option], "Allow certain math function calls to be replaced "
1769           "with an approximately equivalent calculation",
1770           [menable_unsafe_fp_math.KeyPath]>,
1771   NegFlag<SetFalse>>;
1772defm finite_math_only : BoolFOption<"finite-math-only",
1773  LangOpts<"FiniteMathOnly">, DefaultFalse,
1774  PosFlag<SetTrue, [CC1Option], "", [cl_finite_math_only.KeyPath, ffast_math.KeyPath]>,
1775  NegFlag<SetFalse>>;
1776defm signed_zeros : BoolFOption<"signed-zeros",
1777  LangOpts<"NoSignedZero">, DefaultFalse,
1778  NegFlag<SetTrue, [CC1Option], "Allow optimizations that ignore the sign of floating point zeros",
1779            [cl_no_signed_zeros.KeyPath, menable_unsafe_fp_math.KeyPath]>,
1780  PosFlag<SetFalse>>;
1781def fhonor_nans : Flag<["-"], "fhonor-nans">, Group<f_Group>;
1782def fno_honor_nans : Flag<["-"], "fno-honor-nans">, Group<f_Group>;
1783def fhonor_infinities : Flag<["-"], "fhonor-infinities">, Group<f_Group>;
1784def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, Group<f_Group>;
1785// This option was originally misspelt "infinites" [sic].
1786def : Flag<["-"], "fhonor-infinites">, Alias<fhonor_infinities>;
1787def : Flag<["-"], "fno-honor-infinites">, Alias<fno_honor_infinities>;
1788def frounding_math : Flag<["-"], "frounding-math">, Group<f_Group>, Flags<[CC1Option]>,
1789  MarshallingInfoFlag<LangOpts<"FPRoundingMode">, "llvm::RoundingMode::NearestTiesToEven">,
1790  Normalizer<"makeFlagToValueNormalizer(llvm::RoundingMode::Dynamic)">;
1791def fno_rounding_math : Flag<["-"], "fno-rounding-math">, Group<f_Group>, Flags<[CC1Option]>;
1792def ftrapping_math : Flag<["-"], "ftrapping-math">, Group<f_Group>;
1793def fno_trapping_math : Flag<["-"], "fno-trapping-math">, Group<f_Group>;
1794def ffp_contract : Joined<["-"], "ffp-contract=">, Group<f_Group>,
1795  Flags<[CC1Option]>, HelpText<"Form fused FP ops (e.g. FMAs):"
1796  " fast (fuses across statements disregarding pragmas)"
1797  " | on (only fuses in the same statement unless dictated by pragmas)"
1798  " | off (never fuses)"
1799  " | fast-honor-pragmas (fuses across statements unless diectated by pragmas)."
1800  " Default is 'fast' for CUDA, 'fast-honor-pragmas' for HIP, and 'on' otherwise.">,
1801  Values<"fast,on,off,fast-honor-pragmas">;
1802
1803defm strict_float_cast_overflow : BoolFOption<"strict-float-cast-overflow",
1804  CodeGenOpts<"StrictFloatCastOverflow">, DefaultTrue,
1805  NegFlag<SetFalse, [CC1Option], "Relax language rules and try to match the behavior"
1806            " of the target's native float-to-int conversion instructions">,
1807  PosFlag<SetTrue, [], "Assume that overflowing float-to-int casts are undefined (default)">>;
1808
1809defm protect_parens : BoolFOption<"protect-parens",
1810  LangOpts<"ProtectParens">, DefaultFalse,
1811  PosFlag<SetTrue, [CoreOption, CC1Option],
1812          "Determines whether the optimizer honors parentheses when "
1813          "floating-point expressions are evaluated">,
1814  NegFlag<SetFalse>>;
1815
1816def ffor_scope : Flag<["-"], "ffor-scope">, Group<f_Group>;
1817def fno_for_scope : Flag<["-"], "fno-for-scope">, Group<f_Group>;
1818
1819defm rewrite_imports : BoolFOption<"rewrite-imports",
1820  PreprocessorOutputOpts<"RewriteImports">, DefaultFalse,
1821  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
1822defm rewrite_includes : BoolFOption<"rewrite-includes",
1823  PreprocessorOutputOpts<"RewriteIncludes">, DefaultFalse,
1824  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
1825
1826defm delete_null_pointer_checks : BoolFOption<"delete-null-pointer-checks",
1827  CodeGenOpts<"NullPointerIsValid">, DefaultFalse,
1828  NegFlag<SetTrue, [CC1Option], "Do not treat usage of null pointers as undefined behavior">,
1829  PosFlag<SetFalse, [], "Treat usage of null pointers as undefined behavior (default)">,
1830  BothFlags<[CoreOption]>>;
1831
1832def frewrite_map_file_EQ : Joined<["-"], "frewrite-map-file=">,
1833                           Group<f_Group>,
1834                           Flags<[NoXarchOption, CC1Option]>,
1835                           MarshallingInfoStringVector<CodeGenOpts<"RewriteMapFiles">>;
1836
1837defm use_line_directives : BoolFOption<"use-line-directives",
1838  PreprocessorOutputOpts<"UseLineDirectives">, DefaultFalse,
1839  PosFlag<SetTrue, [CC1Option], "Use #line in preprocessed output">, NegFlag<SetFalse>>;
1840defm minimize_whitespace : BoolFOption<"minimize-whitespace",
1841  PreprocessorOutputOpts<"MinimizeWhitespace">, DefaultFalse,
1842  PosFlag<SetTrue, [CC1Option], "Minimize whitespace when emitting preprocessor output">, NegFlag<SetFalse>>;
1843
1844def ffreestanding : Flag<["-"], "ffreestanding">, Group<f_Group>, Flags<[CC1Option]>,
1845  HelpText<"Assert that the compilation takes place in a freestanding environment">,
1846  MarshallingInfoFlag<LangOpts<"Freestanding">>;
1847def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group<f_Group>,
1848  HelpText<"Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)">,
1849  Flags<[CC1Option, CoreOption]>;
1850// We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension
1851// keywords. This behavior is provided by GCC's poorly named '-fasm' flag,
1852// while a subset (the non-C++ GNU keywords) is provided by GCC's
1853// '-fgnu-keywords'. Clang conflates the two for simplicity under the single
1854// name, as it doesn't seem a useful distinction.
1855defm gnu_keywords : BoolFOption<"gnu-keywords",
1856  LangOpts<"GNUKeywords">, Default<gnu_mode.KeyPath>,
1857  PosFlag<SetTrue, [], "Allow GNU-extension keywords regardless of language standard">,
1858  NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
1859defm gnu89_inline : BoolFOption<"gnu89-inline",
1860  LangOpts<"GNUInline">, Default<!strconcat("!", c99.KeyPath, " && !", cplusplus.KeyPath)>,
1861  PosFlag<SetTrue, [CC1Option], "Use the gnu89 inline semantics">,
1862  NegFlag<SetFalse>>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
1863def fgnu_runtime : Flag<["-"], "fgnu-runtime">, Group<f_Group>,
1864  HelpText<"Generate output compatible with the standard GNU Objective-C runtime">;
1865def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">, Flags<[CC1Option]>,
1866  MarshallingInfoFlag<LangOpts<"HeinousExtensions">>;
1867def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>,
1868               Group<Link_Group>;
1869def : Flag<["-"], "findirect-virtual-calls">, Alias<fapple_kext>;
1870def finline_functions : Flag<["-"], "finline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>,
1871  HelpText<"Inline suitable functions">;
1872def finline_hint_functions: Flag<["-"], "finline-hint-functions">, Group<f_clang_Group>, Flags<[CC1Option]>,
1873  HelpText<"Inline functions which are (explicitly or implicitly) marked inline">;
1874def finline : Flag<["-"], "finline">, Group<clang_ignored_f_Group>;
1875def fglobal_isel : Flag<["-"], "fglobal-isel">, Group<f_clang_Group>,
1876  HelpText<"Enables the global instruction selector">;
1877def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group<f_clang_Group>,
1878  Alias<fglobal_isel>;
1879defm legacy_pass_manager : BoolOption<"f", "legacy-pass-manager",
1880  CodeGenOpts<"LegacyPassManager">, Default<"!static_cast<unsigned>(LLVM_ENABLE_NEW_PASS_MANAGER)">,
1881  PosFlag<SetTrue, [], "Use the legacy pass manager in LLVM (deprecated, to be removed in a future release)">,
1882  NegFlag<SetFalse, [], "Use the new pass manager in LLVM">,
1883  BothFlags<[CC1Option]>>, Group<f_clang_Group>;
1884def fexperimental_new_pass_manager : Flag<["-"], "fexperimental-new-pass-manager">,
1885  Group<f_clang_Group>, Flags<[CC1Option]>, Alias<fno_legacy_pass_manager>;
1886def fno_experimental_new_pass_manager : Flag<["-"], "fno-experimental-new-pass-manager">,
1887  Group<f_clang_Group>, Flags<[CC1Option]>, Alias<flegacy_pass_manager>;
1888def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">,
1889  Group<f_clang_Group>, Flags<[CC1Option]>,
1890  HelpText<"Enables experimental strict floating point in LLVM.">,
1891  MarshallingInfoFlag<LangOpts<"ExpStrictFP">>;
1892def finput_charset_EQ : Joined<["-"], "finput-charset=">, Flags<[FlangOption, FC1Option]>, Group<f_Group>,
1893  HelpText<"Specify the default character set for source files">;
1894def fexec_charset_EQ : Joined<["-"], "fexec-charset=">, Group<f_Group>;
1895def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>, Flags<[CC1Option]>,
1896  HelpText<"Generate calls to instrument function entry and exit">,
1897  MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctions">>;
1898def finstrument_functions_after_inlining : Flag<["-"], "finstrument-functions-after-inlining">, Group<f_Group>, Flags<[CC1Option]>,
1899  HelpText<"Like -finstrument-functions, but insert the calls after inlining">,
1900  MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionsAfterInlining">>;
1901def finstrument_function_entry_bare : Flag<["-"], "finstrument-function-entry-bare">, Group<f_Group>, Flags<[CC1Option]>,
1902  HelpText<"Instrument function entry only, after inlining, without arguments to the instrumentation call">,
1903  MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionEntryBare">>;
1904def fcf_protection_EQ : Joined<["-"], "fcf-protection=">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
1905  HelpText<"Instrument control-flow architecture protection. Options: return, branch, full, none.">, Values<"return,branch,full,none">;
1906def fcf_protection : Flag<["-"], "fcf-protection">, Group<f_Group>, Flags<[CoreOption, CC1Option]>,
1907  Alias<fcf_protection_EQ>, AliasArgs<["full"]>,
1908  HelpText<"Enable cf-protection in 'full' mode">;
1909
1910defm xray_instrument : BoolFOption<"xray-instrument",
1911  LangOpts<"XRayInstrument">, DefaultFalse,
1912  PosFlag<SetTrue, [CC1Option], "Generate XRay instrumentation sleds on function entry and exit">,
1913  NegFlag<SetFalse>>;
1914
1915def fxray_instruction_threshold_EQ :
1916  JoinedOrSeparate<["-"], "fxray-instruction-threshold=">,
1917  Group<f_Group>, Flags<[CC1Option]>,
1918  HelpText<"Sets the minimum function size to instrument with XRay">,
1919  MarshallingInfoInt<CodeGenOpts<"XRayInstructionThreshold">, "200">;
1920def fxray_instruction_threshold_ :
1921  JoinedOrSeparate<["-"], "fxray-instruction-threshold">,
1922  Group<f_Group>, Flags<[CC1Option]>;
1923
1924def fxray_always_instrument :
1925  JoinedOrSeparate<["-"], "fxray-always-instrument=">,
1926  Group<f_Group>, Flags<[CC1Option]>,
1927  HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.">,
1928  MarshallingInfoStringVector<LangOpts<"XRayAlwaysInstrumentFiles">>;
1929def fxray_never_instrument :
1930  JoinedOrSeparate<["-"], "fxray-never-instrument=">,
1931  Group<f_Group>, Flags<[CC1Option]>,
1932  HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.">,
1933  MarshallingInfoStringVector<LangOpts<"XRayNeverInstrumentFiles">>;
1934def fxray_attr_list :
1935  JoinedOrSeparate<["-"], "fxray-attr-list=">,
1936  Group<f_Group>, Flags<[CC1Option]>,
1937  HelpText<"Filename defining the list of functions/types for imbuing XRay attributes.">,
1938  MarshallingInfoStringVector<LangOpts<"XRayAttrListFiles">>;
1939def fxray_modes :
1940  JoinedOrSeparate<["-"], "fxray-modes=">,
1941  Group<f_Group>, Flags<[CC1Option]>,
1942  HelpText<"List of modes to link in by default into XRay instrumented binaries.">;
1943
1944defm xray_always_emit_customevents : BoolFOption<"xray-always-emit-customevents",
1945  LangOpts<"XRayAlwaysEmitCustomEvents">, DefaultFalse,
1946  PosFlag<SetTrue, [CC1Option], "Always emit __xray_customevent(...) calls"
1947          " even if the containing function is not always instrumented">,
1948  NegFlag<SetFalse>>;
1949
1950defm xray_always_emit_typedevents : BoolFOption<"xray-always-emit-typedevents",
1951  LangOpts<"XRayAlwaysEmitTypedEvents">, DefaultFalse,
1952  PosFlag<SetTrue, [CC1Option], "Always emit __xray_typedevent(...) calls"
1953          " even if the containing function is not always instrumented">,
1954  NegFlag<SetFalse>>;
1955
1956defm xray_ignore_loops : BoolFOption<"xray-ignore-loops",
1957  CodeGenOpts<"XRayIgnoreLoops">, DefaultFalse,
1958  PosFlag<SetTrue, [CC1Option], "Don't instrument functions with loops"
1959          " unless they also meet the minimum function size">,
1960  NegFlag<SetFalse>>;
1961
1962defm xray_function_index : BoolFOption<"xray-function-index",
1963  CodeGenOpts<"XRayOmitFunctionIndex">, DefaultTrue,
1964  NegFlag<SetFalse, [CC1Option], "Omit function index section at the"
1965          " expense of single-function patching performance">,
1966  PosFlag<SetTrue>>;
1967
1968def fxray_link_deps : Flag<["-"], "fxray-link-deps">, Group<f_Group>,
1969  Flags<[CC1Option]>,
1970  HelpText<"Tells clang to add the link dependencies for XRay.">;
1971def fnoxray_link_deps : Flag<["-"], "fnoxray-link-deps">, Group<f_Group>,
1972  Flags<[CC1Option]>;
1973
1974def fxray_instrumentation_bundle :
1975  JoinedOrSeparate<["-"], "fxray-instrumentation-bundle=">,
1976  Group<f_Group>, Flags<[CC1Option]>,
1977  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'.">;
1978
1979def fxray_function_groups :
1980  Joined<["-"], "fxray-function-groups=">,
1981  Group<f_Group>, Flags<[CC1Option]>,
1982  HelpText<"Only instrument 1 of N groups">,
1983  MarshallingInfoInt<CodeGenOpts<"XRayTotalFunctionGroups">, "1">;
1984
1985def fxray_selected_function_group :
1986  Joined<["-"], "fxray-selected-function-group=">,
1987  Group<f_Group>, Flags<[CC1Option]>,
1988  HelpText<"When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1">,
1989  MarshallingInfoInt<CodeGenOpts<"XRaySelectedFunctionGroup">, "0">;
1990
1991
1992defm fine_grained_bitfield_accesses : BoolOption<"f", "fine-grained-bitfield-accesses",
1993  CodeGenOpts<"FineGrainedBitfieldAccesses">, DefaultFalse,
1994  PosFlag<SetTrue, [], "Use separate accesses for consecutive bitfield runs with legal widths and alignments.">,
1995  NegFlag<SetFalse, [], "Use large-integer access for consecutive bitfield runs.">,
1996  BothFlags<[CC1Option]>>,
1997  Group<f_clang_Group>;
1998
1999def fexperimental_relative_cxx_abi_vtables :
2000  Flag<["-"], "fexperimental-relative-c++-abi-vtables">,
2001  Group<f_clang_Group>, Flags<[CC1Option]>,
2002  HelpText<"Use the experimental C++ class ABI for classes with virtual tables">;
2003def fno_experimental_relative_cxx_abi_vtables :
2004  Flag<["-"], "fno-experimental-relative-c++-abi-vtables">,
2005  Group<f_clang_Group>, Flags<[CC1Option]>,
2006  HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">;
2007
2008def fcxx_abi_EQ : Joined<["-"], "fc++-abi=">,
2009                  Group<f_clang_Group>, Flags<[CC1Option]>,
2010                  HelpText<"C++ ABI to use. This will override the target C++ ABI.">;
2011
2012def flat__namespace : Flag<["-"], "flat_namespace">;
2013def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, Group<f_Group>,
2014  HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">, Flags<[CC1Option]>,
2015  NormalizedValues<["LangOptions::LaxVectorConversionKind::None",
2016                    "LangOptions::LaxVectorConversionKind::Integer",
2017                    "LangOptions::LaxVectorConversionKind::All"]>,
2018  MarshallingInfoEnum<LangOpts<"LaxVectorConversions">,
2019                      open_cl.KeyPath #
2020                          " ? LangOptions::LaxVectorConversionKind::None" #
2021                          " : LangOptions::LaxVectorConversionKind::All">;
2022def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Group>,
2023  Alias<flax_vector_conversions_EQ>, AliasArgs<["integer"]>;
2024def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
2025def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group<f_Group>,
2026  HelpText<"Force linking the clang builtins runtime library">;
2027def flto_EQ : Joined<["-"], "flto=">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2028  HelpText<"Set LTO mode to either 'full' or 'thin'">, Values<"thin,full">;
2029def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Group<f_Group>,
2030  Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
2031def flto_EQ_auto : Flag<["-"], "flto=auto">, Group<f_Group>,
2032  Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
2033def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2034  Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
2035def fno_lto : Flag<["-"], "fno-lto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2036  HelpText<"Disable LTO mode (default)">;
2037def foffload_lto_EQ : Joined<["-"], "foffload-lto=">, Flags<[CoreOption]>, Group<f_Group>,
2038  HelpText<"Set LTO mode to either 'full' or 'thin' for offload compilation">, Values<"thin,full">;
2039def foffload_lto : Flag<["-"], "foffload-lto">, Flags<[CoreOption]>, Group<f_Group>,
2040  Alias<foffload_lto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode for offload compilation">;
2041def fno_offload_lto : Flag<["-"], "fno-offload-lto">, Flags<[CoreOption]>, Group<f_Group>,
2042  HelpText<"Disable LTO mode (default) for offload compilation">;
2043def flto_jobs_EQ : Joined<["-"], "flto-jobs=">,
2044  Flags<[CC1Option]>, Group<f_Group>,
2045  HelpText<"Controls the backend parallelism of -flto=thin (default "
2046           "of 0 means the number of threads will be derived from "
2047           "the number of CPUs detected)">;
2048def fthinlto_index_EQ : Joined<["-"], "fthinlto-index=">,
2049  Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2050  HelpText<"Perform ThinLTO importing using provided function summary index">;
2051def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
2052  Flags<[CoreOption, CC1Option]>, Group<f_Group>,
2053  HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">,
2054  MarshallingInfoString<CodeGenOpts<"ThinLinkBitcodeFile">>;
2055def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
2056                                Group<f_Group>, Flags<[NoXarchOption, CoreOption]>;
2057defm merge_all_constants : BoolFOption<"merge-all-constants",
2058  CodeGenOpts<"MergeAllConstants">, DefaultFalse,
2059  PosFlag<SetTrue, [CC1Option, CoreOption], "Allow">, NegFlag<SetFalse, [], "Disallow">,
2060  BothFlags<[], " merging of constants">>;
2061def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>, Flags<[CC1Option]>,
2062  HelpText<"Format message diagnostics so that they fit within N columns">,
2063  MarshallingInfoInt<DiagnosticOpts<"MessageLength">>;
2064def fms_compatibility : Flag<["-"], "fms-compatibility">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2065  HelpText<"Enable full Microsoft Visual C++ compatibility">,
2066  MarshallingInfoFlag<LangOpts<"MSVCCompat">>;
2067def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2068  HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">,
2069  MarshallingInfoFlag<LangOpts<"MicrosoftExt">>, ImpliedByAnyOf<[fms_compatibility.KeyPath]>;
2070defm asm_blocks : BoolFOption<"asm-blocks",
2071  LangOpts<"AsmBlocks">, Default<fms_extensions.KeyPath>,
2072  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
2073def fms_volatile : Flag<["-"], "fms-volatile">, Group<f_Group>, Flags<[CC1Option]>,
2074  MarshallingInfoFlag<CodeGenOpts<"MSVolatile">>;
2075def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>, Flags<[NoXarchOption, CoreOption]>,
2076  HelpText<"Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default))">;
2077def fms_compatibility_version
2078    : Joined<["-"], "fms-compatibility-version=">,
2079      Group<f_Group>,
2080      Flags<[ CC1Option, CoreOption ]>,
2081      HelpText<"Dot-separated value representing the Microsoft compiler "
2082               "version number to report in _MSC_VER (0 = don't define it "
2083               "(default))">;
2084defm delayed_template_parsing : BoolFOption<"delayed-template-parsing",
2085  LangOpts<"DelayedTemplateParsing">, DefaultFalse,
2086  PosFlag<SetTrue, [CC1Option], "Parse templated function definitions at the end of the translation unit">,
2087  NegFlag<SetFalse, [NoXarchOption], "Disable delayed template parsing">,
2088  BothFlags<[CoreOption]>>;
2089def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group<f_Group>, Flags<[CC1Option]>,
2090  Values<"single,multiple,virtual">, NormalizedValuesScope<"LangOptions">,
2091  NormalizedValues<["PPTMK_FullGeneralitySingleInheritance", "PPTMK_FullGeneralityMultipleInheritance",
2092                    "PPTMK_FullGeneralityVirtualInheritance"]>,
2093  MarshallingInfoEnum<LangOpts<"MSPointerToMemberRepresentationMethod">, "PPTMK_BestCase">;
2094// __declspec is enabled by default for the PS4 by the driver, and also
2095// enabled for Microsoft Extensions or Borland Extensions, here.
2096//
2097// FIXME: __declspec is also currently enabled for CUDA, but isn't really a
2098// CUDA extension. However, it is required for supporting
2099// __clang_cuda_builtin_vars.h, which uses __declspec(property). Once that has
2100// been rewritten in terms of something more generic, remove the Opts.CUDA
2101// term here.
2102defm declspec : BoolOption<"f", "declspec",
2103  LangOpts<"DeclSpecKeyword">, DefaultFalse,
2104  PosFlag<SetTrue, [], "Allow", [fms_extensions.KeyPath, fborland_extensions.KeyPath, cuda.KeyPath]>,
2105  NegFlag<SetFalse, [], "Disallow">,
2106  BothFlags<[CC1Option], " __declspec as a keyword">>, Group<f_clang_Group>;
2107def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group<i_Group>,
2108  Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
2109  HelpText<"Specify the module cache path">;
2110def fmodules_user_build_path : Separate<["-"], "fmodules-user-build-path">, Group<i_Group>,
2111  Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
2112  HelpText<"Specify the module user build path">,
2113  MarshallingInfoString<HeaderSearchOpts<"ModuleUserBuildPath">>;
2114def fprebuilt_module_path : Joined<["-"], "fprebuilt-module-path=">, Group<i_Group>,
2115  Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
2116  HelpText<"Specify the prebuilt module path">;
2117defm prebuilt_implicit_modules : BoolFOption<"prebuilt-implicit-modules",
2118  HeaderSearchOpts<"EnablePrebuiltImplicitModules">, DefaultFalse,
2119  PosFlag<SetTrue, [], "Look up implicit modules in the prebuilt module path">,
2120  NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option]>>;
2121
2122def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>,
2123  Flags<[CC1Option]>, MetaVarName<"<seconds>">,
2124  HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">,
2125  MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneInterval">, "7 * 24 * 60 * 60">;
2126def fmodules_prune_after : Joined<["-"], "fmodules-prune-after=">, Group<i_Group>,
2127  Flags<[CC1Option]>, MetaVarName<"<seconds>">,
2128  HelpText<"Specify the interval (in seconds) after which a module file will be considered unused">,
2129  MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneAfter">, "31 * 24 * 60 * 60">;
2130def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">,
2131  Group<i_Group>, Flags<[CC1Option]>, MetaVarName<"<time since Epoch in seconds>">,
2132  HelpText<"Time when the current build session started">,
2133  MarshallingInfoInt<HeaderSearchOpts<"BuildSessionTimestamp">, "0", "uint64_t">;
2134def fbuild_session_file : Joined<["-"], "fbuild-session-file=">,
2135  Group<i_Group>, MetaVarName<"<file>">,
2136  HelpText<"Use the last modification time of <file> as the build session timestamp">;
2137def fmodules_validate_once_per_build_session : Flag<["-"], "fmodules-validate-once-per-build-session">,
2138  Group<i_Group>, Flags<[CC1Option]>,
2139  HelpText<"Don't verify input files for the modules if the module has been "
2140           "successfully validated or loaded during this build session">,
2141  MarshallingInfoFlag<HeaderSearchOpts<"ModulesValidateOncePerBuildSession">>;
2142def fmodules_disable_diagnostic_validation : Flag<["-"], "fmodules-disable-diagnostic-validation">,
2143  Group<i_Group>, Flags<[CC1Option]>,
2144  HelpText<"Disable validation of the diagnostic options when loading the module">,
2145  MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesValidateDiagnosticOptions">>;
2146defm modules_validate_system_headers : BoolOption<"f", "modules-validate-system-headers",
2147  HeaderSearchOpts<"ModulesValidateSystemHeaders">, DefaultFalse,
2148  PosFlag<SetTrue, [CC1Option], "Validate the system headers that a module depends on when loading the module">,
2149  NegFlag<SetFalse, [NoXarchOption]>>, Group<i_Group>;
2150
2151def fvalidate_ast_input_files_content:
2152  Flag <["-"], "fvalidate-ast-input-files-content">,
2153  Group<f_Group>, Flags<[CC1Option]>,
2154  HelpText<"Compute and store the hash of input files used to build an AST."
2155           " Files with mismatching mtime's are considered valid"
2156           " if both contents is identical">,
2157  MarshallingInfoFlag<HeaderSearchOpts<"ValidateASTInputFilesContent">>;
2158def fmodules_validate_input_files_content:
2159  Flag <["-"], "fmodules-validate-input-files-content">,
2160  Group<f_Group>, Flags<[NoXarchOption]>,
2161  HelpText<"Validate PCM input files based on content if mtime differs">;
2162def fno_modules_validate_input_files_content:
2163  Flag <["-"], "fno_modules-validate-input-files-content">,
2164  Group<f_Group>, Flags<[NoXarchOption]>;
2165def fpch_validate_input_files_content:
2166  Flag <["-"], "fpch-validate-input-files-content">,
2167  Group<f_Group>, Flags<[NoXarchOption]>,
2168  HelpText<"Validate PCH input files based on content if mtime differs">;
2169def fno_pch_validate_input_files_content:
2170  Flag <["-"], "fno_pch-validate-input-files-content">,
2171  Group<f_Group>, Flags<[NoXarchOption]>;
2172defm pch_instantiate_templates : BoolFOption<"pch-instantiate-templates",
2173  LangOpts<"PCHInstantiateTemplates">, DefaultFalse,
2174  PosFlag<SetTrue, [], "Instantiate templates already while building a PCH">,
2175  NegFlag<SetFalse>, BothFlags<[CC1Option, CoreOption]>>;
2176defm pch_codegen: OptInCC1FFlag<"pch-codegen", "Generate ", "Do not generate ",
2177  "code for uses of this PCH that assumes an explicit object file will be built for the PCH">;
2178defm pch_debuginfo: OptInCC1FFlag<"pch-debuginfo", "Generate ", "Do not generate ",
2179  "debug info for types in an object file built from this PCH and do not generate them elsewhere">;
2180
2181def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
2182  Flags<[NoXarchOption, CC1Option, CoreOption]>,
2183  HelpText<"Implicitly search the file system for module map files.">,
2184  MarshallingInfoFlag<HeaderSearchOpts<"ImplicitModuleMaps">>;
2185def fmodules_ts : Flag <["-"], "fmodules-ts">, Group<f_Group>,
2186  Flags<[CC1Option]>, HelpText<"Enable support for the C++ Modules TS">,
2187  MarshallingInfoFlag<LangOpts<"ModulesTS">>;
2188defm modules : BoolFOption<"modules",
2189  LangOpts<"Modules">, Default<!strconcat(fmodules_ts.KeyPath, "||", fcxx_modules.KeyPath)>,
2190  PosFlag<SetTrue, [CC1Option], "Enable the 'modules' language feature">,
2191  NegFlag<SetFalse>, BothFlags<[NoXarchOption, CoreOption]>>;
2192def fmodule_maps : Flag <["-"], "fmodule-maps">, Flags<[CoreOption]>, Alias<fimplicit_module_maps>;
2193def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group<f_Group>,
2194  Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<name>">,
2195  HelpText<"Specify the name of the module to build">,
2196  MarshallingInfoString<LangOpts<"ModuleName">>;
2197def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">,
2198  Flags<[CC1Option,CoreOption]>, Alias<fmodule_name_EQ>;
2199def fsystem_module : Flag<["-"], "fsystem-module">, Flags<[CC1Option,CoreOption]>,
2200  HelpText<"Build this module as a system module. Only used with -emit-module">,
2201  MarshallingInfoFlag<FrontendOpts<"IsSystemModule">>;
2202def fmodule_map_file : Joined<["-"], "fmodule-map-file=">,
2203  Group<f_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<file>">,
2204  HelpText<"Load this module map file">,
2205  MarshallingInfoStringVector<FrontendOpts<"ModuleMapFiles">>;
2206def fmodule_file : Joined<["-"], "fmodule-file=">,
2207  Group<i_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"[<name>=]<file>">,
2208  HelpText<"Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.">;
2209def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>,
2210  Flags<[CC1Option,CoreOption]>,
2211  HelpText<"Ignore the definition of the given macro when building and loading modules">;
2212def fmodules_strict_decluse : Flag <["-"], "fmodules-strict-decluse">, Group<f_Group>,
2213  Flags<[NoXarchOption,CC1Option,CoreOption]>,
2214  HelpText<"Like -fmodules-decluse but requires all headers to be in modules">,
2215  MarshallingInfoFlag<LangOpts<"ModulesStrictDeclUse">>;
2216defm modules_decluse : BoolFOption<"modules-decluse",
2217  LangOpts<"ModulesDeclUse">, Default<fmodules_strict_decluse.KeyPath>,
2218  PosFlag<SetTrue, [CC1Option], "Require declaration of modules used within a module">,
2219  NegFlag<SetFalse>, BothFlags<[NoXarchOption,CoreOption]>>;
2220defm modules_search_all : BoolFOption<"modules-search-all",
2221  LangOpts<"ModulesSearchAll">, DefaultFalse,
2222  PosFlag<SetTrue, [], "Search even non-imported modules to resolve references">,
2223  NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option,CoreOption]>>,
2224  ShouldParseIf<fmodules.KeyPath>;
2225defm implicit_modules : BoolFOption<"implicit-modules",
2226  LangOpts<"ImplicitModules">, DefaultTrue,
2227  NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>, BothFlags<[NoXarchOption,CoreOption]>>;
2228def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group<f_Group>, Flags<[CC1Option]>,
2229  MarshallingInfoFlag<LangOpts<"RetainCommentsFromSystemHeaders">>;
2230
2231def fmudflapth : Flag<["-"], "fmudflapth">, Group<f_Group>;
2232def fmudflap : Flag<["-"], "fmudflap">, Group<f_Group>;
2233def fnested_functions : Flag<["-"], "fnested-functions">, Group<f_Group>;
2234def fnext_runtime : Flag<["-"], "fnext-runtime">, Group<f_Group>;
2235def fno_asm : Flag<["-"], "fno-asm">, Group<f_Group>;
2236def fno_asynchronous_unwind_tables : Flag<["-"], "fno-asynchronous-unwind-tables">, Group<f_Group>;
2237def fno_assume_sane_operator_new : Flag<["-"], "fno-assume-sane-operator-new">, Group<f_Group>,
2238  HelpText<"Don't assume that C++'s global operator new can't alias any pointer">,
2239  Flags<[CC1Option]>, MarshallingInfoNegativeFlag<CodeGenOpts<"AssumeSaneOperatorNew">>;
2240def fno_builtin : Flag<["-"], "fno-builtin">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2241  HelpText<"Disable implicit builtin knowledge of functions">;
2242def fno_builtin_ : Joined<["-"], "fno-builtin-">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2243  HelpText<"Disable implicit builtin knowledge of a specific function">;
2244def fno_diagnostics_color : Flag<["-"], "fno-diagnostics-color">, Group<f_Group>,
2245  Flags<[CoreOption, NoXarchOption]>;
2246def fno_common : Flag<["-"], "fno-common">, Group<f_Group>, Flags<[CC1Option]>,
2247    HelpText<"Compile common globals like normal definitions">;
2248defm digraphs : BoolFOption<"digraphs",
2249  LangOpts<"Digraphs">, Default<std#".hasDigraphs()">,
2250  PosFlag<SetTrue, [], "Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)">,
2251  NegFlag<SetFalse, [], "Disallow alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:'">,
2252  BothFlags<[CC1Option]>>;
2253def fno_eliminate_unused_debug_symbols : Flag<["-"], "fno-eliminate-unused-debug-symbols">, Group<f_Group>;
2254def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>;
2255def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>, Flags<[CC1Option]>;
2256def fno_global_isel : Flag<["-"], "fno-global-isel">, Group<f_clang_Group>,
2257  HelpText<"Disables the global instruction selector">;
2258def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_Group>,
2259  Alias<fno_global_isel>;
2260def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>, Flags<[CC1Option]>,
2261    HelpText<"Use the given vector functions library">,
2262    Values<"Accelerate,libmvec,MASSV,SVML,Darwin_libsystem_m,none">,
2263    NormalizedValuesScope<"CodeGenOptions">,
2264    NormalizedValues<["Accelerate", "LIBMVEC", "MASSV", "SVML",
2265                      "Darwin_libsystem_m", "NoLibrary"]>,
2266    MarshallingInfoEnum<CodeGenOpts<"VecLib">, "NoLibrary">;
2267def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group<f_Group>,
2268  Alias<flax_vector_conversions_EQ>, AliasArgs<["none"]>;
2269def fno_implicit_module_maps : Flag <["-"], "fno-implicit-module-maps">, Group<f_Group>,
2270  Flags<[NoXarchOption]>;
2271def fno_module_maps : Flag <["-"], "fno-module-maps">, Alias<fno_implicit_module_maps>;
2272def fno_modules_strict_decluse : Flag <["-"], "fno-strict-modules-decluse">, Group<f_Group>,
2273  Flags<[NoXarchOption]>;
2274def fmodule_file_deps : Flag <["-"], "fmodule-file-deps">, Group<f_Group>,
2275  Flags<[NoXarchOption]>;
2276def fno_module_file_deps : Flag <["-"], "fno-module-file-deps">, Group<f_Group>,
2277  Flags<[NoXarchOption]>;
2278def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group<f_Group>,
2279  Flags<[CoreOption]>;
2280def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group<f_Group>,
2281  Flags<[CoreOption]>;
2282def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group<f_Group>;
2283def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>, Flags<[CC1Option]>;
2284def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>;
2285defm operator_names : BoolFOption<"operator-names",
2286  LangOpts<"CXXOperatorNames">, Default<cplusplus.KeyPath>,
2287  NegFlag<SetFalse, [CC1Option], "Do not treat C++ operator name keywords as synonyms for operators">,
2288  PosFlag<SetTrue>>;
2289def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group<f_Group>,
2290  Flags<[CC1Option, CoreOption]>, HelpText<"Print absolute paths in diagnostics">,
2291  MarshallingInfoFlag<DiagnosticOpts<"AbsolutePath">>;
2292def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>,
2293  HelpText<"Disable the use of stack protectors">;
2294def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>,
2295  Flags<[NoXarchOption, CoreOption]>;
2296def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>;
2297def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group<f_Group>;
2298def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
2299def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>;
2300def fno_temp_file : Flag<["-"], "fno-temp-file">, Group<f_Group>,
2301  Flags<[CC1Option, CoreOption]>, HelpText<
2302  "Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes">,
2303  MarshallingInfoNegativeFlag<FrontendOpts<"UseTemporary">>;
2304defm use_cxa_atexit : BoolFOption<"use-cxa-atexit",
2305  CodeGenOpts<"CXAAtExit">, DefaultTrue,
2306  NegFlag<SetFalse, [CC1Option], "Don't use __cxa_atexit for calling destructors">,
2307  PosFlag<SetTrue>>;
2308def fno_unit_at_a_time : Flag<["-"], "fno-unit-at-a-time">, Group<f_Group>;
2309def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>;
2310def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>, Flags<[CC1Option]>,
2311  MarshallingInfoNegativeFlag<CodeGenOpts<"AsmVerbose">>;
2312def fno_working_directory : Flag<["-"], "fno-working-directory">, Group<f_Group>;
2313def fno_wrapv : Flag<["-"], "fno-wrapv">, Group<f_Group>;
2314def fobjc_arc : Flag<["-"], "fobjc-arc">, Group<f_Group>, Flags<[CC1Option]>,
2315  HelpText<"Synthesize retain and release calls for Objective-C pointers">;
2316def fno_objc_arc : Flag<["-"], "fno-objc-arc">, Group<f_Group>;
2317defm objc_encode_cxx_class_template_spec : BoolFOption<"objc-encode-cxx-class-template-spec",
2318  LangOpts<"EncodeCXXClassTemplateSpec">, DefaultFalse,
2319  PosFlag<SetTrue, [CC1Option], "Fully encode c++ class template specialization">,
2320  NegFlag<SetFalse>>;
2321defm objc_convert_messages_to_runtime_calls : BoolFOption<"objc-convert-messages-to-runtime-calls",
2322  CodeGenOpts<"ObjCConvertMessagesToRuntimeCalls">, DefaultTrue,
2323  NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>>;
2324defm objc_arc_exceptions : BoolFOption<"objc-arc-exceptions",
2325  CodeGenOpts<"ObjCAutoRefCountExceptions">, DefaultFalse,
2326  PosFlag<SetTrue, [CC1Option], "Use EH-safe code when synthesizing retains and releases in -fobjc-arc">,
2327  NegFlag<SetFalse>>;
2328def fobjc_atdefs : Flag<["-"], "fobjc-atdefs">, Group<clang_ignored_f_Group>;
2329def fobjc_call_cxx_cdtors : Flag<["-"], "fobjc-call-cxx-cdtors">, Group<clang_ignored_f_Group>;
2330defm objc_exceptions : BoolFOption<"objc-exceptions",
2331  LangOpts<"ObjCExceptions">, DefaultFalse,
2332  PosFlag<SetTrue, [CC1Option], "Enable Objective-C exceptions">, NegFlag<SetFalse>>;
2333defm application_extension : BoolFOption<"application-extension",
2334  LangOpts<"AppExt">, DefaultFalse,
2335  PosFlag<SetTrue, [CC1Option], "Restrict code to those available for App Extensions">,
2336  NegFlag<SetFalse>>;
2337defm relaxed_template_template_args : BoolFOption<"relaxed-template-template-args",
2338  LangOpts<"RelaxedTemplateTemplateArgs">, DefaultFalse,
2339  PosFlag<SetTrue, [CC1Option], "Enable C++17 relaxed template template argument matching">,
2340  NegFlag<SetFalse>>;
2341defm sized_deallocation : BoolFOption<"sized-deallocation",
2342  LangOpts<"SizedDeallocation">, DefaultFalse,
2343  PosFlag<SetTrue, [CC1Option], "Enable C++14 sized global deallocation functions">,
2344  NegFlag<SetFalse>>;
2345defm aligned_allocation : BoolFOption<"aligned-allocation",
2346  LangOpts<"AlignedAllocation">, Default<cpp17.KeyPath>,
2347  PosFlag<SetTrue, [], "Enable C++17 aligned allocation functions">,
2348  NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
2349def fnew_alignment_EQ : Joined<["-"], "fnew-alignment=">,
2350  HelpText<"Specifies the largest alignment guaranteed by '::operator new(size_t)'">,
2351  MetaVarName<"<align>">, Group<f_Group>, Flags<[CC1Option]>,
2352  MarshallingInfoInt<LangOpts<"NewAlignOverride">>;
2353def : Separate<["-"], "fnew-alignment">, Alias<fnew_alignment_EQ>;
2354def : Flag<["-"], "faligned-new">, Alias<faligned_allocation>;
2355def : Flag<["-"], "fno-aligned-new">, Alias<fno_aligned_allocation>;
2356def faligned_new_EQ : Joined<["-"], "faligned-new=">;
2357
2358def fobjc_legacy_dispatch : Flag<["-"], "fobjc-legacy-dispatch">, Group<f_Group>;
2359def fobjc_new_property : Flag<["-"], "fobjc-new-property">, Group<clang_ignored_f_Group>;
2360defm objc_infer_related_result_type : BoolFOption<"objc-infer-related-result-type",
2361  LangOpts<"ObjCInferRelatedResultType">, DefaultTrue,
2362  NegFlag<SetFalse, [CC1Option], "do not infer Objective-C related result type based on method family">,
2363  PosFlag<SetTrue>>;
2364def fobjc_link_runtime: Flag<["-"], "fobjc-link-runtime">, Group<f_Group>;
2365def fobjc_weak : Flag<["-"], "fobjc-weak">, Group<f_Group>, Flags<[CC1Option]>,
2366  HelpText<"Enable ARC-style weak references in Objective-C">;
2367
2368// Objective-C ABI options.
2369def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
2370  HelpText<"Specify the target Objective-C runtime kind and version">;
2371def fobjc_abi_version_EQ : Joined<["-"], "fobjc-abi-version=">, Group<f_Group>;
2372def fobjc_nonfragile_abi_version_EQ : Joined<["-"], "fobjc-nonfragile-abi-version=">, Group<f_Group>;
2373def fobjc_nonfragile_abi : Flag<["-"], "fobjc-nonfragile-abi">, Group<f_Group>;
2374def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Group>;
2375
2376def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>;
2377def fobjc_disable_direct_methods_for_testing :
2378  Flag<["-"], "fobjc-disable-direct-methods-for-testing">,
2379  Group<f_Group>, Flags<[CC1Option]>,
2380  HelpText<"Ignore attribute objc_direct so that direct methods can be tested">,
2381  MarshallingInfoFlag<LangOpts<"ObjCDisableDirectMethodsForTesting">>;
2382defm objc_avoid_heapify_local_blocks : BoolFOption<"objc-avoid-heapify-local-blocks",
2383  CodeGenOpts<"ObjCAvoidHeapifyLocalBlocks">, DefaultFalse,
2384  PosFlag<SetTrue, [], "Try">,
2385  NegFlag<SetFalse, [], "Don't try">,
2386  BothFlags<[CC1Option, NoDriverOption], " to avoid heapifying local blocks">>;
2387
2388def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>;
2389def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, FlangOption, FC1Option]>,
2390  HelpText<"Parse OpenMP pragmas and generate parallel code.">;
2391def fno_openmp : Flag<["-"], "fno-openmp">, Group<f_Group>, Flags<[NoArgumentUnused]>;
2392def fopenmp_version_EQ : Joined<["-"], "fopenmp-version=">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>;
2393defm openmp_extensions: BoolFOption<"openmp-extensions",
2394  LangOpts<"OpenMPExtensions">, DefaultTrue,
2395  PosFlag<SetTrue, [CC1Option, NoArgumentUnused],
2396          "Enable all Clang extensions for OpenMP directives and clauses">,
2397  NegFlag<SetFalse, [CC1Option, NoArgumentUnused],
2398          "Disable all Clang extensions for OpenMP directives and clauses">>;
2399def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group<f_Group>;
2400def fopenmp_use_tls : Flag<["-"], "fopenmp-use-tls">, Group<f_Group>,
2401  Flags<[NoArgumentUnused, HelpHidden]>;
2402def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group<f_Group>,
2403  Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2404def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">, Flags<[NoXarchOption, CC1Option]>,
2405  HelpText<"Specify comma-separated list of triples OpenMP offloading targets to be supported">;
2406def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">,
2407  Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2408def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">,
2409  Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2410def fopenmp_simd : Flag<["-"], "fopenmp-simd">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>,
2411  HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
2412def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
2413  HelpText<"Use the experimental OpenMP-IR-Builder codegen path.">;
2414def fno_openmp_simd : Flag<["-"], "fno-openmp-simd">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>;
2415def fopenmp_cuda_mode : Flag<["-"], "fopenmp-cuda-mode">, Group<f_Group>,
2416  Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2417def fno_openmp_cuda_mode : Flag<["-"], "fno-openmp-cuda-mode">, Group<f_Group>,
2418  Flags<[NoArgumentUnused, HelpHidden]>;
2419def fopenmp_cuda_force_full_runtime : Flag<["-"], "fopenmp-cuda-force-full-runtime">, Group<f_Group>,
2420  Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2421def fno_openmp_cuda_force_full_runtime : Flag<["-"], "fno-openmp-cuda-force-full-runtime">, Group<f_Group>,
2422  Flags<[NoArgumentUnused, HelpHidden]>;
2423def fopenmp_cuda_number_of_sm_EQ : Joined<["-"], "fopenmp-cuda-number-of-sm=">, Group<f_Group>,
2424  Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2425def fopenmp_cuda_blocks_per_sm_EQ : Joined<["-"], "fopenmp-cuda-blocks-per-sm=">, Group<f_Group>,
2426  Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2427def fopenmp_cuda_teams_reduction_recs_num_EQ : Joined<["-"], "fopenmp-cuda-teams-reduction-recs-num=">, Group<f_Group>,
2428  Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2429def fopenmp_target_debug : Flag<["-"], "fopenmp-target-debug">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>,
2430  HelpText<"Enable debugging in the OpenMP offloading device RTL">;
2431def fno_openmp_target_debug : Flag<["-"], "fno-openmp-target-debug">, Group<f_Group>, Flags<[NoArgumentUnused]>;
2432def fopenmp_target_debug_EQ : Joined<["-"], "fopenmp-target-debug=">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2433def fopenmp_assume_teams_oversubscription : Flag<["-"], "fopenmp-assume-teams-oversubscription">,
2434  Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2435def fopenmp_assume_threads_oversubscription : Flag<["-"], "fopenmp-assume-threads-oversubscription">,
2436  Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2437def fno_openmp_assume_teams_oversubscription : Flag<["-"], "fno-openmp-assume-teams-oversubscription">,
2438  Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2439def fno_openmp_assume_threads_oversubscription : Flag<["-"], "fno-openmp-assume-threads-oversubscription">,
2440  Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
2441defm openmp_target_new_runtime: BoolFOption<"openmp-target-new-runtime",
2442  LangOpts<"OpenMPTargetNewRuntime">, DefaultFalse,
2443  PosFlag<SetTrue, [CC1Option], "Use the new bitcode library for OpenMP offloading">,
2444  NegFlag<SetFalse>>;
2445defm openmp_optimistic_collapse : BoolFOption<"openmp-optimistic-collapse",
2446  LangOpts<"OpenMPOptimisticCollapse">, DefaultFalse,
2447  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>, BothFlags<[NoArgumentUnused, HelpHidden]>>;
2448def static_openmp: Flag<["-"], "static-openmp">,
2449  HelpText<"Use the static host OpenMP runtime while linking.">;
2450def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>;
2451def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group<f_Group>;
2452defm escaping_block_tail_calls : BoolFOption<"escaping-block-tail-calls",
2453  CodeGenOpts<"NoEscapingBlockTailCalls">, DefaultFalse,
2454  NegFlag<SetTrue, [CC1Option]>, PosFlag<SetFalse>>;
2455def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">;
2456def force__flat__namespace : Flag<["-"], "force_flat_namespace">;
2457def force__load : Separate<["-"], "force_load">;
2458def force_addr : Joined<["-"], "fforce-addr">, Group<clang_ignored_f_Group>;
2459def foutput_class_dir_EQ : Joined<["-"], "foutput-class-dir=">, Group<f_Group>;
2460def fpack_struct : Flag<["-"], "fpack-struct">, Group<f_Group>;
2461def fno_pack_struct : Flag<["-"], "fno-pack-struct">, Group<f_Group>;
2462def fpack_struct_EQ : Joined<["-"], "fpack-struct=">, Group<f_Group>, Flags<[CC1Option]>,
2463  HelpText<"Specify the default maximum struct packing alignment">,
2464  MarshallingInfoInt<LangOpts<"PackStruct">>;
2465def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group<f_Group>, Flags<[CC1Option]>,
2466  HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">,
2467  MarshallingInfoInt<LangOpts<"MaxTypeAlign">>;
2468def fno_max_type_align : Flag<["-"], "fno-max-type-align">, Group<f_Group>;
2469defm pascal_strings : BoolFOption<"pascal-strings",
2470  LangOpts<"PascalStrings">, DefaultFalse,
2471  PosFlag<SetTrue, [CC1Option], "Recognize and construct Pascal-style string literals">,
2472  NegFlag<SetFalse>>;
2473// Note: This flag has different semantics in the driver and in -cc1. The driver accepts -fpatchable-function-entry=M,N
2474// and forwards it to -cc1 as -fpatchable-function-entry=M and -fpatchable-function-entry-offset=N. In -cc1, both flags
2475// are treated as a single integer.
2476def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group<f_Group>, Flags<[CC1Option]>,
2477  MetaVarName<"<N,M>">, HelpText<"Generate M NOPs before function entry and N-M NOPs after function entry">,
2478  MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryCount">>;
2479def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
2480  HelpText<"Override the default ABI to return all structs on the stack">;
2481def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group<f_Group>;
2482def fpic : Flag<["-"], "fpic">, Group<f_Group>;
2483def fno_pic : Flag<["-"], "fno-pic">, Group<f_Group>;
2484def fpie : Flag<["-"], "fpie">, Group<f_Group>;
2485def fno_pie : Flag<["-"], "fno-pie">, Group<f_Group>;
2486def fdirect_access_external_data : Flag<["-"], "fdirect-access-external-data">, Group<f_Group>, Flags<[CC1Option]>,
2487  HelpText<"Don't use GOT indirection to reference external data symbols">;
2488def fno_direct_access_external_data : Flag<["-"], "fno-direct-access-external-data">, Group<f_Group>, Flags<[CC1Option]>,
2489  HelpText<"Use GOT indirection to reference external data symbols">;
2490defm plt : BoolFOption<"plt",
2491  CodeGenOpts<"NoPLT">, DefaultFalse,
2492  NegFlag<SetTrue, [CC1Option], "Use GOT indirection instead of PLT to make external function calls (x86 only)">,
2493  PosFlag<SetFalse>>;
2494defm ropi : BoolFOption<"ropi",
2495  LangOpts<"ROPI">, DefaultFalse,
2496  PosFlag<SetTrue, [CC1Option], "Generate read-only position independent code (ARM only)">,
2497  NegFlag<SetFalse>>;
2498defm rwpi : BoolFOption<"rwpi",
2499  LangOpts<"RWPI">, DefaultFalse,
2500  PosFlag<SetTrue, [CC1Option], "Generate read-write position independent code (ARM only)">,
2501  NegFlag<SetFalse>>;
2502def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>, Flags<[NoXarchOption]>, MetaVarName<"<dsopath>">,
2503  HelpText<"Load the named plugin (dynamic shared object)">;
2504def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">,
2505  Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<dsopath>">,
2506  HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">,
2507  MarshallingInfoStringVector<CodeGenOpts<"PassPlugins">>;
2508defm preserve_as_comments : BoolFOption<"preserve-as-comments",
2509  CodeGenOpts<"PreserveAsmComments">, DefaultTrue,
2510  NegFlag<SetFalse, [CC1Option], "Do not preserve comments in inline assembly">,
2511  PosFlag<SetTrue>>;
2512def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
2513def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<clang_ignored_f_Group>;
2514def freg_struct_return : Flag<["-"], "freg-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
2515  HelpText<"Override the default ABI to return small structs in registers">;
2516defm rtti : BoolFOption<"rtti",
2517  LangOpts<"RTTI">, Default<cplusplus.KeyPath>,
2518  NegFlag<SetFalse, [CC1Option], "Disable generation of rtti information">,
2519  PosFlag<SetTrue>>, ShouldParseIf<cplusplus.KeyPath>;
2520defm rtti_data : BoolFOption<"rtti-data",
2521  LangOpts<"RTTIData">, Default<frtti.KeyPath>,
2522  NegFlag<SetFalse, [CC1Option], "Disable generation of RTTI data">,
2523  PosFlag<SetTrue>>, ShouldParseIf<frtti.KeyPath>;
2524def : Flag<["-"], "fsched-interblock">, Group<clang_ignored_f_Group>;
2525defm short_enums : BoolFOption<"short-enums",
2526  LangOpts<"ShortEnums">, DefaultFalse,
2527  PosFlag<SetTrue, [CC1Option], "Allocate to an enum type only as many bytes as it"
2528           " needs for the declared range of possible values">,
2529  NegFlag<SetFalse>>;
2530defm char8__t : BoolFOption<"char8_t",
2531  LangOpts<"Char8">, Default<cpp20.KeyPath>,
2532  PosFlag<SetTrue, [], "Enable">, NegFlag<SetFalse, [], "Disable">,
2533  BothFlags<[CC1Option], " C++ builtin type char8_t">>;
2534def fshort_wchar : Flag<["-"], "fshort-wchar">, Group<f_Group>,
2535  HelpText<"Force wchar_t to be a short unsigned int">;
2536def fno_short_wchar : Flag<["-"], "fno-short-wchar">, Group<f_Group>,
2537  HelpText<"Force wchar_t to be an unsigned int">;
2538def fshow_overloads_EQ : Joined<["-"], "fshow-overloads=">, Group<f_Group>, Flags<[CC1Option]>,
2539  HelpText<"Which overload candidates to show when overload resolution fails: "
2540           "best|all; defaults to all">, Values<"best,all">,
2541  NormalizedValues<["Ovl_Best", "Ovl_All"]>,
2542  MarshallingInfoEnum<DiagnosticOpts<"ShowOverloads">, "Ovl_All">;
2543defm show_column : BoolFOption<"show-column",
2544  DiagnosticOpts<"ShowColumn">, DefaultTrue,
2545  NegFlag<SetFalse, [CC1Option], "Do not include column number on diagnostics">,
2546  PosFlag<SetTrue>>;
2547defm show_source_location : BoolFOption<"show-source-location",
2548  DiagnosticOpts<"ShowLocation">, DefaultTrue,
2549  NegFlag<SetFalse, [CC1Option], "Do not include source location information with diagnostics">,
2550  PosFlag<SetTrue>>;
2551defm spell_checking : BoolFOption<"spell-checking",
2552  LangOpts<"SpellChecking">, DefaultTrue,
2553  NegFlag<SetFalse, [CC1Option], "Disable spell-checking">, PosFlag<SetTrue>>;
2554def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<f_Group>;
2555def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group<f_Group>;
2556defm signed_char : BoolFOption<"signed-char",
2557  LangOpts<"CharIsSigned">, DefaultTrue,
2558  NegFlag<SetFalse, [CC1Option], "char is unsigned">, PosFlag<SetTrue, [], "char is signed">>,
2559  ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
2560defm split_stack : BoolFOption<"split-stack",
2561  CodeGenOpts<"EnableSegmentedStacks">, DefaultFalse,
2562  NegFlag<SetFalse, [], "Wouldn't use segmented stack">,
2563  PosFlag<SetTrue, [CC1Option], "Use segmented stack">>;
2564def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
2565  HelpText<"Enable stack protectors for all functions">;
2566defm stack_clash_protection : BoolFOption<"stack-clash-protection",
2567  CodeGenOpts<"StackClashProtector">, DefaultFalse,
2568  PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
2569  BothFlags<[], " stack clash protection">>;
2570def fstack_protector_strong : Flag<["-"], "fstack-protector-strong">, Group<f_Group>,
2571  HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. "
2572           "Compared to -fstack-protector, this uses a stronger heuristic "
2573           "that includes functions containing arrays of any size (and any type), "
2574           "as well as any calls to alloca or the taking of an address from a local variable">;
2575def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
2576  HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. "
2577           "This uses a loose heuristic which considers functions vulnerable if they "
2578           "contain a char (or 8bit integer) array or constant sized calls to alloca "
2579           ", which are of greater size than ssp-buffer-size (default: 8 bytes). All "
2580           "variable sized calls to alloca are considered vulnerable. A function with "
2581           "a stack protector has a guard value added to the stack frame that is "
2582           "checked on function exit. The guard value must be positioned in the "
2583           "stack frame such that a buffer overflow from a vulnerable variable will "
2584           "overwrite the guard value before overwriting the function's return "
2585           "address. The reference stack guard value is stored in a global variable.">;
2586def ftrivial_auto_var_init : Joined<["-"], "ftrivial-auto-var-init=">, Group<f_Group>,
2587  Flags<[CC1Option, CoreOption]>, HelpText<"Initialize trivial automatic stack variables: uninitialized (default)"
2588  " | pattern">, Values<"uninitialized,zero,pattern">,
2589  NormalizedValuesScope<"LangOptions::TrivialAutoVarInitKind">,
2590  NormalizedValues<["Uninitialized", "Zero", "Pattern"]>,
2591  MarshallingInfoEnum<LangOpts<"TrivialAutoVarInit">, "Uninitialized">;
2592def enable_trivial_var_init_zero : Flag<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
2593  Flags<[CC1Option, CoreOption, NoArgumentUnused]>,
2594  HelpText<"Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark">;
2595def ftrivial_auto_var_init_stop_after : Joined<["-"], "ftrivial-auto-var-init-stop-after=">, Group<f_Group>,
2596  Flags<[CC1Option, CoreOption]>, HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
2597  MarshallingInfoInt<LangOpts<"TrivialAutoVarInitStopAfter">>;
2598def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
2599  HelpText<"Emit full debug info for all types used by the program">;
2600def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
2601  HelpText<"Limit debug information produced to reduce size of debug binary">;
2602def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Flags<[CoreOption]>, Alias<fno_standalone_debug>;
2603def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Flags<[CoreOption]>, Alias<fstandalone_debug>;
2604def fdebug_macro : Flag<["-"], "fdebug-macro">, Group<f_Group>, Flags<[CoreOption]>,
2605  HelpText<"Emit macro debug information">;
2606def fno_debug_macro : Flag<["-"], "fno-debug-macro">, Group<f_Group>, Flags<[CoreOption]>,
2607  HelpText<"Do not emit macro debug information">;
2608def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group<f_Group>,
2609  Flags<[NoXarchOption, CoreOption]>;
2610def fstrict_enums : Flag<["-"], "fstrict-enums">, Group<f_Group>, Flags<[CC1Option]>,
2611  HelpText<"Enable optimizations based on the strict definition of an enum's "
2612           "value range">,
2613  MarshallingInfoFlag<CodeGenOpts<"StrictEnums">>;
2614defm strict_vtable_pointers : BoolFOption<"strict-vtable-pointers",
2615  CodeGenOpts<"StrictVTablePointers">, DefaultFalse,
2616  PosFlag<SetTrue, [CC1Option], "Enable optimizations based on the strict rules for"
2617            " overwriting polymorphic C++ objects">,
2618  NegFlag<SetFalse>>;
2619def fstrict_overflow : Flag<["-"], "fstrict-overflow">, Group<f_Group>;
2620def fsyntax_only : Flag<["-"], "fsyntax-only">,
2621  Flags<[NoXarchOption,CoreOption,CC1Option,FC1Option]>, Group<Action_Group>;
2622def ftabstop_EQ : Joined<["-"], "ftabstop=">, Group<f_Group>;
2623def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group<f_Group>;
2624def ftemplate_depth_ : Joined<["-"], "ftemplate-depth-">, Group<f_Group>;
2625def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">,
2626                                   Group<f_Group>;
2627def foperator_arrow_depth_EQ : Joined<["-"], "foperator-arrow-depth=">,
2628                               Group<f_Group>;
2629
2630def fsave_optimization_record : Flag<["-"], "fsave-optimization-record">,
2631  Group<f_Group>, HelpText<"Generate a YAML optimization record file">;
2632def fsave_optimization_record_EQ : Joined<["-"], "fsave-optimization-record=">,
2633  Group<f_Group>, HelpText<"Generate an optimization record file in a specific format">,
2634  MetaVarName<"<format>">;
2635def fno_save_optimization_record : Flag<["-"], "fno-save-optimization-record">,
2636  Group<f_Group>, Flags<[NoArgumentUnused]>;
2637def foptimization_record_file_EQ : Joined<["-"], "foptimization-record-file=">,
2638  Group<f_Group>,
2639  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.">,
2640  MetaVarName<"<file>">;
2641def foptimization_record_passes_EQ : Joined<["-"], "foptimization-record-passes=">,
2642  Group<f_Group>,
2643  HelpText<"Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)">,
2644  MetaVarName<"<regex>">;
2645
2646def fvectorize : Flag<["-"], "fvectorize">, Group<f_Group>,
2647  HelpText<"Enable the loop vectorization passes">;
2648def fno_vectorize : Flag<["-"], "fno-vectorize">, Group<f_Group>;
2649def : Flag<["-"], "ftree-vectorize">, Alias<fvectorize>;
2650def : Flag<["-"], "fno-tree-vectorize">, Alias<fno_vectorize>;
2651def fslp_vectorize : Flag<["-"], "fslp-vectorize">, Group<f_Group>,
2652  HelpText<"Enable the superword-level parallelism vectorization passes">;
2653def fno_slp_vectorize : Flag<["-"], "fno-slp-vectorize">, Group<f_Group>;
2654def : Flag<["-"], "ftree-slp-vectorize">, Alias<fslp_vectorize>;
2655def : Flag<["-"], "fno-tree-slp-vectorize">, Alias<fno_slp_vectorize>;
2656def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">,
2657  HelpText<"Warn if a function definition returns or accepts an object larger "
2658           "in bytes than a given value">, Flags<[HelpHidden]>;
2659def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">, Flags<[CC1Option]>,
2660  MarshallingInfoInt<LangOpts<"NumLargeByValueCopy">>;
2661
2662// These "special" warning flags are effectively processed as f_Group flags by the driver:
2663// Just silence warnings about -Wlarger-than for now.
2664def Wlarger_than_EQ : Joined<["-"], "Wlarger-than=">, Group<clang_ignored_f_Group>;
2665def Wlarger_than_ : Joined<["-"], "Wlarger-than-">, Alias<Wlarger_than_EQ>;
2666
2667// This is converted to -fwarn-stack-size=N and also passed through by the driver.
2668// FIXME: The driver should strip out the =<value> when passing W_value_Group through.
2669def Wframe_larger_than_EQ : Joined<["-"], "Wframe-larger-than=">, Group<W_value_Group>,
2670                            Flags<[NoXarchOption, CC1Option]>;
2671def Wframe_larger_than : Flag<["-"], "Wframe-larger-than">, Alias<Wframe_larger_than_EQ>;
2672
2673def : Flag<["-"], "fterminated-vtables">, Alias<fapple_kext>;
2674defm threadsafe_statics : BoolFOption<"threadsafe-statics",
2675  LangOpts<"ThreadsafeStatics">, DefaultTrue,
2676  NegFlag<SetFalse, [CC1Option], "Do not emit code to make initialization of local statics thread safe">,
2677  PosFlag<SetTrue>>;
2678def ftime_report : Flag<["-"], "ftime-report">, Group<f_Group>, Flags<[CC1Option]>,
2679  MarshallingInfoFlag<CodeGenOpts<"TimePasses">>;
2680def ftime_report_EQ: Joined<["-"], "ftime-report=">, Group<f_Group>,
2681  Flags<[CC1Option]>, Values<"per-pass,per-pass-run">,
2682  MarshallingInfoFlag<CodeGenOpts<"TimePassesPerRun">>,
2683  HelpText<"(For new pass manager) \"per-pass\": one report for each pass; "
2684           "\"per-pass-run\": one report for each pass invocation">;
2685def ftime_trace : Flag<["-"], "ftime-trace">, Group<f_Group>,
2686  HelpText<"Turn on time profiler. Generates JSON file based on output filename.">,
2687  DocBrief<[{
2688Turn on time profiler. Generates JSON file based on output filename. Results
2689can be analyzed with chrome://tracing or `Speedscope App
2690<https://www.speedscope.app>`_ for flamegraph visualization.}]>,
2691  Flags<[CC1Option, CoreOption]>,
2692  MarshallingInfoFlag<FrontendOpts<"TimeTrace">>;
2693def ftime_trace_granularity_EQ : Joined<["-"], "ftime-trace-granularity=">, Group<f_Group>,
2694  HelpText<"Minimum time granularity (in microseconds) traced by time profiler">,
2695  Flags<[CC1Option, CoreOption]>,
2696  MarshallingInfoInt<FrontendOpts<"TimeTraceGranularity">, "500u">;
2697def fproc_stat_report : Joined<["-"], "fproc-stat-report">, Group<f_Group>,
2698  HelpText<"Print subprocess statistics">;
2699def fproc_stat_report_EQ : Joined<["-"], "fproc-stat-report=">, Group<f_Group>,
2700  HelpText<"Save subprocess statistics to the given file">;
2701def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group<f_Group>, Flags<[CC1Option]>,
2702  Values<"global-dynamic,local-dynamic,initial-exec,local-exec">,
2703  NormalizedValuesScope<"CodeGenOptions">,
2704  NormalizedValues<["GeneralDynamicTLSModel", "LocalDynamicTLSModel", "InitialExecTLSModel", "LocalExecTLSModel"]>,
2705  MarshallingInfoEnum<CodeGenOpts<"DefaultTLSModel">, "GeneralDynamicTLSModel">;
2706def ftrapv : Flag<["-"], "ftrapv">, Group<f_Group>, Flags<[CC1Option]>,
2707  HelpText<"Trap on integer overflow">;
2708def ftrapv_handler_EQ : Joined<["-"], "ftrapv-handler=">, Group<f_Group>,
2709  MetaVarName<"<function name>">,
2710  HelpText<"Specify the function to be called on overflow">;
2711def ftrapv_handler : Separate<["-"], "ftrapv-handler">, Group<f_Group>, Flags<[CC1Option]>;
2712def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>, Flags<[CC1Option]>,
2713  HelpText<"Issue call to specified function rather than a trap instruction">,
2714  MarshallingInfoString<CodeGenOpts<"TrapFuncName">>;
2715def funit_at_a_time : Flag<["-"], "funit-at-a-time">, Group<f_Group>;
2716def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
2717  HelpText<"Turn on loop unroller">, Flags<[CC1Option]>;
2718def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<f_Group>,
2719  HelpText<"Turn off loop unroller">, Flags<[CC1Option]>;
2720defm reroll_loops : BoolFOption<"reroll-loops",
2721  CodeGenOpts<"RerollLoops">, DefaultFalse,
2722  PosFlag<SetTrue, [CC1Option], "Turn on loop reroller">, NegFlag<SetFalse>>;
2723def ffinite_loops: Flag<["-"],  "ffinite-loops">, Group<f_Group>,
2724  HelpText<"Assume all loops are finite.">, Flags<[CC1Option]>;
2725def fno_finite_loops: Flag<["-"], "fno-finite-loops">, Group<f_Group>,
2726  HelpText<"Do not assume that any loop is finite.">, Flags<[CC1Option]>;
2727
2728def ftrigraphs : Flag<["-"], "ftrigraphs">, Group<f_Group>,
2729  HelpText<"Process trigraph sequences">, Flags<[CC1Option]>;
2730def fno_trigraphs : Flag<["-"], "fno-trigraphs">, Group<f_Group>,
2731  HelpText<"Do not process trigraph sequences">, Flags<[CC1Option]>;
2732def funsigned_bitfields : Flag<["-"], "funsigned-bitfields">, Group<f_Group>;
2733def funsigned_char : Flag<["-"], "funsigned-char">, Group<f_Group>;
2734def fno_unsigned_char : Flag<["-"], "fno-unsigned-char">;
2735def funwind_tables : Flag<["-"], "funwind-tables">, Group<f_Group>;
2736defm register_global_dtors_with_atexit : BoolFOption<"register-global-dtors-with-atexit",
2737  CodeGenOpts<"RegisterGlobalDtorsWithAtExit">, DefaultFalse,
2738  PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
2739  BothFlags<[], " atexit or __cxa_atexit to register global destructors">>;
2740defm use_init_array : BoolFOption<"use-init-array",
2741  CodeGenOpts<"UseInitArray">, DefaultTrue,
2742  NegFlag<SetFalse, [CC1Option], "Use .ctors/.dtors instead of .init_array/.fini_array">,
2743  PosFlag<SetTrue>>;
2744def fno_var_tracking : Flag<["-"], "fno-var-tracking">, Group<clang_ignored_f_Group>;
2745def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>,
2746  HelpText<"Generate verbose assembly output">;
2747def dA : Flag<["-"], "dA">, Alias<fverbose_asm>;
2748defm visibility_from_dllstorageclass : BoolFOption<"visibility-from-dllstorageclass",
2749  LangOpts<"VisibilityFromDLLStorageClass">, DefaultFalse,
2750  PosFlag<SetTrue, [CC1Option], "Set the visibility of symbols in the generated code from their DLL storage class">,
2751  NegFlag<SetFalse>>;
2752def fvisibility_dllexport_EQ : Joined<["-"], "fvisibility-dllexport=">, Group<f_Group>, Flags<[CC1Option]>,
2753  HelpText<"The visibility for dllexport definitions [-fvisibility-from-dllstorageclass]">,
2754  MarshallingInfoVisibility<LangOpts<"DLLExportVisibility">, "DefaultVisibility">,
2755  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
2756def fvisibility_nodllstorageclass_EQ : Joined<["-"], "fvisibility-nodllstorageclass=">, Group<f_Group>, Flags<[CC1Option]>,
2757  HelpText<"The visibility for defintiions without an explicit DLL export class [-fvisibility-from-dllstorageclass]">,
2758  MarshallingInfoVisibility<LangOpts<"NoDLLStorageClassVisibility">, "HiddenVisibility">,
2759  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
2760def fvisibility_externs_dllimport_EQ : Joined<["-"], "fvisibility-externs-dllimport=">, Group<f_Group>, Flags<[CC1Option]>,
2761  HelpText<"The visibility for dllimport external declarations [-fvisibility-from-dllstorageclass]">,
2762  MarshallingInfoVisibility<LangOpts<"ExternDeclDLLImportVisibility">, "DefaultVisibility">,
2763  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
2764def fvisibility_externs_nodllstorageclass_EQ : Joined<["-"], "fvisibility-externs-nodllstorageclass=">, Group<f_Group>, Flags<[CC1Option]>,
2765  HelpText<"The visibility for external declarations without an explicit DLL dllstorageclass [-fvisibility-from-dllstorageclass]">,
2766  MarshallingInfoVisibility<LangOpts<"ExternDeclNoDLLStorageClassVisibility">, "HiddenVisibility">,
2767  ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
2768def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>,
2769  HelpText<"Set the default symbol visibility for all global declarations">, Values<"hidden,default">;
2770defm visibility_inlines_hidden : BoolFOption<"visibility-inlines-hidden",
2771  LangOpts<"InlineVisibilityHidden">, DefaultFalse,
2772  PosFlag<SetTrue, [CC1Option], "Give inline C++ member functions hidden visibility by default">,
2773  NegFlag<SetFalse>>;
2774defm visibility_inlines_hidden_static_local_var : BoolFOption<"visibility-inlines-hidden-static-local-var",
2775  LangOpts<"VisibilityInlinesHiddenStaticLocalVar">, DefaultFalse,
2776  PosFlag<SetTrue, [CC1Option], "When -fvisibility-inlines-hidden is enabled, static variables in"
2777            " inline C++ member functions will also be given hidden visibility by default">,
2778  NegFlag<SetFalse, [], "Disables -fvisibility-inlines-hidden-static-local-var"
2779         " (this is the default on non-darwin targets)">, BothFlags<[CC1Option]>>;
2780def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group<f_Group>,
2781  HelpText<"Give global types 'default' visibility and global functions and "
2782           "variables 'hidden' visibility by default">;
2783def fvisibility_global_new_delete_hidden : Flag<["-"], "fvisibility-global-new-delete-hidden">, Group<f_Group>,
2784  HelpText<"Give global C++ operator new and delete declarations hidden visibility">, Flags<[CC1Option]>,
2785  MarshallingInfoFlag<LangOpts<"GlobalAllocationFunctionVisibilityHidden">>;
2786def fnew_infallible : Flag<["-"], "fnew-infallible">, Group<f_Group>,
2787  HelpText<"Treats throwing global C++ operator new as always returning valid memory "
2788  "(annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.">,
2789  Flags<[CC1Option]>, MarshallingInfoFlag<LangOpts<"NewInfallible">>;
2790defm whole_program_vtables : BoolFOption<"whole-program-vtables",
2791  CodeGenOpts<"WholeProgramVTables">, DefaultFalse,
2792  PosFlag<SetTrue, [CC1Option], "Enables whole-program vtable optimization. Requires -flto">,
2793  NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
2794defm split_lto_unit : BoolFOption<"split-lto-unit",
2795  CodeGenOpts<"EnableSplitLTOUnit">, DefaultFalse,
2796  PosFlag<SetTrue, [CC1Option], "Enables splitting of the LTO unit">,
2797  NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
2798defm force_emit_vtables : BoolFOption<"force-emit-vtables",
2799  CodeGenOpts<"ForceEmitVTables">, DefaultFalse,
2800  PosFlag<SetTrue, [CC1Option], "Emits more virtual tables to improve devirtualization">,
2801  NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
2802defm virtual_function_elimination : BoolFOption<"virtual-function-elimination",
2803  CodeGenOpts<"VirtualFunctionElimination">, DefaultFalse,
2804  PosFlag<SetTrue, [CC1Option], "Enables dead virtual function elimination optimization. Requires -flto=full">,
2805  NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
2806
2807def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>, Flags<[CC1Option]>,
2808  HelpText<"Treat signed integer overflow as two's complement">;
2809def fwritable_strings : Flag<["-"], "fwritable-strings">, Group<f_Group>, Flags<[CC1Option]>,
2810  HelpText<"Store string literals as writable data">,
2811  MarshallingInfoFlag<LangOpts<"WritableStrings">>;
2812defm zero_initialized_in_bss : BoolFOption<"zero-initialized-in-bss",
2813  CodeGenOpts<"NoZeroInitializedInBSS">, DefaultFalse,
2814  NegFlag<SetTrue, [CC1Option], "Don't place zero initialized data in BSS">,
2815  PosFlag<SetFalse>>;
2816defm function_sections : BoolFOption<"function-sections",
2817  CodeGenOpts<"FunctionSections">, DefaultFalse,
2818  PosFlag<SetTrue, [CC1Option], "Place each function in its own section">,
2819  NegFlag<SetFalse>>;
2820def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
2821  Flags<[CC1Option, CC1AsOption]>,
2822  HelpText<"Place each function's basic blocks in unique sections (ELF Only) : all | labels | none | list=<file>">,
2823  DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>,
2824  Values<"all,labels,none,list=">,
2825  MarshallingInfoString<CodeGenOpts<"BBSections">, [{"none"}]>;
2826defm data_sections : BoolFOption<"data-sections",
2827  CodeGenOpts<"DataSections">, DefaultFalse,
2828  PosFlag<SetTrue, [CC1Option], "Place each data in its own section">, NegFlag<SetFalse>>;
2829defm stack_size_section : BoolFOption<"stack-size-section",
2830  CodeGenOpts<"StackSizeSection">, DefaultFalse,
2831  PosFlag<SetTrue, [CC1Option], "Emit section containing metadata on function stack sizes">,
2832  NegFlag<SetFalse>>;
2833def fstack_usage : Flag<["-"], "fstack-usage">, Group<f_Group>,
2834  HelpText<"Emit .su file containing information on function stack sizes">;
2835def stack_usage_file : Separate<["-"], "stack-usage-file">,
2836  Flags<[CC1Option, NoDriverOption]>,
2837  HelpText<"Filename (or -) to write stack usage output to">,
2838  MarshallingInfoString<CodeGenOpts<"StackUsageOutput">>;
2839
2840defm unique_basic_block_section_names : BoolFOption<"unique-basic-block-section-names",
2841  CodeGenOpts<"UniqueBasicBlockSectionNames">, DefaultFalse,
2842  PosFlag<SetTrue, [CC1Option], "Use unique names for basic block sections (ELF Only)">,
2843  NegFlag<SetFalse>>;
2844defm unique_internal_linkage_names : BoolFOption<"unique-internal-linkage-names",
2845  CodeGenOpts<"UniqueInternalLinkageNames">, DefaultFalse,
2846  PosFlag<SetTrue, [CC1Option], "Uniqueify Internal Linkage Symbol Names by appending"
2847            " the MD5 hash of the module path">,
2848  NegFlag<SetFalse>>;
2849defm unique_section_names : BoolFOption<"unique-section-names",
2850  CodeGenOpts<"UniqueSectionNames">, DefaultTrue,
2851  NegFlag<SetFalse, [CC1Option], "Don't use unique names for text and data sections">,
2852  PosFlag<SetTrue>>;
2853
2854defm split_machine_functions: BoolFOption<"split-machine-functions",
2855  CodeGenOpts<"SplitMachineFunctions">, DefaultFalse,
2856  PosFlag<SetTrue, [CC1Option], "Enable">, NegFlag<SetFalse, [], "Disable">,
2857  BothFlags<[], " late function splitting using profile information (x86 ELF)">>;
2858
2859defm strict_return : BoolFOption<"strict-return",
2860  CodeGenOpts<"StrictReturn">, DefaultTrue,
2861  NegFlag<SetFalse, [CC1Option], "Don't treat control flow paths that fall off the end"
2862            " of a non-void function as unreachable">,
2863  PosFlag<SetTrue>>;
2864
2865def fenable_matrix : Flag<["-"], "fenable-matrix">, Group<f_Group>,
2866    Flags<[CC1Option]>,
2867    HelpText<"Enable matrix data type and related builtin functions">,
2868    MarshallingInfoFlag<LangOpts<"MatrixTypes">>;
2869
2870
2871def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
2872  HelpText<"Place debug types in their own section (ELF Only)">;
2873def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group<f_Group>;
2874defm debug_ranges_base_address : BoolFOption<"debug-ranges-base-address",
2875  CodeGenOpts<"DebugRangesBaseAddress">, DefaultFalse,
2876  PosFlag<SetTrue, [CC1Option], "Use DWARF base address selection entries in .debug_ranges">,
2877  NegFlag<SetFalse>>;
2878defm split_dwarf_inlining : BoolFOption<"split-dwarf-inlining",
2879  CodeGenOpts<"SplitDwarfInlining">, DefaultFalse,
2880  NegFlag<SetFalse, []>,
2881  PosFlag<SetTrue, [CC1Option], "Provide minimal debug info in the object/executable"
2882          " to facilitate online symbolication/stack traces in the absence of"
2883          " .dwo/.dwp files when using Split DWARF">>;
2884def fdebug_default_version: Joined<["-"], "fdebug-default-version=">, Group<f_Group>,
2885  HelpText<"Default DWARF version to use, if a -g option caused DWARF debug info to be produced">;
2886def fdebug_prefix_map_EQ
2887  : Joined<["-"], "fdebug-prefix-map=">, Group<f_Group>,
2888    Flags<[CC1Option,CC1AsOption]>,
2889    HelpText<"remap file source paths in debug info">;
2890def fcoverage_prefix_map_EQ
2891  : Joined<["-"], "fcoverage-prefix-map=">, Group<f_Group>,
2892    Flags<[CC1Option]>,
2893    HelpText<"remap file source paths in coverage mapping">;
2894def ffile_prefix_map_EQ
2895  : Joined<["-"], "ffile-prefix-map=">, Group<f_Group>,
2896    HelpText<"remap file source paths in debug info, predefined preprocessor macros and __builtin_FILE()">;
2897def fmacro_prefix_map_EQ
2898  : Joined<["-"], "fmacro-prefix-map=">, Group<f_Group>, Flags<[CC1Option]>,
2899    HelpText<"remap file source paths in predefined preprocessor macros and __builtin_FILE()">;
2900defm force_dwarf_frame : BoolFOption<"force-dwarf-frame",
2901  CodeGenOpts<"ForceDwarfFrameSection">, DefaultFalse,
2902  PosFlag<SetTrue, [CC1Option], "Always emit a debug frame section">, NegFlag<SetFalse>>;
2903def g_Flag : Flag<["-"], "g">, Group<g_Group>,
2904  HelpText<"Generate source-level debug information">;
2905def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<gN_Group>,
2906  Flags<[CoreOption]>, HelpText<"Emit debug line number tables only">;
2907def gline_directives_only : Flag<["-"], "gline-directives-only">, Group<gN_Group>,
2908  Flags<[CoreOption]>, HelpText<"Emit debug line info directives only">;
2909def gmlt : Flag<["-"], "gmlt">, Alias<gline_tables_only>;
2910def g0 : Flag<["-"], "g0">, Group<gN_Group>;
2911def g1 : Flag<["-"], "g1">, Group<gN_Group>, Alias<gline_tables_only>;
2912def g2 : Flag<["-"], "g2">, Group<gN_Group>;
2913def g3 : Flag<["-"], "g3">, Group<gN_Group>;
2914def ggdb : Flag<["-"], "ggdb">, Group<gTune_Group>;
2915def ggdb0 : Flag<["-"], "ggdb0">, Group<ggdbN_Group>;
2916def ggdb1 : Flag<["-"], "ggdb1">, Group<ggdbN_Group>;
2917def ggdb2 : Flag<["-"], "ggdb2">, Group<ggdbN_Group>;
2918def ggdb3 : Flag<["-"], "ggdb3">, Group<ggdbN_Group>;
2919def glldb : Flag<["-"], "glldb">, Group<gTune_Group>;
2920def gsce : Flag<["-"], "gsce">, Group<gTune_Group>;
2921def gdbx : Flag<["-"], "gdbx">, Group<gTune_Group>;
2922// Equivalent to our default dwarf version. Forces usual dwarf emission when
2923// CodeView is enabled.
2924def gdwarf : Flag<["-"], "gdwarf">, Group<g_Group>, Flags<[CoreOption]>,
2925  HelpText<"Generate source-level debug information with the default dwarf version">;
2926def gdwarf_2 : Flag<["-"], "gdwarf-2">, Group<g_Group>,
2927  HelpText<"Generate source-level debug information with dwarf version 2">;
2928def gdwarf_3 : Flag<["-"], "gdwarf-3">, Group<g_Group>,
2929  HelpText<"Generate source-level debug information with dwarf version 3">;
2930def gdwarf_4 : Flag<["-"], "gdwarf-4">, Group<g_Group>,
2931  HelpText<"Generate source-level debug information with dwarf version 4">;
2932def gdwarf_5 : Flag<["-"], "gdwarf-5">, Group<g_Group>,
2933  HelpText<"Generate source-level debug information with dwarf version 5">;
2934def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>,
2935  Flags<[CC1Option, CC1AsOption]>,
2936  HelpText<"Enables DWARF64 format for ELF binaries, if debug information emission is enabled.">,
2937  MarshallingInfoFlag<CodeGenOpts<"Dwarf64">>;
2938def gdwarf32 : Flag<["-"], "gdwarf32">, Group<g_Group>,
2939  Flags<[CC1Option, CC1AsOption]>,
2940  HelpText<"Enables DWARF32 format for ELF binaries, if debug information emission is enabled.">;
2941
2942def gcodeview : Flag<["-"], "gcodeview">,
2943  HelpText<"Generate CodeView debug information">,
2944  Flags<[CC1Option, CC1AsOption, CoreOption]>,
2945  MarshallingInfoFlag<CodeGenOpts<"EmitCodeView">>;
2946defm codeview_ghash : BoolOption<"g", "codeview-ghash",
2947  CodeGenOpts<"CodeViewGHash">, DefaultFalse,
2948  PosFlag<SetTrue, [CC1Option], "Emit type record hashes in a .debug$H section">,
2949  NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
2950defm inline_line_tables : BoolGOption<"inline-line-tables",
2951  CodeGenOpts<"NoInlineLineTables">, DefaultFalse,
2952  NegFlag<SetTrue, [CC1Option], "Don't emit inline line tables.">,
2953  PosFlag<SetFalse>, BothFlags<[CoreOption]>>;
2954
2955def gfull : Flag<["-"], "gfull">, Group<g_Group>;
2956def gused : Flag<["-"], "gused">, Group<g_Group>;
2957def gstabs : Joined<["-"], "gstabs">, Group<g_Group>, Flags<[Unsupported]>;
2958def gcoff : Joined<["-"], "gcoff">, Group<g_Group>, Flags<[Unsupported]>;
2959def gxcoff : Joined<["-"], "gxcoff">, Group<g_Group>, Flags<[Unsupported]>;
2960def gvms : Joined<["-"], "gvms">, Group<g_Group>, Flags<[Unsupported]>;
2961def gtoggle : Flag<["-"], "gtoggle">, Group<g_flags_Group>, Flags<[Unsupported]>;
2962def grecord_command_line : Flag<["-"], "grecord-command-line">,
2963  Group<g_flags_Group>;
2964def gno_record_command_line : Flag<["-"], "gno-record-command-line">,
2965  Group<g_flags_Group>;
2966def : Flag<["-"], "grecord-gcc-switches">, Alias<grecord_command_line>;
2967def : Flag<["-"], "gno-record-gcc-switches">, Alias<gno_record_command_line>;
2968defm strict_dwarf : BoolOption<"g", "strict-dwarf",
2969  CodeGenOpts<"DebugStrictDwarf">, DefaultFalse,
2970  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
2971  Group<g_flags_Group>;
2972defm column_info : BoolOption<"g", "column-info",
2973  CodeGenOpts<"DebugColumnInfo">, DefaultTrue,
2974  NegFlag<SetFalse, [CC1Option]>, PosFlag<SetTrue>, BothFlags<[CoreOption]>>,
2975  Group<g_flags_Group>;
2976def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>;
2977def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group<g_flags_Group>,
2978  HelpText<"Set DWARF fission mode to either 'split' or 'single'">,
2979  Values<"split,single">;
2980def gno_split_dwarf : Flag<["-"], "gno-split-dwarf">, Group<g_flags_Group>;
2981def gsimple_template_names : Flag<["-"], "gsimple-template-names">, Group<g_flags_Group>;
2982def gsimple_template_names_EQ
2983    : Joined<["-"], "gsimple-template-names=">,
2984      HelpText<"Use simple template names in DWARF, or include the full "
2985               "template name with a modified prefix for validation">,
2986      Values<"simple,mangled">, Flags<[CC1Option, NoDriverOption]>;
2987def gno_simple_template_names : Flag<["-"], "gno-simple-template-names">,
2988                                Group<g_flags_Group>;
2989def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
2990def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>;
2991def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
2992def gno_pubnames : Flag<["-"], "gno-pubnames">, Group<g_flags_Group>;
2993def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group<g_flags_Group>;
2994def gmodules : Flag <["-"], "gmodules">, Group<gN_Group>,
2995  HelpText<"Generate debug info with external references to clang modules"
2996           " or precompiled headers">;
2997def gz_EQ : Joined<["-"], "gz=">, Group<g_flags_Group>,
2998    HelpText<"DWARF debug sections compression type">;
2999def gz : Flag<["-"], "gz">, Alias<gz_EQ>, AliasArgs<["zlib"]>, Group<g_flags_Group>;
3000def gembed_source : Flag<["-"], "gembed-source">, Group<g_flags_Group>, Flags<[CC1Option]>,
3001    HelpText<"Embed source text in DWARF debug sections">,
3002    MarshallingInfoFlag<CodeGenOpts<"EmbedSource">>;
3003def gno_embed_source : Flag<["-"], "gno-embed-source">, Group<g_flags_Group>,
3004    Flags<[NoXarchOption]>,
3005    HelpText<"Restore the default behavior of not embedding source text in DWARF debug sections">;
3006def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">;
3007def help : Flag<["-", "--"], "help">, Flags<[CC1Option,CC1AsOption, FC1Option,
3008    FlangOption]>, HelpText<"Display available options">,
3009    MarshallingInfoFlag<FrontendOpts<"ShowHelp">>;
3010def ibuiltininc : Flag<["-"], "ibuiltininc">,
3011  HelpText<"Enable builtin #include directories even when -nostdinc is used "
3012           "before or after -ibuiltininc. "
3013           "Using -nobuiltininc after the option disables it">;
3014def index_header_map : Flag<["-"], "index-header-map">, Flags<[CC1Option]>,
3015  HelpText<"Make the next included directory (-I or -F) an indexer header map">;
3016def idirafter : JoinedOrSeparate<["-"], "idirafter">, Group<clang_i_Group>, Flags<[CC1Option]>,
3017  HelpText<"Add directory to AFTER include search path">;
3018def iframework : JoinedOrSeparate<["-"], "iframework">, Group<clang_i_Group>, Flags<[CC1Option]>,
3019  HelpText<"Add directory to SYSTEM framework search path">;
3020def iframeworkwithsysroot : JoinedOrSeparate<["-"], "iframeworkwithsysroot">,
3021  Group<clang_i_Group>,
3022  HelpText<"Add directory to SYSTEM framework search path, "
3023           "absolute paths are relative to -isysroot">,
3024  MetaVarName<"<directory>">, Flags<[CC1Option]>;
3025def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>, Flags<[CC1Option]>,
3026  HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">,
3027  MarshallingInfoStringVector<PreprocessorOpts<"MacroIncludes">>;
3028def image__base : Separate<["-"], "image_base">;
3029def include_ : JoinedOrSeparate<["-", "--"], "include">, Group<clang_i_Group>, EnumName<"include">,
3030    MetaVarName<"<file>">, HelpText<"Include file before parsing">, Flags<[CC1Option]>;
3031def include_pch : Separate<["-"], "include-pch">, Group<clang_i_Group>, Flags<[CC1Option]>,
3032  HelpText<"Include precompiled header file">, MetaVarName<"<file>">,
3033  MarshallingInfoString<PreprocessorOpts<"ImplicitPCHInclude">>;
3034def relocatable_pch : Flag<["-", "--"], "relocatable-pch">, Flags<[CC1Option]>,
3035  HelpText<"Whether to build a relocatable precompiled header">,
3036  MarshallingInfoFlag<FrontendOpts<"RelocatablePCH">>;
3037def verify_pch : Flag<["-"], "verify-pch">, Group<Action_Group>, Flags<[CC1Option]>,
3038  HelpText<"Load and verify that a pre-compiled header file is not stale">;
3039def init : Separate<["-"], "init">;
3040def install__name : Separate<["-"], "install_name">;
3041def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>, Flags<[CC1Option]>,
3042  HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"<dir>">;
3043def iquote : JoinedOrSeparate<["-"], "iquote">, Group<clang_i_Group>, Flags<[CC1Option]>,
3044  HelpText<"Add directory to QUOTE include search path">, MetaVarName<"<directory>">;
3045def isysroot : JoinedOrSeparate<["-"], "isysroot">, Group<clang_i_Group>, Flags<[CC1Option]>,
3046  HelpText<"Set the system root directory (usually /)">, MetaVarName<"<dir>">,
3047  MarshallingInfoString<HeaderSearchOpts<"Sysroot">, [{"/"}]>;
3048def isystem : JoinedOrSeparate<["-"], "isystem">, Group<clang_i_Group>,
3049  Flags<[CC1Option]>,
3050  HelpText<"Add directory to SYSTEM include search path">, MetaVarName<"<directory>">;
3051def isystem_after : JoinedOrSeparate<["-"], "isystem-after">,
3052  Group<clang_i_Group>, Flags<[NoXarchOption]>, MetaVarName<"<directory>">,
3053  HelpText<"Add directory to end of the SYSTEM include search path">;
3054def iwithprefixbefore : JoinedOrSeparate<["-"], "iwithprefixbefore">, Group<clang_i_Group>,
3055  HelpText<"Set directory to include search path with prefix">, MetaVarName<"<dir>">,
3056  Flags<[CC1Option]>;
3057def iwithprefix : JoinedOrSeparate<["-"], "iwithprefix">, Group<clang_i_Group>, Flags<[CC1Option]>,
3058  HelpText<"Set directory to SYSTEM include search path with prefix">, MetaVarName<"<dir>">;
3059def iwithsysroot : JoinedOrSeparate<["-"], "iwithsysroot">, Group<clang_i_Group>,
3060  HelpText<"Add directory to SYSTEM include search path, "
3061           "absolute paths are relative to -isysroot">, MetaVarName<"<directory>">,
3062  Flags<[CC1Option]>;
3063def ivfsoverlay : JoinedOrSeparate<["-"], "ivfsoverlay">, Group<clang_i_Group>, Flags<[CC1Option]>,
3064  HelpText<"Overlay the virtual filesystem described by file over the real file system">;
3065def imultilib : Separate<["-"], "imultilib">, Group<gfortran_Group>;
3066def keep__private__externs : Flag<["-"], "keep_private_externs">;
3067def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>,
3068        Group<Link_Group>;
3069def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>;
3070def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>;
3071def mlittle_endian : Flag<["-"], "mlittle-endian">, Flags<[NoXarchOption]>;
3072def EL : Flag<["-"], "EL">, Alias<mlittle_endian>;
3073def mbig_endian : Flag<["-"], "mbig-endian">, Flags<[NoXarchOption]>;
3074def EB : Flag<["-"], "EB">, Alias<mbig_endian>;
3075def m16 : Flag<["-"], "m16">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3076def m32 : Flag<["-"], "m32">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3077def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group<m_Group>, Flags<[NoXarchOption,CC1Option]>,
3078  HelpText<"Enable hexagon-qdsp6 backward compatibility">,
3079  MarshallingInfoFlag<LangOpts<"HexagonQdsp6Compat">>;
3080def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3081def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3082def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>;
3083def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>,
3084  HelpText<"Use Intel MCU ABI">;
3085def mno_iamcu : Flag<["-"], "mno-iamcu">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
3086def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group<clang_ignored_m_Group>;
3087def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group<clang_ignored_m_Group>;
3088def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group<clang_ignored_m_Group>;
3089def malign_branch_EQ : CommaJoined<["-"], "malign-branch=">, Group<m_Group>, Flags<[NoXarchOption]>,
3090  HelpText<"Specify types of branches to align">;
3091def malign_branch_boundary_EQ : Joined<["-"], "malign-branch-boundary=">, Group<m_Group>, Flags<[NoXarchOption]>,
3092  HelpText<"Specify the boundary's size to align branches">;
3093def mpad_max_prefix_size_EQ : Joined<["-"], "mpad-max-prefix-size=">, Group<m_Group>, Flags<[NoXarchOption]>,
3094  HelpText<"Specify maximum number of prefixes to use for padding">;
3095def mbranches_within_32B_boundaries : Flag<["-"], "mbranches-within-32B-boundaries">, Flags<[NoXarchOption]>, Group<m_Group>,
3096  HelpText<"Align selected branches (fused, jcc, jmp) within 32-byte boundary">;
3097def mfancy_math_387 : Flag<["-"], "mfancy-math-387">, Group<clang_ignored_m_Group>;
3098def mlong_calls : Flag<["-"], "mlong-calls">, Group<m_Group>,
3099  HelpText<"Generate branches with extended addressability, usually via indirect jumps.">;
3100def mdouble_EQ : Joined<["-"], "mdouble=">, Group<m_Group>, Values<"32,64">, Flags<[CC1Option]>,
3101  HelpText<"Force double to be 32 bits or 64 bits">,
3102  MarshallingInfoInt<LangOpts<"DoubleSize">, "0">;
3103def LongDouble_Group : OptionGroup<"<LongDouble group>">, Group<m_Group>,
3104  DocName<"Long double flags">,
3105  DocBrief<[{Selects the long double implementation}]>;
3106def mlong_double_64 : Flag<["-"], "mlong-double-64">, Group<LongDouble_Group>, Flags<[CC1Option]>,
3107  HelpText<"Force long double to be 64 bits">;
3108def mlong_double_80 : Flag<["-"], "mlong-double-80">, Group<LongDouble_Group>, Flags<[CC1Option]>,
3109  HelpText<"Force long double to be 80 bits, padded to 128 bits for storage">;
3110def mlong_double_128 : Flag<["-"], "mlong-double-128">, Group<LongDouble_Group>, Flags<[CC1Option]>,
3111  HelpText<"Force long double to be 128 bits">;
3112def mno_long_calls : Flag<["-"], "mno-long-calls">, Group<m_Group>,
3113  HelpText<"Restore the default behaviour of not generating long calls">;
3114def mexecute_only : Flag<["-"], "mexecute-only">, Group<m_arm_Features_Group>,
3115  HelpText<"Disallow generation of data access to code sections (ARM only)">;
3116def mno_execute_only : Flag<["-"], "mno-execute-only">, Group<m_arm_Features_Group>,
3117  HelpText<"Allow generation of data access to code sections (ARM only)">;
3118def mtp_mode_EQ : Joined<["-"], "mtp=">, Group<m_arm_Features_Group>, Values<"soft,cp15,el0,el1,el2,el3">,
3119  HelpText<"Thread pointer access method (AArch32/AArch64 only)">;
3120def mpure_code : Flag<["-"], "mpure-code">, Alias<mexecute_only>; // Alias for GCC compatibility
3121def mno_pure_code : Flag<["-"], "mno-pure-code">, Alias<mno_execute_only>;
3122def mtvos_version_min_EQ : Joined<["-"], "mtvos-version-min=">, Group<m_Group>;
3123def mappletvos_version_min_EQ : Joined<["-"], "mappletvos-version-min=">, Alias<mtvos_version_min_EQ>;
3124def mtvos_simulator_version_min_EQ : Joined<["-"], "mtvos-simulator-version-min=">;
3125def mappletvsimulator_version_min_EQ : Joined<["-"], "mappletvsimulator-version-min=">, Alias<mtvos_simulator_version_min_EQ>;
3126def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, Group<m_Group>;
3127def mwatchos_simulator_version_min_EQ : Joined<["-"], "mwatchos-simulator-version-min=">;
3128def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias<mwatchos_simulator_version_min_EQ>;
3129def march_EQ : Joined<["-"], "march=">, Group<m_Group>, Flags<[CoreOption]>;
3130def masm_EQ : Joined<["-"], "masm=">, Group<m_Group>, Flags<[NoXarchOption]>;
3131def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>, Flags<[CC1Option]>,
3132  MarshallingInfoString<TargetOpts<"CodeModel">, [{"default"}]>;
3133def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>, Flags<[NoXarchOption, CC1Option]>,
3134  HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
3135           "12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">,
3136  MarshallingInfoInt<CodeGenOpts<"TLSSize">>;
3137def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group<m_Group>;
3138def mdefault_build_attributes : Joined<["-"], "mdefault-build-attributes">, Group<m_Group>;
3139def mno_default_build_attributes : Joined<["-"], "mno-default-build-attributes">, Group<m_Group>;
3140def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group<clang_ignored_m_Group>;
3141def mconsole : Joined<["-"], "mconsole">, Group<m_Group>, Flags<[NoXarchOption]>;
3142def mwindows : Joined<["-"], "mwindows">, Group<m_Group>, Flags<[NoXarchOption]>;
3143def mdll : Joined<["-"], "mdll">, Group<m_Group>, Flags<[NoXarchOption]>;
3144def municode : Joined<["-"], "municode">, Group<m_Group>, Flags<[NoXarchOption]>;
3145def mthreads : Joined<["-"], "mthreads">, Group<m_Group>, Flags<[NoXarchOption]>;
3146def mcpu_EQ : Joined<["-"], "mcpu=">, Group<m_Group>;
3147def mmcu_EQ : Joined<["-"], "mmcu=">, Group<m_Group>;
3148def msim : Flag<["-"], "msim">, Group<m_Group>;
3149def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group<m_Group>;
3150def mfix_and_continue : Flag<["-"], "mfix-and-continue">, Group<clang_ignored_m_Group>;
3151def mieee_fp : Flag<["-"], "mieee-fp">, Group<clang_ignored_m_Group>;
3152def minline_all_stringops : Flag<["-"], "minline-all-stringops">, Group<clang_ignored_m_Group>;
3153def mno_inline_all_stringops : Flag<["-"], "mno-inline-all-stringops">, Group<clang_ignored_m_Group>;
3154def malign_double : Flag<["-"], "malign-double">, Group<m_Group>, Flags<[CC1Option]>,
3155  HelpText<"Align doubles to two words in structs (x86 only)">,
3156  MarshallingInfoFlag<LangOpts<"AlignDouble">>;
3157def mfloat_abi_EQ : Joined<["-"], "mfloat-abi=">, Group<m_Group>, Values<"soft,softfp,hard">;
3158def mfpmath_EQ : Joined<["-"], "mfpmath=">, Group<m_Group>;
3159def mfpu_EQ : Joined<["-"], "mfpu=">, Group<m_Group>;
3160def mhwdiv_EQ : Joined<["-"], "mhwdiv=">, Group<m_Group>;
3161def mhwmult_EQ : Joined<["-"], "mhwmult=">, Group<m_Group>;
3162def mglobal_merge : Flag<["-"], "mglobal-merge">, Group<m_Group>, Flags<[CC1Option]>,
3163  HelpText<"Enable merging of globals">;
3164def mhard_float : Flag<["-"], "mhard-float">, Group<m_Group>;
3165def miphoneos_version_min_EQ : Joined<["-"], "miphoneos-version-min=">, Group<m_Group>;
3166def mios_version_min_EQ : Joined<["-"], "mios-version-min=">,
3167  Alias<miphoneos_version_min_EQ>, HelpText<"Set iOS deployment target">;
3168def mios_simulator_version_min_EQ : Joined<["-"], "mios-simulator-version-min=">;
3169def miphonesimulator_version_min_EQ : Joined<["-"], "miphonesimulator-version-min=">, Alias<mios_simulator_version_min_EQ>;
3170def mkernel : Flag<["-"], "mkernel">, Group<m_Group>;
3171def mlinker_version_EQ : Joined<["-"], "mlinker-version=">,
3172  Flags<[NoXarchOption]>;
3173def mllvm : Separate<["-"], "mllvm">, Flags<[CC1Option,CC1AsOption,CoreOption]>,
3174  HelpText<"Additional arguments to forward to LLVM's option processing">,
3175  MarshallingInfoStringVector<FrontendOpts<"LLVMArgs">>;
3176def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">,
3177  Group<m_Group>, Flags<[CC1Option]>, HelpText<"Set Fuchsia API level">,
3178  MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>;
3179def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">,
3180  Group<m_Group>, HelpText<"Set Mac OS X deployment target">;
3181def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
3182  Group<m_Group>, Alias<mmacosx_version_min_EQ>;
3183def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CC1Option]>,
3184  HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">,
3185  MarshallingInfoFlag<LangOpts<"MSBitfields">>;
3186def moutline : Flag<["-"], "moutline">, Group<f_clang_Group>, Flags<[CC1Option]>,
3187    HelpText<"Enable function outlining (AArch64 only)">;
3188def mno_outline : Flag<["-"], "mno-outline">, Group<f_clang_Group>, Flags<[CC1Option]>,
3189    HelpText<"Disable function outlining (AArch64 only)">;
3190def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
3191  HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">;
3192def mstackrealign : Flag<["-"], "mstackrealign">, Group<m_Group>, Flags<[CC1Option]>,
3193  HelpText<"Force realign the stack at entry to every function">,
3194  MarshallingInfoFlag<CodeGenOpts<"StackRealignment">>;
3195def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group<m_Group>, Flags<[CC1Option]>,
3196  HelpText<"Set the stack alignment">,
3197  MarshallingInfoInt<CodeGenOpts<"StackAlignment">>;
3198def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group<m_Group>, Flags<[CC1Option]>,
3199  HelpText<"Set the stack probe size">,
3200  MarshallingInfoInt<CodeGenOpts<"StackProbeSize">, "4096">;
3201def mstack_arg_probe : Flag<["-"], "mstack-arg-probe">, Group<m_Group>,
3202  HelpText<"Enable stack probes">;
3203def mno_stack_arg_probe : Flag<["-"], "mno-stack-arg-probe">, Group<m_Group>, Flags<[CC1Option]>,
3204  HelpText<"Disable stack probes which are enabled by default">,
3205  MarshallingInfoFlag<CodeGenOpts<"NoStackArgProbe">>;
3206def mthread_model : Separate<["-"], "mthread-model">, Group<m_Group>, Flags<[CC1Option]>,
3207  HelpText<"The thread model to use, e.g. posix, single (posix by default)">, Values<"posix,single">,
3208  NormalizedValues<["POSIX", "Single"]>, NormalizedValuesScope<"LangOptions::ThreadModelKind">,
3209  MarshallingInfoEnum<LangOpts<"ThreadModel">, "POSIX">;
3210def meabi : Separate<["-"], "meabi">, Group<m_Group>, Flags<[CC1Option]>,
3211  HelpText<"Set EABI type, e.g. 4, 5 or gnu (default depends on triple)">, Values<"default,4,5,gnu">,
3212  MarshallingInfoEnum<TargetOpts<"EABIVersion">, "Default">,
3213  NormalizedValuesScope<"llvm::EABI">,
3214  NormalizedValues<["Default", "EABI4", "EABI5", "GNU"]>;
3215def mtargetos_EQ : Joined<["-"], "mtargetos=">, Group<m_Group>,
3216  HelpText<"Set the deployment target to be the specified OS and OS version">;
3217
3218def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group<m_Group>;
3219def mno_global_merge : Flag<["-"], "mno-global-merge">, Group<m_Group>, Flags<[CC1Option]>,
3220  HelpText<"Disable merging of globals">;
3221def mno_pascal_strings : Flag<["-"], "mno-pascal-strings">,
3222  Alias<fno_pascal_strings>;
3223def mno_red_zone : Flag<["-"], "mno-red-zone">, Group<m_Group>;
3224def mno_tls_direct_seg_refs : Flag<["-"], "mno-tls-direct-seg-refs">, Group<m_Group>, Flags<[CC1Option]>,
3225  HelpText<"Disable direct TLS access through segment registers">,
3226  MarshallingInfoFlag<CodeGenOpts<"IndirectTlsSegRefs">>;
3227def mno_relax_all : Flag<["-"], "mno-relax-all">, Group<m_Group>;
3228def mno_rtd: Flag<["-"], "mno-rtd">, Group<m_Group>;
3229def mno_soft_float : Flag<["-"], "mno-soft-float">, Group<m_Group>;
3230def mno_stackrealign : Flag<["-"], "mno-stackrealign">, Group<m_Group>;
3231
3232def mretpoline : Flag<["-"], "mretpoline">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>;
3233def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>;
3234defm speculative_load_hardening : BoolOption<"m", "speculative-load-hardening",
3235  CodeGenOpts<"SpeculativeLoadHardening">, DefaultFalse,
3236  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
3237  Group<m_Group>;
3238def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3239  HelpText<"Enable all mitigations for Load Value Injection (LVI)">;
3240def mno_lvi_hardening : Flag<["-"], "mno-lvi-hardening">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3241  HelpText<"Disable mitigations for Load Value Injection (LVI)">;
3242def mlvi_cfi : Flag<["-"], "mlvi-cfi">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3243  HelpText<"Enable only control-flow mitigations for Load Value Injection (LVI)">;
3244def mno_lvi_cfi : Flag<["-"], "mno-lvi-cfi">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
3245  HelpText<"Disable control-flow mitigations for Load Value Injection (LVI)">;
3246def m_seses : Flag<["-"], "mseses">, Group<m_Group>, Flags<[CoreOption, NoXarchOption]>,
3247  HelpText<"Enable speculative execution side effect suppression (SESES). "
3248    "Includes LVI control flow integrity mitigations">;
3249def mno_seses : Flag<["-"], "mno-seses">, Group<m_Group>, Flags<[CoreOption, NoXarchOption]>,
3250  HelpText<"Disable speculative execution side effect suppression (SESES)">;
3251
3252def mrelax : Flag<["-"], "mrelax">, Group<m_Group>,
3253  HelpText<"Enable linker relaxation">;
3254def mno_relax : Flag<["-"], "mno-relax">, Group<m_Group>,
3255  HelpText<"Disable linker relaxation">;
3256def msmall_data_limit_EQ : Joined<["-"], "msmall-data-limit=">, Group<m_Group>,
3257  Alias<G>,
3258  HelpText<"Put global and static data smaller than the limit into a special section">;
3259def msave_restore : Flag<["-"], "msave-restore">, Group<m_riscv_Features_Group>,
3260  HelpText<"Enable using library calls for save and restore">;
3261def mno_save_restore : Flag<["-"], "mno-save-restore">, Group<m_riscv_Features_Group>,
3262  HelpText<"Disable using library calls for save and restore">;
3263def mcmodel_EQ_medlow : Flag<["-"], "mcmodel=medlow">, Group<m_riscv_Features_Group>,
3264  Flags<[CC1Option]>, Alias<mcmodel_EQ>, AliasArgs<["small"]>,
3265  HelpText<"Equivalent to -mcmodel=small, compatible with RISC-V gcc.">;
3266def mcmodel_EQ_medany : Flag<["-"], "mcmodel=medany">, Group<m_riscv_Features_Group>,
3267  Flags<[CC1Option]>, Alias<mcmodel_EQ>, AliasArgs<["medium"]>,
3268  HelpText<"Equivalent to -mcmodel=medium, compatible with RISC-V gcc.">;
3269def menable_experimental_extensions : Flag<["-"], "menable-experimental-extensions">, Group<m_Group>,
3270  HelpText<"Enable use of experimental RISC-V extensions.">;
3271
3272def munaligned_access : Flag<["-"], "munaligned-access">, Group<m_arm_Features_Group>,
3273  HelpText<"Allow memory accesses to be unaligned (AArch32/AArch64 only)">;
3274def mno_unaligned_access : Flag<["-"], "mno-unaligned-access">, Group<m_arm_Features_Group>,
3275  HelpText<"Force all memory accesses to be aligned (AArch32/AArch64 only)">;
3276def mstrict_align : Flag<["-"], "mstrict-align">, Alias<mno_unaligned_access>, Flags<[CC1Option,HelpHidden]>,
3277  HelpText<"Force all memory accesses to be aligned (same as mno-unaligned-access)">;
3278def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_arm_Features_Group>;
3279def mrestrict_it: Flag<["-"], "mrestrict-it">, Group<m_arm_Features_Group>,
3280  HelpText<"Disallow generation of deprecated IT blocks for ARMv8. It is on by default for ARMv8 Thumb mode.">;
3281def mno_restrict_it: Flag<["-"], "mno-restrict-it">, Group<m_arm_Features_Group>,
3282  HelpText<"Allow generation of deprecated IT blocks for ARMv8. It is off by default for ARMv8 Thumb mode">;
3283def marm : Flag<["-"], "marm">, Alias<mno_thumb>;
3284def ffixed_r9 : Flag<["-"], "ffixed-r9">, Group<m_arm_Features_Group>,
3285  HelpText<"Reserve the r9 register (ARM only)">;
3286def mno_movt : Flag<["-"], "mno-movt">, Group<m_arm_Features_Group>,
3287  HelpText<"Disallow use of movt/movw pairs (ARM only)">;
3288def mcrc : Flag<["-"], "mcrc">, Group<m_Group>,
3289  HelpText<"Allow use of CRC instructions (ARM/Mips only)">;
3290def mnocrc : Flag<["-"], "mnocrc">, Group<m_arm_Features_Group>,
3291  HelpText<"Disallow use of CRC instructions (ARM only)">;
3292def mno_neg_immediates: Flag<["-"], "mno-neg-immediates">, Group<m_arm_Features_Group>,
3293  HelpText<"Disallow converting instructions with negative immediates to their negation or inversion.">;
3294def mcmse : Flag<["-"], "mcmse">, Group<m_arm_Features_Group>,
3295  Flags<[NoXarchOption,CC1Option]>,
3296  HelpText<"Allow use of CMSE (Armv8-M Security Extensions)">,
3297  MarshallingInfoFlag<LangOpts<"Cmse">>;
3298def ForceAAPCSBitfieldLoad : Flag<["-"], "faapcs-bitfield-load">, Group<m_arm_Features_Group>,
3299  Flags<[NoXarchOption,CC1Option]>,
3300  HelpText<"Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).">,
3301  MarshallingInfoFlag<CodeGenOpts<"ForceAAPCSBitfieldLoad">>;
3302defm aapcs_bitfield_width : BoolOption<"f", "aapcs-bitfield-width",
3303  CodeGenOpts<"AAPCSBitfieldWidth">, DefaultTrue,
3304  NegFlag<SetFalse, [], "Do not follow">, PosFlag<SetTrue, [], "Follow">,
3305  BothFlags<[NoXarchOption, CC1Option], " the AAPCS standard requirement stating that"
3306            " volatile bit-field width is dictated by the field container type. (ARM only).">>,
3307  Group<m_arm_Features_Group>;
3308
3309def mgeneral_regs_only : Flag<["-"], "mgeneral-regs-only">, Group<m_Group>,
3310  HelpText<"Generate code which only uses the general purpose registers (AArch64/x86 only)">;
3311def mfix_cmse_cve_2021_35465 : Flag<["-"], "mfix-cmse-cve-2021-35465">,
3312  Group<m_arm_Features_Group>,
3313  HelpText<"Work around VLLDM erratum CVE-2021-35465 (ARM only)">;
3314def mno_fix_cmse_cve_2021_35465 : Flag<["-"], "mno-fix-cmse-cve-2021-35465">,
3315  Group<m_arm_Features_Group>,
3316  HelpText<"Don't work around VLLDM erratum CVE-2021-35465 (ARM only)">;
3317def mfix_cortex_a53_835769 : Flag<["-"], "mfix-cortex-a53-835769">,
3318  Group<m_aarch64_Features_Group>,
3319  HelpText<"Workaround Cortex-A53 erratum 835769 (AArch64 only)">;
3320def mno_fix_cortex_a53_835769 : Flag<["-"], "mno-fix-cortex-a53-835769">,
3321  Group<m_aarch64_Features_Group>,
3322  HelpText<"Don't workaround Cortex-A53 erratum 835769 (AArch64 only)">;
3323def mmark_bti_property : Flag<["-"], "mmark-bti-property">,
3324  Group<m_aarch64_Features_Group>,
3325  HelpText<"Add .note.gnu.property with BTI to assembly files (AArch64 only)">;
3326foreach i = {1-31} in
3327  def ffixed_x#i : Flag<["-"], "ffixed-x"#i>, Group<m_Group>,
3328    HelpText<"Reserve the x"#i#" register (AArch64/RISC-V only)">;
3329
3330foreach i = {8-15,18} in
3331  def fcall_saved_x#i : Flag<["-"], "fcall-saved-x"#i>, Group<m_aarch64_Features_Group>,
3332    HelpText<"Make the x"#i#" register call-saved (AArch64 only)">;
3333
3334def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">,
3335  Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
3336  HelpText<"Specify the size in bits of an SVE vector register. Defaults to the"
3337           " vector length agnostic value of \"scalable\". (AArch64 only)">,
3338  Values<"128,256,512,1024,2048,scalable">,
3339  NormalizedValues<["128", "256", "512", "1024", "2048", "0"]>,
3340  MarshallingInfoEnum<LangOpts<"ArmSveVectorBits">, "0">;
3341
3342def msign_return_address_EQ : Joined<["-"], "msign-return-address=">,
3343  Flags<[CC1Option]>, Group<m_Group>, Values<"none,all,non-leaf">,
3344  HelpText<"Select return address signing scope">;
3345def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">,
3346  HelpText<"Enforce targets of indirect branches and function returns">;
3347
3348def mharden_sls_EQ : Joined<["-"], "mharden-sls=">,
3349  HelpText<"Select straight-line speculation hardening scope">;
3350
3351def msimd128 : Flag<["-"], "msimd128">, Group<m_wasm_Features_Group>;
3352def mno_simd128 : Flag<["-"], "mno-simd128">, Group<m_wasm_Features_Group>;
3353def mrelaxed_simd : Flag<["-"], "mrelaxed-simd">, Group<m_wasm_Features_Group>;
3354def mno_relaxed_simd : Flag<["-"], "mno-relaxed-simd">, Group<m_wasm_Features_Group>;
3355def mnontrapping_fptoint : Flag<["-"], "mnontrapping-fptoint">, Group<m_wasm_Features_Group>;
3356def mno_nontrapping_fptoint : Flag<["-"], "mno-nontrapping-fptoint">, Group<m_wasm_Features_Group>;
3357def msign_ext : Flag<["-"], "msign-ext">, Group<m_wasm_Features_Group>;
3358def mno_sign_ext : Flag<["-"], "mno-sign-ext">, Group<m_wasm_Features_Group>;
3359def mexception_handing : Flag<["-"], "mexception-handling">, Group<m_wasm_Features_Group>;
3360def mno_exception_handing : Flag<["-"], "mno-exception-handling">, Group<m_wasm_Features_Group>;
3361def matomics : Flag<["-"], "matomics">, Group<m_wasm_Features_Group>;
3362def mno_atomics : Flag<["-"], "mno-atomics">, Group<m_wasm_Features_Group>;
3363def mbulk_memory : Flag<["-"], "mbulk-memory">, Group<m_wasm_Features_Group>;
3364def mno_bulk_memory : Flag<["-"], "mno-bulk-memory">, Group<m_wasm_Features_Group>;
3365def mmutable_globals : Flag<["-"], "mmutable-globals">, Group<m_wasm_Features_Group>;
3366def mno_mutable_globals : Flag<["-"], "mno-mutable-globals">, Group<m_wasm_Features_Group>;
3367def mmultivalue : Flag<["-"], "mmultivalue">, Group<m_wasm_Features_Group>;
3368def mno_multivalue : Flag<["-"], "mno-multivalue">, Group<m_wasm_Features_Group>;
3369def mtail_call : Flag<["-"], "mtail-call">, Group<m_wasm_Features_Group>;
3370def mno_tail_call : Flag<["-"], "mno-tail-call">, Group<m_wasm_Features_Group>;
3371def mreference_types : Flag<["-"], "mreference-types">, Group<m_wasm_Features_Group>;
3372def mno_reference_types : Flag<["-"], "mno-reference-types">, Group<m_wasm_Features_Group>;
3373def mexec_model_EQ : Joined<["-"], "mexec-model=">, Group<m_wasm_Features_Driver_Group>,
3374                     Values<"command,reactor">,
3375                     HelpText<"Execution model (WebAssembly only)">;
3376
3377defm amdgpu_ieee : BoolOption<"m", "amdgpu-ieee",
3378  CodeGenOpts<"EmitIEEENaNCompliantInsts">, DefaultTrue,
3379  PosFlag<SetTrue, [], "Sets the IEEE bit in the expected default floating point "
3380  " mode register. Floating point opcodes that support exception flag "
3381  "gathering quiet and propagate signaling NaN inputs per IEEE 754-2008. "
3382  "This option changes the ABI. (AMDGPU only)">,
3383  NegFlag<SetFalse, [CC1Option]>>, Group<m_Group>;
3384
3385def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
3386  HelpText<"Specify code object ABI version. Defaults to 3. (AMDGPU only)">,
3387  MetaVarName<"<version>">, Values<"2,3,4">;
3388
3389defm code_object_v3_legacy : SimpleMFlag<"code-object-v3",
3390  "Legacy option to specify code object ABI V3",
3391  "Legacy option to specify code object ABI V2",
3392  " (AMDGPU only)">;
3393defm cumode : SimpleMFlag<"cumode",
3394  "Specify CU wavefront", "Specify WGP wavefront",
3395  " execution mode (AMDGPU only)", m_amdgpu_Features_Group>;
3396defm tgsplit : SimpleMFlag<"tgsplit", "Enable", "Disable",
3397  " threadgroup split execution mode (AMDGPU only)", m_amdgpu_Features_Group>;
3398defm wavefrontsize64 : SimpleMFlag<"wavefrontsize64",
3399  "Specify wavefront size 64", "Specify wavefront size 32",
3400  " mode (AMDGPU only)">;
3401
3402defm unsafe_fp_atomics : BoolOption<"m", "unsafe-fp-atomics",
3403  TargetOpts<"AllowAMDGPUUnsafeFPAtomics">, DefaultFalse,
3404  PosFlag<SetTrue, [CC1Option], "Enable unsafe floating point atomic instructions (AMDGPU only)">,
3405  NegFlag<SetFalse>>, Group<m_Group>;
3406
3407def faltivec : Flag<["-"], "faltivec">, Group<f_Group>, Flags<[NoXarchOption]>;
3408def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>, Flags<[NoXarchOption]>;
3409def maltivec : Flag<["-"], "maltivec">, Group<m_ppc_Features_Group>;
3410def mno_altivec : Flag<["-"], "mno-altivec">, Group<m_ppc_Features_Group>;
3411def mpcrel: Flag<["-"], "mpcrel">, Group<m_ppc_Features_Group>;
3412def mno_pcrel: Flag<["-"], "mno-pcrel">, Group<m_ppc_Features_Group>;
3413def mprefixed: Flag<["-"], "mprefixed">, Group<m_ppc_Features_Group>;
3414def mno_prefixed: Flag<["-"], "mno-prefixed">, Group<m_ppc_Features_Group>;
3415def mspe : Flag<["-"], "mspe">, Group<m_ppc_Features_Group>;
3416def mno_spe : Flag<["-"], "mno-spe">, Group<m_ppc_Features_Group>;
3417def mefpu2 : Flag<["-"], "mefpu2">, Group<m_ppc_Features_Group>;
3418def mabi_EQ_vec_extabi : Flag<["-"], "mabi=vec-extabi">, Group<m_Group>, Flags<[CC1Option]>,
3419  HelpText<"Enable the extended Altivec ABI on AIX (AIX only). Uses volatile and nonvolatile vector registers">,
3420  MarshallingInfoFlag<LangOpts<"EnableAIXExtendedAltivecABI">>;
3421def mabi_EQ_vec_default : Flag<["-"], "mabi=vec-default">, Group<m_Group>, Flags<[CC1Option]>,
3422  HelpText<"Enable the default Altivec ABI on AIX (AIX only). Uses only volatile vector registers.">;
3423def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>;
3424def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>;
3425def msecure_plt : Flag<["-"], "msecure-plt">, Group<m_ppc_Features_Group>;
3426def mpower8_vector : Flag<["-"], "mpower8-vector">,
3427    Group<m_ppc_Features_Group>;
3428def mno_power8_vector : Flag<["-"], "mno-power8-vector">,
3429    Group<m_ppc_Features_Group>;
3430def mpower9_vector : Flag<["-"], "mpower9-vector">,
3431    Group<m_ppc_Features_Group>;
3432def mno_power9_vector : Flag<["-"], "mno-power9-vector">,
3433    Group<m_ppc_Features_Group>;
3434def mpower10_vector : Flag<["-"], "mpower10-vector">,
3435    Group<m_ppc_Features_Group>;
3436def mno_power10_vector : Flag<["-"], "mno-power10-vector">,
3437    Group<m_ppc_Features_Group>;
3438def mpower8_crypto : Flag<["-"], "mcrypto">,
3439    Group<m_ppc_Features_Group>;
3440def mnopower8_crypto : Flag<["-"], "mno-crypto">,
3441    Group<m_ppc_Features_Group>;
3442def mdirect_move : Flag<["-"], "mdirect-move">,
3443    Group<m_ppc_Features_Group>;
3444def mnodirect_move : Flag<["-"], "mno-direct-move">,
3445    Group<m_ppc_Features_Group>;
3446def mpaired_vector_memops: Flag<["-"], "mpaired-vector-memops">,
3447    Group<m_ppc_Features_Group>;
3448def mnopaired_vector_memops: Flag<["-"], "mno-paired-vector-memops">,
3449    Group<m_ppc_Features_Group>;
3450def mhtm : Flag<["-"], "mhtm">, Group<m_ppc_Features_Group>;
3451def mno_htm : Flag<["-"], "mno-htm">, Group<m_ppc_Features_Group>;
3452def mfprnd : Flag<["-"], "mfprnd">, Group<m_ppc_Features_Group>;
3453def mno_fprnd : Flag<["-"], "mno-fprnd">, Group<m_ppc_Features_Group>;
3454def mcmpb : Flag<["-"], "mcmpb">, Group<m_ppc_Features_Group>;
3455def mno_cmpb : Flag<["-"], "mno-cmpb">, Group<m_ppc_Features_Group>;
3456def misel : Flag<["-"], "misel">, Group<m_ppc_Features_Group>;
3457def mno_isel : Flag<["-"], "mno-isel">, Group<m_ppc_Features_Group>;
3458def mmfocrf : Flag<["-"], "mmfocrf">, Group<m_ppc_Features_Group>;
3459def mmfcrf : Flag<["-"], "mmfcrf">, Alias<mmfocrf>;
3460def mno_mfocrf : Flag<["-"], "mno-mfocrf">, Group<m_ppc_Features_Group>;
3461def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Alias<mno_mfocrf>;
3462def mpopcntd : Flag<["-"], "mpopcntd">, Group<m_ppc_Features_Group>;
3463def mno_popcntd : Flag<["-"], "mno-popcntd">, Group<m_ppc_Features_Group>;
3464def mcrbits : Flag<["-"], "mcrbits">, Group<m_ppc_Features_Group>;
3465def mno_crbits : Flag<["-"], "mno-crbits">, Group<m_ppc_Features_Group>;
3466def minvariant_function_descriptors :
3467  Flag<["-"], "minvariant-function-descriptors">, Group<m_ppc_Features_Group>;
3468def mno_invariant_function_descriptors :
3469  Flag<["-"], "mno-invariant-function-descriptors">,
3470  Group<m_ppc_Features_Group>;
3471def mfloat128: Flag<["-"], "mfloat128">,
3472    Group<m_ppc_Features_Group>;
3473def mno_float128 : Flag<["-"], "mno-float128">,
3474    Group<m_ppc_Features_Group>;
3475def mlongcall: Flag<["-"], "mlongcall">,
3476    Group<m_ppc_Features_Group>;
3477def mno_longcall : Flag<["-"], "mno-longcall">,
3478    Group<m_ppc_Features_Group>;
3479def mmma: Flag<["-"], "mmma">, Group<m_ppc_Features_Group>;
3480def mno_mma: Flag<["-"], "mno-mma">, Group<m_ppc_Features_Group>;
3481def mrop_protect : Flag<["-"], "mrop-protect">,
3482    Group<m_ppc_Features_Group>;
3483def mprivileged : Flag<["-"], "mprivileged">,
3484    Group<m_ppc_Features_Group>;
3485def maix_struct_return : Flag<["-"], "maix-struct-return">,
3486  Group<m_Group>, Flags<[CC1Option]>,
3487  HelpText<"Return all structs in memory (PPC32 only)">;
3488def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">,
3489  Group<m_Group>, Flags<[CC1Option]>,
3490  HelpText<"Return small structs in registers (PPC32 only)">;
3491
3492def mvx : Flag<["-"], "mvx">, Group<m_Group>;
3493def mno_vx : Flag<["-"], "mno-vx">, Group<m_Group>;
3494
3495defm zvector : BoolFOption<"zvector",
3496  LangOpts<"ZVector">, DefaultFalse,
3497  PosFlag<SetTrue, [CC1Option], "Enable System z vector language extension">,
3498  NegFlag<SetFalse>>;
3499def mzvector : Flag<["-"], "mzvector">, Alias<fzvector>;
3500def mno_zvector : Flag<["-"], "mno-zvector">, Alias<fno_zvector>;
3501
3502def mignore_xcoff_visibility : Flag<["-"], "mignore-xcoff-visibility">, Group<m_Group>,
3503HelpText<"Not emit the visibility attribute for asm in AIX OS or give all symbols 'unspecified' visibility in XCOFF object file">,
3504  Flags<[CC1Option]>;
3505defm backchain : BoolOption<"m", "backchain",
3506  CodeGenOpts<"Backchain">, DefaultFalse,
3507  PosFlag<SetTrue, [], "Link stack frames through backchain on System Z">,
3508  NegFlag<SetFalse>, BothFlags<[NoXarchOption,CC1Option]>>, Group<m_Group>;
3509
3510def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings">, Group<m_Group>;
3511def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Group<m_Group>;
3512def momit_leaf_frame_pointer : Flag<["-"], "momit-leaf-frame-pointer">, Group<m_Group>,
3513  HelpText<"Omit frame pointer setup for leaf functions">;
3514def moslib_EQ : Joined<["-"], "moslib=">, Group<m_Group>;
3515def mpascal_strings : Flag<["-"], "mpascal-strings">, Alias<fpascal_strings>;
3516def mred_zone : Flag<["-"], "mred-zone">, Group<m_Group>;
3517def mtls_direct_seg_refs : Flag<["-"], "mtls-direct-seg-refs">, Group<m_Group>,
3518  HelpText<"Enable direct TLS access through segment registers (default)">;
3519def mregparm_EQ : Joined<["-"], "mregparm=">, Group<m_Group>;
3520def mrelax_all : Flag<["-"], "mrelax-all">, Group<m_Group>, Flags<[CC1Option,CC1AsOption]>,
3521  HelpText<"(integrated-as) Relax all machine instructions">,
3522  MarshallingInfoFlag<CodeGenOpts<"RelaxAll">>;
3523def mincremental_linker_compatible : Flag<["-"], "mincremental-linker-compatible">, Group<m_Group>,
3524  Flags<[CC1Option,CC1AsOption]>,
3525  HelpText<"(integrated-as) Emit an object file which can be used with an incremental linker">,
3526  MarshallingInfoFlag<CodeGenOpts<"IncrementalLinkerCompatible">>;
3527def mno_incremental_linker_compatible : Flag<["-"], "mno-incremental-linker-compatible">, Group<m_Group>,
3528  HelpText<"(integrated-as) Emit an object file which cannot be used with an incremental linker">;
3529def mrtd : Flag<["-"], "mrtd">, Group<m_Group>, Flags<[CC1Option]>,
3530  HelpText<"Make StdCall calling convention the default">;
3531def msmall_data_threshold_EQ : Joined <["-"], "msmall-data-threshold=">,
3532  Group<m_Group>, Alias<G>;
3533def msoft_float : Flag<["-"], "msoft-float">, Group<m_Group>, Flags<[CC1Option]>,
3534  HelpText<"Use software floating point">,
3535  MarshallingInfoFlag<CodeGenOpts<"SoftFloat">>;
3536def moutline_atomics : Flag<["-"], "moutline-atomics">, Group<f_clang_Group>, Flags<[CC1Option]>,
3537  HelpText<"Generate local calls to out-of-line atomic operations">;
3538def mno_outline_atomics : Flag<["-"], "mno-outline-atomics">, Group<f_clang_Group>, Flags<[CC1Option]>,
3539  HelpText<"Don't generate local calls to out-of-line atomic operations">;
3540def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group<m_Group>,
3541  HelpText<"Don't generate implicit floating point instructions">;
3542def mimplicit_float : Flag<["-"], "mimplicit-float">, Group<m_Group>;
3543def mrecip : Flag<["-"], "mrecip">, Group<m_Group>;
3544def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group<m_Group>, Flags<[CC1Option]>,
3545  MarshallingInfoStringVector<CodeGenOpts<"Reciprocals">>;
3546def mprefer_vector_width_EQ : Joined<["-"], "mprefer-vector-width=">, Group<m_Group>, Flags<[CC1Option]>,
3547  HelpText<"Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.">,
3548  MarshallingInfoString<CodeGenOpts<"PreferVectorWidth">>;
3549def mstack_protector_guard_EQ : Joined<["-"], "mstack-protector-guard=">, Group<m_Group>, Flags<[CC1Option]>,
3550  HelpText<"Use the given guard (global, tls) for addressing the stack-protector guard">,
3551  MarshallingInfoString<CodeGenOpts<"StackProtectorGuard">>;
3552def mstack_protector_guard_offset_EQ : Joined<["-"], "mstack-protector-guard-offset=">, Group<m_Group>, Flags<[CC1Option]>,
3553  HelpText<"Use the given offset for addressing the stack-protector guard">,
3554  MarshallingInfoInt<CodeGenOpts<"StackProtectorGuardOffset">, "INT_MAX", "int">;
3555def mstack_protector_guard_reg_EQ : Joined<["-"], "mstack-protector-guard-reg=">, Group<m_Group>, Flags<[CC1Option]>,
3556  HelpText<"Use the given reg for addressing the stack-protector guard">,
3557  MarshallingInfoString<CodeGenOpts<"StackProtectorGuardReg">>;
3558def mfentry : Flag<["-"], "mfentry">, HelpText<"Insert calls to fentry at function entry (x86/SystemZ only)">,
3559  Flags<[CC1Option]>, Group<m_Group>,
3560  MarshallingInfoFlag<CodeGenOpts<"CallFEntry">>;
3561def mnop_mcount : Flag<["-"], "mnop-mcount">, HelpText<"Generate mcount/__fentry__ calls as nops. To activate they need to be patched in.">,
3562  Flags<[CC1Option]>, Group<m_Group>,
3563  MarshallingInfoFlag<CodeGenOpts<"MNopMCount">>;
3564def mrecord_mcount : Flag<["-"], "mrecord-mcount">, HelpText<"Generate a __mcount_loc section entry for each __fentry__ call.">,
3565  Flags<[CC1Option]>, Group<m_Group>,
3566  MarshallingInfoFlag<CodeGenOpts<"RecordMCount">>;
3567def mpacked_stack : Flag<["-"], "mpacked-stack">, HelpText<"Use packed stack layout (SystemZ only).">,
3568  Flags<[CC1Option]>, Group<m_Group>,
3569  MarshallingInfoFlag<CodeGenOpts<"PackedStack">>;
3570def mno_packed_stack : Flag<["-"], "mno-packed-stack">, Flags<[CC1Option]>, Group<m_Group>;
3571def mips16 : Flag<["-"], "mips16">, Group<m_mips_Features_Group>;
3572def mno_mips16 : Flag<["-"], "mno-mips16">, Group<m_mips_Features_Group>;
3573def mmicromips : Flag<["-"], "mmicromips">, Group<m_mips_Features_Group>;
3574def mno_micromips : Flag<["-"], "mno-micromips">, Group<m_mips_Features_Group>;
3575def mxgot : Flag<["-"], "mxgot">, Group<m_mips_Features_Group>;
3576def mno_xgot : Flag<["-"], "mno-xgot">, Group<m_mips_Features_Group>;
3577def mldc1_sdc1 : Flag<["-"], "mldc1-sdc1">, Group<m_mips_Features_Group>;
3578def mno_ldc1_sdc1 : Flag<["-"], "mno-ldc1-sdc1">, Group<m_mips_Features_Group>;
3579def mcheck_zero_division : Flag<["-"], "mcheck-zero-division">,
3580                           Group<m_mips_Features_Group>;
3581def mno_check_zero_division : Flag<["-"], "mno-check-zero-division">,
3582                              Group<m_mips_Features_Group>;
3583def mcompact_branches_EQ : Joined<["-"], "mcompact-branches=">,
3584                           Group<m_mips_Features_Group>;
3585def mbranch_likely : Flag<["-"], "mbranch-likely">, Group<m_Group>,
3586  IgnoredGCCCompat;
3587def mno_branch_likely : Flag<["-"], "mno-branch-likely">, Group<m_Group>,
3588  IgnoredGCCCompat;
3589def mindirect_jump_EQ : Joined<["-"], "mindirect-jump=">,
3590  Group<m_mips_Features_Group>,
3591  HelpText<"Change indirect jump instructions to inhibit speculation">;
3592def mdsp : Flag<["-"], "mdsp">, Group<m_mips_Features_Group>;
3593def mno_dsp : Flag<["-"], "mno-dsp">, Group<m_mips_Features_Group>;
3594def mdspr2 : Flag<["-"], "mdspr2">, Group<m_mips_Features_Group>;
3595def mno_dspr2 : Flag<["-"], "mno-dspr2">, Group<m_mips_Features_Group>;
3596def msingle_float : Flag<["-"], "msingle-float">, Group<m_mips_Features_Group>;
3597def mdouble_float : Flag<["-"], "mdouble-float">, Group<m_mips_Features_Group>;
3598def mmadd4 : Flag<["-"], "mmadd4">, Group<m_mips_Features_Group>,
3599  HelpText<"Enable the generation of 4-operand madd.s, madd.d and related instructions.">;
3600def mno_madd4 : Flag<["-"], "mno-madd4">, Group<m_mips_Features_Group>,
3601  HelpText<"Disable the generation of 4-operand madd.s, madd.d and related instructions.">;
3602def mmsa : Flag<["-"], "mmsa">, Group<m_mips_Features_Group>,
3603  HelpText<"Enable MSA ASE (MIPS only)">;
3604def mno_msa : Flag<["-"], "mno-msa">, Group<m_mips_Features_Group>,
3605  HelpText<"Disable MSA ASE (MIPS only)">;
3606def mmt : Flag<["-"], "mmt">, Group<m_mips_Features_Group>,
3607  HelpText<"Enable MT ASE (MIPS only)">;
3608def mno_mt : Flag<["-"], "mno-mt">, Group<m_mips_Features_Group>,
3609  HelpText<"Disable MT ASE (MIPS only)">;
3610def mfp64 : Flag<["-"], "mfp64">, Group<m_mips_Features_Group>,
3611  HelpText<"Use 64-bit floating point registers (MIPS only)">;
3612def mfp32 : Flag<["-"], "mfp32">, Group<m_mips_Features_Group>,
3613  HelpText<"Use 32-bit floating point registers (MIPS only)">;
3614def mgpopt : Flag<["-"], "mgpopt">, Group<m_mips_Features_Group>,
3615  HelpText<"Use GP relative accesses for symbols known to be in a small"
3616           " data section (MIPS)">;
3617def mno_gpopt : Flag<["-"], "mno-gpopt">, Group<m_mips_Features_Group>,
3618  HelpText<"Do not use GP relative accesses for symbols known to be in a small"
3619           " data section (MIPS)">;
3620def mlocal_sdata : Flag<["-"], "mlocal-sdata">,
3621  Group<m_mips_Features_Group>,
3622  HelpText<"Extend the -G behaviour to object local data (MIPS)">;
3623def mno_local_sdata : Flag<["-"], "mno-local-sdata">,
3624  Group<m_mips_Features_Group>,
3625  HelpText<"Do not extend the -G behaviour to object local data (MIPS)">;
3626def mextern_sdata : Flag<["-"], "mextern-sdata">,
3627  Group<m_mips_Features_Group>,
3628  HelpText<"Assume that externally defined data is in the small data if it"
3629           " meets the -G <size> threshold (MIPS)">;
3630def mno_extern_sdata : Flag<["-"], "mno-extern-sdata">,
3631  Group<m_mips_Features_Group>,
3632  HelpText<"Do not assume that externally defined data is in the small data if"
3633           " it meets the -G <size> threshold (MIPS)">;
3634def membedded_data : Flag<["-"], "membedded-data">,
3635  Group<m_mips_Features_Group>,
3636  HelpText<"Place constants in the .rodata section instead of the .sdata "
3637           "section even if they meet the -G <size> threshold (MIPS)">;
3638def mno_embedded_data : Flag<["-"], "mno-embedded-data">,
3639  Group<m_mips_Features_Group>,
3640  HelpText<"Do not place constants in the .rodata section instead of the "
3641           ".sdata if they meet the -G <size> threshold (MIPS)">;
3642def mnan_EQ : Joined<["-"], "mnan=">, Group<m_mips_Features_Group>;
3643def mabs_EQ : Joined<["-"], "mabs=">, Group<m_mips_Features_Group>;
3644def mabicalls : Flag<["-"], "mabicalls">, Group<m_mips_Features_Group>,
3645  HelpText<"Enable SVR4-style position-independent code (Mips only)">;
3646def mno_abicalls : Flag<["-"], "mno-abicalls">, Group<m_mips_Features_Group>,
3647  HelpText<"Disable SVR4-style position-independent code (Mips only)">;
3648def mno_crc : Flag<["-"], "mno-crc">, Group<m_mips_Features_Group>,
3649  HelpText<"Disallow use of CRC instructions (Mips only)">;
3650def mvirt : Flag<["-"], "mvirt">, Group<m_mips_Features_Group>;
3651def mno_virt : Flag<["-"], "mno-virt">, Group<m_mips_Features_Group>;
3652def mginv : Flag<["-"], "mginv">, Group<m_mips_Features_Group>;
3653def mno_ginv : Flag<["-"], "mno-ginv">, Group<m_mips_Features_Group>;
3654def mips1 : Flag<["-"], "mips1">,
3655  Alias<march_EQ>, AliasArgs<["mips1"]>, Group<m_mips_Features_Group>,
3656  HelpText<"Equivalent to -march=mips1">, Flags<[HelpHidden]>;
3657def mips2 : Flag<["-"], "mips2">,
3658  Alias<march_EQ>, AliasArgs<["mips2"]>, Group<m_mips_Features_Group>,
3659  HelpText<"Equivalent to -march=mips2">, Flags<[HelpHidden]>;
3660def mips3 : Flag<["-"], "mips3">,
3661  Alias<march_EQ>, AliasArgs<["mips3"]>, Group<m_mips_Features_Group>,
3662  HelpText<"Equivalent to -march=mips3">, Flags<[HelpHidden]>;
3663def mips4 : Flag<["-"], "mips4">,
3664  Alias<march_EQ>, AliasArgs<["mips4"]>, Group<m_mips_Features_Group>,
3665  HelpText<"Equivalent to -march=mips4">, Flags<[HelpHidden]>;
3666def mips5 : Flag<["-"], "mips5">,
3667  Alias<march_EQ>, AliasArgs<["mips5"]>, Group<m_mips_Features_Group>,
3668  HelpText<"Equivalent to -march=mips5">, Flags<[HelpHidden]>;
3669def mips32 : Flag<["-"], "mips32">,
3670  Alias<march_EQ>, AliasArgs<["mips32"]>, Group<m_mips_Features_Group>,
3671  HelpText<"Equivalent to -march=mips32">, Flags<[HelpHidden]>;
3672def mips32r2 : Flag<["-"], "mips32r2">,
3673  Alias<march_EQ>, AliasArgs<["mips32r2"]>, Group<m_mips_Features_Group>,
3674  HelpText<"Equivalent to -march=mips32r2">, Flags<[HelpHidden]>;
3675def mips32r3 : Flag<["-"], "mips32r3">,
3676  Alias<march_EQ>, AliasArgs<["mips32r3"]>, Group<m_mips_Features_Group>,
3677  HelpText<"Equivalent to -march=mips32r3">, Flags<[HelpHidden]>;
3678def mips32r5 : Flag<["-"], "mips32r5">,
3679  Alias<march_EQ>, AliasArgs<["mips32r5"]>, Group<m_mips_Features_Group>,
3680  HelpText<"Equivalent to -march=mips32r5">, Flags<[HelpHidden]>;
3681def mips32r6 : Flag<["-"], "mips32r6">,
3682  Alias<march_EQ>, AliasArgs<["mips32r6"]>, Group<m_mips_Features_Group>,
3683  HelpText<"Equivalent to -march=mips32r6">, Flags<[HelpHidden]>;
3684def mips64 : Flag<["-"], "mips64">,
3685  Alias<march_EQ>, AliasArgs<["mips64"]>, Group<m_mips_Features_Group>,
3686  HelpText<"Equivalent to -march=mips64">, Flags<[HelpHidden]>;
3687def mips64r2 : Flag<["-"], "mips64r2">,
3688  Alias<march_EQ>, AliasArgs<["mips64r2"]>, Group<m_mips_Features_Group>,
3689  HelpText<"Equivalent to -march=mips64r2">, Flags<[HelpHidden]>;
3690def mips64r3 : Flag<["-"], "mips64r3">,
3691  Alias<march_EQ>, AliasArgs<["mips64r3"]>, Group<m_mips_Features_Group>,
3692  HelpText<"Equivalent to -march=mips64r3">, Flags<[HelpHidden]>;
3693def mips64r5 : Flag<["-"], "mips64r5">,
3694  Alias<march_EQ>, AliasArgs<["mips64r5"]>, Group<m_mips_Features_Group>,
3695  HelpText<"Equivalent to -march=mips64r5">, Flags<[HelpHidden]>;
3696def mips64r6 : Flag<["-"], "mips64r6">,
3697  Alias<march_EQ>, AliasArgs<["mips64r6"]>, Group<m_mips_Features_Group>,
3698  HelpText<"Equivalent to -march=mips64r6">, Flags<[HelpHidden]>;
3699def mfpxx : Flag<["-"], "mfpxx">, Group<m_mips_Features_Group>,
3700  HelpText<"Avoid FPU mode dependent operations when used with the O32 ABI">,
3701  Flags<[HelpHidden]>;
3702def modd_spreg : Flag<["-"], "modd-spreg">, Group<m_mips_Features_Group>,
3703  HelpText<"Enable odd single-precision floating point registers">,
3704  Flags<[HelpHidden]>;
3705def mno_odd_spreg : Flag<["-"], "mno-odd-spreg">, Group<m_mips_Features_Group>,
3706  HelpText<"Disable odd single-precision floating point registers">,
3707  Flags<[HelpHidden]>;
3708def mrelax_pic_calls : Flag<["-"], "mrelax-pic-calls">,
3709  Group<m_mips_Features_Group>,
3710  HelpText<"Produce relaxation hints for linkers to try optimizing PIC "
3711           "call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
3712def mno_relax_pic_calls : Flag<["-"], "mno-relax-pic-calls">,
3713  Group<m_mips_Features_Group>,
3714  HelpText<"Do not produce relaxation hints for linkers to try optimizing PIC "
3715           "call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
3716def mglibc : Flag<["-"], "mglibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
3717def muclibc : Flag<["-"], "muclibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
3718def module_file_info : Flag<["-"], "module-file-info">, Flags<[NoXarchOption,CC1Option]>, Group<Action_Group>,
3719  HelpText<"Provide information about a particular module file">;
3720def mthumb : Flag<["-"], "mthumb">, Group<m_Group>;
3721def mtune_EQ : Joined<["-"], "mtune=">, Group<m_Group>,
3722  HelpText<"Only supported on X86 and RISC-V. Otherwise accepted for compatibility with GCC.">;
3723def multi__module : Flag<["-"], "multi_module">;
3724def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
3725def multiply__defined : Separate<["-"], "multiply_defined">;
3726def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Group<m_Group>;
3727def canonical_prefixes : Flag<["-"], "canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
3728  HelpText<"Use absolute paths for invoking subcommands (default)">;
3729def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
3730  HelpText<"Use relative paths for invoking subcommands">;
3731def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>;
3732def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[NoXarchOption]>;
3733def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
3734def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">;
3735def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>,
3736  HelpText<"Disable builtin #include directories">,
3737  MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseBuiltinIncludes">>;
3738def nogpuinc : Flag<["-"], "nogpuinc">, HelpText<"Do not add include paths for CUDA/HIP and"
3739  " do not include the default CUDA/HIP wrapper headers">;
3740def : Flag<["-"], "nocudainc">, Alias<nogpuinc>;
3741def nogpulib : Flag<["-"], "nogpulib">,
3742  HelpText<"Do not link device library for CUDA/HIP device compilation">;
3743def : Flag<["-"], "nocudalib">, Alias<nogpulib>;
3744def nodefaultlibs : Flag<["-"], "nodefaultlibs">;
3745def nofixprebinding : Flag<["-"], "nofixprebinding">;
3746def nolibc : Flag<["-"], "nolibc">;
3747def nomultidefs : Flag<["-"], "nomultidefs">;
3748def nopie : Flag<["-"], "nopie">;
3749def no_pie : Flag<["-"], "no-pie">, Alias<nopie>;
3750def noprebind : Flag<["-"], "noprebind">;
3751def noprofilelib : Flag<["-"], "noprofilelib">;
3752def noseglinkedit : Flag<["-"], "noseglinkedit">;
3753def nostartfiles : Flag<["-"], "nostartfiles">, Group<Link_Group>;
3754def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>;
3755def nostdlibinc : Flag<["-"], "nostdlibinc">;
3756def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>,
3757  HelpText<"Disable standard #include directories for the C++ standard library">,
3758  MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardCXXIncludes">>;
3759def nostdlib : Flag<["-"], "nostdlib">, Group<Link_Group>;
3760def nostdlibxx : Flag<["-"], "nostdlib++">;
3761def object : Flag<["-"], "object">;
3762def o : JoinedOrSeparate<["-"], "o">, Flags<[NoXarchOption, RenderAsInput,
3763  CC1Option, CC1AsOption, FC1Option, FlangOption]>,
3764  HelpText<"Write output to <file>">, MetaVarName<"<file>">,
3765  MarshallingInfoString<FrontendOpts<"OutputFile">>;
3766def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">;
3767def pass_exit_codes : Flag<["-", "--"], "pass-exit-codes">, Flags<[Unsupported]>;
3768def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group<pedantic_Group>, Flags<[CC1Option]>,
3769  MarshallingInfoFlag<DiagnosticOpts<"PedanticErrors">>;
3770def pedantic : Flag<["-", "--"], "pedantic">, Group<pedantic_Group>, Flags<[CC1Option,FlangOption,FC1Option]>,
3771  HelpText<"Warn on language extensions">, MarshallingInfoFlag<DiagnosticOpts<"Pedantic">>;
3772def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC1Option]>,
3773  MarshallingInfoFlag<CodeGenOpts<"InstrumentForProfiling">>;
3774def pipe : Flag<["-", "--"], "pipe">,
3775  HelpText<"Use pipes between commands, when possible">;
3776def prebind__all__twolevel__modules : Flag<["-"], "prebind_all_twolevel_modules">;
3777def prebind : Flag<["-"], "prebind">;
3778def preload : Flag<["-"], "preload">;
3779def print_file_name_EQ : Joined<["-", "--"], "print-file-name=">,
3780  HelpText<"Print the full library path of <file>">, MetaVarName<"<file>">;
3781def print_ivar_layout : Flag<["-"], "print-ivar-layout">, Flags<[CC1Option]>,
3782  HelpText<"Enable Objective-C Ivar layout bitmap print trace">,
3783  MarshallingInfoFlag<LangOpts<"ObjCGCBitmapPrint">>;
3784def print_libgcc_file_name : Flag<["-", "--"], "print-libgcc-file-name">,
3785  HelpText<"Print the library path for the currently used compiler runtime "
3786           "library (\"libgcc.a\" or \"libclang_rt.builtins.*.a\")">;
3787def print_multi_directory : Flag<["-", "--"], "print-multi-directory">;
3788def print_multi_lib : Flag<["-", "--"], "print-multi-lib">;
3789def print_multi_os_directory : Flag<["-", "--"], "print-multi-os-directory">,
3790  Flags<[Unsupported]>;
3791def print_target_triple : Flag<["-", "--"], "print-target-triple">,
3792  HelpText<"Print the normalized target triple">;
3793def print_effective_triple : Flag<["-", "--"], "print-effective-triple">,
3794  HelpText<"Print the effective target triple">;
3795def print_multiarch : Flag<["-", "--"], "print-multiarch">,
3796  HelpText<"Print the multiarch target triple">;
3797def print_prog_name_EQ : Joined<["-", "--"], "print-prog-name=">,
3798  HelpText<"Print the full program path of <name>">, MetaVarName<"<name>">;
3799def print_resource_dir : Flag<["-", "--"], "print-resource-dir">,
3800  HelpText<"Print the resource directory pathname">;
3801def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
3802  HelpText<"Print the paths used for finding libraries and programs">;
3803def print_targets : Flag<["-", "--"], "print-targets">,
3804  HelpText<"Print the registered targets">;
3805def print_rocm_search_dirs : Flag<["-", "--"], "print-rocm-search-dirs">,
3806  HelpText<"Print the paths used for finding ROCm installation">;
3807def print_runtime_dir : Flag<["-", "--"], "print-runtime-dir">,
3808  HelpText<"Print the directory pathname containing clangs runtime libraries">;
3809def private__bundle : Flag<["-"], "private_bundle">;
3810def pthreads : Flag<["-"], "pthreads">;
3811defm pthread : BoolOption<"", "pthread",
3812  LangOpts<"POSIXThreads">, DefaultFalse,
3813  PosFlag<SetTrue, [], "Support POSIX threads in generated code">,
3814  NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
3815def p : Flag<["-"], "p">;
3816def pie : Flag<["-"], "pie">, Group<Link_Group>;
3817def static_pie : Flag<["-"], "static-pie">, Group<Link_Group>;
3818def read__only__relocs : Separate<["-"], "read_only_relocs">;
3819def remap : Flag<["-"], "remap">;
3820def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[NoXarchOption,CC1Option]>,
3821  HelpText<"Rewrite Objective-C source to C++">, Group<Action_Group>;
3822def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">, Flags<[NoXarchOption]>,
3823  HelpText<"Rewrite Legacy Objective-C source to C++">;
3824def rdynamic : Flag<["-"], "rdynamic">, Group<Link_Group>;
3825def resource_dir : Separate<["-"], "resource-dir">,
3826  Flags<[NoXarchOption, CC1Option, CoreOption, HelpHidden]>,
3827  HelpText<"The directory which holds the compiler resource files">,
3828  MarshallingInfoString<HeaderSearchOpts<"ResourceDir">>;
3829def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[NoXarchOption, CoreOption]>,
3830  Alias<resource_dir>;
3831def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>, Group<Link_Group>;
3832def rtlib_EQ : Joined<["-", "--"], "rtlib=">,
3833  HelpText<"Compiler runtime library to use">;
3834def frtlib_add_rpath: Flag<["-"], "frtlib-add-rpath">, Flags<[NoArgumentUnused]>,
3835  HelpText<"Add -rpath with architecture-specific resource directory to the linker flags">;
3836def fno_rtlib_add_rpath: Flag<["-"], "fno-rtlib-add-rpath">, Flags<[NoArgumentUnused]>,
3837  HelpText<"Do not add -rpath with architecture-specific resource directory to the linker flags">;
3838def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>,
3839        Group<Link_Group>;
3840def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[CC1Option, NoXarchOption]>,
3841  HelpText<"Save intermediate compilation results.">;
3842def save_temps : Flag<["-", "--"], "save-temps">, Flags<[NoXarchOption]>,
3843  Alias<save_temps_EQ>, AliasArgs<["cwd"]>,
3844  HelpText<"Save intermediate compilation results">;
3845def save_stats_EQ : Joined<["-", "--"], "save-stats=">, Flags<[NoXarchOption]>,
3846  HelpText<"Save llvm statistics.">;
3847def save_stats : Flag<["-", "--"], "save-stats">, Flags<[NoXarchOption]>,
3848  Alias<save_stats_EQ>, AliasArgs<["cwd"]>,
3849  HelpText<"Save llvm statistics.">;
3850def via_file_asm : Flag<["-", "--"], "via-file-asm">, InternalDebugOpt,
3851  HelpText<"Write assembly to file for input to assemble jobs">;
3852def sectalign : MultiArg<["-"], "sectalign", 3>;
3853def sectcreate : MultiArg<["-"], "sectcreate", 3>;
3854def sectobjectsymbols : MultiArg<["-"], "sectobjectsymbols", 2>;
3855def sectorder : MultiArg<["-"], "sectorder", 3>;
3856def seg1addr : JoinedOrSeparate<["-"], "seg1addr">;
3857def seg__addr__table__filename : Separate<["-"], "seg_addr_table_filename">;
3858def seg__addr__table : Separate<["-"], "seg_addr_table">;
3859def segaddr : MultiArg<["-"], "segaddr", 2>;
3860def segcreate : MultiArg<["-"], "segcreate", 3>;
3861def seglinkedit : Flag<["-"], "seglinkedit">;
3862def segprot : MultiArg<["-"], "segprot", 3>;
3863def segs__read__only__addr : Separate<["-"], "segs_read_only_addr">;
3864def segs__read__write__addr : Separate<["-"], "segs_read_write_addr">;
3865def segs__read__ : Joined<["-"], "segs_read_">;
3866def shared_libgcc : Flag<["-"], "shared-libgcc">;
3867def shared : Flag<["-", "--"], "shared">, Group<Link_Group>;
3868def single__module : Flag<["-"], "single_module">;
3869def specs_EQ : Joined<["-", "--"], "specs=">, Group<Link_Group>;
3870def specs : Separate<["-", "--"], "specs">, Flags<[Unsupported]>;
3871def static_libgcc : Flag<["-"], "static-libgcc">;
3872def static_libstdcxx : Flag<["-"], "static-libstdc++">;
3873def static : Flag<["-", "--"], "static">, Group<Link_Group>, Flags<[NoArgumentUnused]>;
3874def std_default_EQ : Joined<["-"], "std-default=">;
3875def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option,FlangOption,FC1Option]>,
3876  Group<CompileOnly_Group>, HelpText<"Language standard to compile for">,
3877  ValuesCode<[{
3878    const char *Values =
3879    #define LANGSTANDARD(id, name, lang, desc, features) name ","
3880    #define LANGSTANDARD_ALIAS(id, alias) alias ","
3881    #include "clang/Basic/LangStandards.def"
3882    ;
3883  }]>;
3884def stdlib_EQ : Joined<["-", "--"], "stdlib=">, Flags<[CC1Option]>,
3885  HelpText<"C++ standard library to use">, Values<"libc++,libstdc++,platform">;
3886def stdlibxx_isystem : JoinedOrSeparate<["-"], "stdlib++-isystem">,
3887  Group<clang_i_Group>,
3888  HelpText<"Use directory as the C++ standard library include path">,
3889  Flags<[NoXarchOption]>, MetaVarName<"<directory>">;
3890def unwindlib_EQ : Joined<["-", "--"], "unwindlib=">, Flags<[CC1Option]>,
3891  HelpText<"Unwind library to use">, Values<"libgcc,unwindlib,platform">;
3892def sub__library : JoinedOrSeparate<["-"], "sub_library">;
3893def sub__umbrella : JoinedOrSeparate<["-"], "sub_umbrella">;
3894def system_header_prefix : Joined<["--"], "system-header-prefix=">,
3895  Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
3896  HelpText<"Treat all #include paths starting with <prefix> as including a "
3897           "system header.">;
3898def : Separate<["--"], "system-header-prefix">, Alias<system_header_prefix>;
3899def no_system_header_prefix : Joined<["--"], "no-system-header-prefix=">,
3900  Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
3901  HelpText<"Treat all #include paths starting with <prefix> as not including a "
3902           "system header.">;
3903def : Separate<["--"], "no-system-header-prefix">, Alias<no_system_header_prefix>;
3904def s : Flag<["-"], "s">, Group<Link_Group>;
3905def target : Joined<["--"], "target=">, Flags<[NoXarchOption, CoreOption]>,
3906  HelpText<"Generate code for the given target">;
3907def print_supported_cpus : Flag<["-", "--"], "print-supported-cpus">,
3908  Group<CompileOnly_Group>, Flags<[CC1Option, CoreOption]>,
3909  HelpText<"Print supported cpu models for the given target (if target is not specified,"
3910           " it will print the supported cpus for the default target)">,
3911  MarshallingInfoFlag<FrontendOpts<"PrintSupportedCPUs">>;
3912def mcpu_EQ_QUESTION : Flag<["-"], "mcpu=?">, Alias<print_supported_cpus>;
3913def mtune_EQ_QUESTION : Flag<["-"], "mtune=?">, Alias<print_supported_cpus>;
3914def time : Flag<["-"], "time">,
3915  HelpText<"Time individual commands">;
3916def traditional_cpp : Flag<["-", "--"], "traditional-cpp">, Flags<[CC1Option]>,
3917  HelpText<"Enable some traditional CPP emulation">,
3918  MarshallingInfoFlag<LangOpts<"TraditionalCPP">>;
3919def traditional : Flag<["-", "--"], "traditional">;
3920def trigraphs : Flag<["-", "--"], "trigraphs">, Alias<ftrigraphs>,
3921  HelpText<"Process trigraph sequences">;
3922def twolevel__namespace__hints : Flag<["-"], "twolevel_namespace_hints">;
3923def twolevel__namespace : Flag<["-"], "twolevel_namespace">;
3924def t : Flag<["-"], "t">, Group<Link_Group>;
3925def umbrella : Separate<["-"], "umbrella">;
3926def undefined : JoinedOrSeparate<["-"], "undefined">, Group<u_Group>;
3927def undef : Flag<["-"], "undef">, Group<u_Group>, Flags<[CC1Option]>,
3928  HelpText<"undef all system defines">,
3929  MarshallingInfoNegativeFlag<PreprocessorOpts<"UsePredefines">>;
3930def unexported__symbols__list : Separate<["-"], "unexported_symbols_list">;
3931def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
3932def v : Flag<["-"], "v">, Flags<[CC1Option, CoreOption]>,
3933  HelpText<"Show commands to run and use verbose output">,
3934  MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
3935def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
3936  Flags<[CC1Option]>, Group<f_Group>,
3937  HelpText<"Source-level compatibility for Altivec vectors (for PowerPC "
3938           "targets). This includes results of vector comparison (scalar for "
3939           "'xl', vector for 'gcc') as well as behavior when initializing with "
3940           "a scalar (splatting for 'xl', element zero only for 'gcc'). For "
3941           "'mixed', the compatibility is as 'gcc' for 'vector bool/vector "
3942           "pixel' and as 'xl' for other types. Current default is 'mixed'.">,
3943  Values<"mixed,gcc,xl">,
3944  NormalizedValuesScope<"LangOptions::AltivecSrcCompatKind">,
3945  NormalizedValues<["Mixed", "GCC", "XL"]>,
3946  MarshallingInfoEnum<LangOpts<"AltivecSrcCompat">, "Mixed">;
3947def verify_debug_info : Flag<["--"], "verify-debug-info">, Flags<[NoXarchOption]>,
3948  HelpText<"Verify the binary representation of debug output">;
3949def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>;
3950def weak__framework : Separate<["-"], "weak_framework">, Flags<[LinkerInput]>;
3951def weak__library : Separate<["-"], "weak_library">, Flags<[LinkerInput]>;
3952def weak__reference__mismatches : Separate<["-"], "weak_reference_mismatches">;
3953def whatsloaded : Flag<["-"], "whatsloaded">;
3954def why_load : Flag<["-"], "why_load">;
3955def whyload : Flag<["-"], "whyload">, Alias<why_load>;
3956def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">, Flags<[CC1Option]>,
3957  MarshallingInfoFlag<DiagnosticOpts<"IgnoreWarnings">>;
3958def x : JoinedOrSeparate<["-"], "x">, Flags<[NoXarchOption,CC1Option]>,
3959  HelpText<"Treat subsequent input files as having type <language>">,
3960  MetaVarName<"<language>">;
3961def y : Joined<["-"], "y">;
3962
3963defm integrated_as : BoolFOption<"integrated-as",
3964  CodeGenOpts<"DisableIntegratedAS">, DefaultFalse,
3965  NegFlag<SetTrue, [CC1Option], "Disable">, PosFlag<SetFalse, [], "Enable">,
3966  BothFlags<[], " the integrated assembler">>;
3967
3968def fintegrated_cc1 : Flag<["-"], "fintegrated-cc1">,
3969                      Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
3970                      HelpText<"Run cc1 in-process">;
3971def fno_integrated_cc1 : Flag<["-"], "fno-integrated-cc1">,
3972                         Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
3973                         HelpText<"Spawn a separate process for each cc1">;
3974
3975def : Flag<["-"], "integrated-as">, Alias<fintegrated_as>, Flags<[NoXarchOption]>;
3976def : Flag<["-"], "no-integrated-as">, Alias<fno_integrated_as>,
3977      Flags<[CC1Option, NoXarchOption]>;
3978
3979def working_directory : JoinedOrSeparate<["-"], "working-directory">, Flags<[CC1Option]>,
3980  HelpText<"Resolve file paths relative to the specified directory">,
3981  MarshallingInfoString<FileSystemOpts<"WorkingDir">>;
3982def working_directory_EQ : Joined<["-"], "working-directory=">, Flags<[CC1Option]>,
3983  Alias<working_directory>;
3984
3985// Double dash options, which are usually an alias for one of the previous
3986// options.
3987
3988def _mhwdiv_EQ : Joined<["--"], "mhwdiv=">, Alias<mhwdiv_EQ>;
3989def _mhwdiv : Separate<["--"], "mhwdiv">, Alias<mhwdiv_EQ>;
3990def _CLASSPATH_EQ : Joined<["--"], "CLASSPATH=">, Alias<fclasspath_EQ>;
3991def _CLASSPATH : Separate<["--"], "CLASSPATH">, Alias<fclasspath_EQ>;
3992def _all_warnings : Flag<["--"], "all-warnings">, Alias<Wall>;
3993def _analyzer_no_default_checks : Flag<["--"], "analyzer-no-default-checks">, Flags<[NoXarchOption]>;
3994def _analyzer_output : JoinedOrSeparate<["--"], "analyzer-output">, Flags<[NoXarchOption]>,
3995  HelpText<"Static analyzer report output format (html|plist|plist-multi-file|plist-html|sarif|sarif-html|text).">;
3996def _analyze : Flag<["--"], "analyze">, Flags<[NoXarchOption, CoreOption]>,
3997  HelpText<"Run the static analyzer">;
3998def _assemble : Flag<["--"], "assemble">, Alias<S>;
3999def _assert_EQ : Joined<["--"], "assert=">, Alias<A>;
4000def _assert : Separate<["--"], "assert">, Alias<A>;
4001def _bootclasspath_EQ : Joined<["--"], "bootclasspath=">, Alias<fbootclasspath_EQ>;
4002def _bootclasspath : Separate<["--"], "bootclasspath">, Alias<fbootclasspath_EQ>;
4003def _classpath_EQ : Joined<["--"], "classpath=">, Alias<fclasspath_EQ>;
4004def _classpath : Separate<["--"], "classpath">, Alias<fclasspath_EQ>;
4005def _comments_in_macros : Flag<["--"], "comments-in-macros">, Alias<CC>;
4006def _comments : Flag<["--"], "comments">, Alias<C>;
4007def _compile : Flag<["--"], "compile">, Alias<c>;
4008def _constant_cfstrings : Flag<["--"], "constant-cfstrings">;
4009def _debug_EQ : Joined<["--"], "debug=">, Alias<g_Flag>;
4010def _debug : Flag<["--"], "debug">, Alias<g_Flag>;
4011def _define_macro_EQ : Joined<["--"], "define-macro=">, Alias<D>;
4012def _define_macro : Separate<["--"], "define-macro">, Alias<D>;
4013def _dependencies : Flag<["--"], "dependencies">, Alias<M>;
4014def _dyld_prefix_EQ : Joined<["--"], "dyld-prefix=">;
4015def _dyld_prefix : Separate<["--"], "dyld-prefix">, Alias<_dyld_prefix_EQ>;
4016def _encoding_EQ : Joined<["--"], "encoding=">, Alias<fencoding_EQ>;
4017def _encoding : Separate<["--"], "encoding">, Alias<fencoding_EQ>;
4018def _entry : Flag<["--"], "entry">, Alias<e>;
4019def _extdirs_EQ : Joined<["--"], "extdirs=">, Alias<fextdirs_EQ>;
4020def _extdirs : Separate<["--"], "extdirs">, Alias<fextdirs_EQ>;
4021def _extra_warnings : Flag<["--"], "extra-warnings">, Alias<W_Joined>;
4022def _for_linker_EQ : Joined<["--"], "for-linker=">, Alias<Xlinker>;
4023def _for_linker : Separate<["--"], "for-linker">, Alias<Xlinker>;
4024def _force_link_EQ : Joined<["--"], "force-link=">, Alias<u>;
4025def _force_link : Separate<["--"], "force-link">, Alias<u>;
4026def _help_hidden : Flag<["--"], "help-hidden">,
4027  HelpText<"Display help for hidden options">;
4028def _imacros_EQ : Joined<["--"], "imacros=">, Alias<imacros>;
4029def _include_barrier : Flag<["--"], "include-barrier">, Alias<I_>;
4030def _include_directory_after_EQ : Joined<["--"], "include-directory-after=">, Alias<idirafter>;
4031def _include_directory_after : Separate<["--"], "include-directory-after">, Alias<idirafter>;
4032def _include_directory_EQ : Joined<["--"], "include-directory=">, Alias<I>;
4033def _include_directory : Separate<["--"], "include-directory">, Alias<I>;
4034def _include_prefix_EQ : Joined<["--"], "include-prefix=">, Alias<iprefix>;
4035def _include_prefix : Separate<["--"], "include-prefix">, Alias<iprefix>;
4036def _include_with_prefix_after_EQ : Joined<["--"], "include-with-prefix-after=">, Alias<iwithprefix>;
4037def _include_with_prefix_after : Separate<["--"], "include-with-prefix-after">, Alias<iwithprefix>;
4038def _include_with_prefix_before_EQ : Joined<["--"], "include-with-prefix-before=">, Alias<iwithprefixbefore>;
4039def _include_with_prefix_before : Separate<["--"], "include-with-prefix-before">, Alias<iwithprefixbefore>;
4040def _include_with_prefix_EQ : Joined<["--"], "include-with-prefix=">, Alias<iwithprefix>;
4041def _include_with_prefix : Separate<["--"], "include-with-prefix">, Alias<iwithprefix>;
4042def _include_EQ : Joined<["--"], "include=">, Alias<include_>;
4043def _language_EQ : Joined<["--"], "language=">, Alias<x>;
4044def _language : Separate<["--"], "language">, Alias<x>;
4045def _library_directory_EQ : Joined<["--"], "library-directory=">, Alias<L>;
4046def _library_directory : Separate<["--"], "library-directory">, Alias<L>;
4047def _no_line_commands : Flag<["--"], "no-line-commands">, Alias<P>;
4048def _no_standard_includes : Flag<["--"], "no-standard-includes">, Alias<nostdinc>;
4049def _no_standard_libraries : Flag<["--"], "no-standard-libraries">, Alias<nostdlib>;
4050def _no_undefined : Flag<["--"], "no-undefined">, Flags<[LinkerInput]>;
4051def _no_warnings : Flag<["--"], "no-warnings">, Alias<w>;
4052def _optimize_EQ : Joined<["--"], "optimize=">, Alias<O>;
4053def _optimize : Flag<["--"], "optimize">, Alias<O>;
4054def _output_class_directory_EQ : Joined<["--"], "output-class-directory=">, Alias<foutput_class_dir_EQ>;
4055def _output_class_directory : Separate<["--"], "output-class-directory">, Alias<foutput_class_dir_EQ>;
4056def _output_EQ : Joined<["--"], "output=">, Alias<o>;
4057def _output : Separate<["--"], "output">, Alias<o>;
4058def _param : Separate<["--"], "param">, Group<CompileOnly_Group>;
4059def _param_EQ : Joined<["--"], "param=">, Alias<_param>;
4060def _precompile : Flag<["--"], "precompile">, Flags<[NoXarchOption]>,
4061  Group<Action_Group>, HelpText<"Only precompile the input">;
4062def _prefix_EQ : Joined<["--"], "prefix=">, Alias<B>;
4063def _prefix : Separate<["--"], "prefix">, Alias<B>;
4064def _preprocess : Flag<["--"], "preprocess">, Alias<E>;
4065def _print_diagnostic_categories : Flag<["--"], "print-diagnostic-categories">;
4066def _print_file_name : Separate<["--"], "print-file-name">, Alias<print_file_name_EQ>;
4067def _print_missing_file_dependencies : Flag<["--"], "print-missing-file-dependencies">, Alias<MG>;
4068def _print_prog_name : Separate<["--"], "print-prog-name">, Alias<print_prog_name_EQ>;
4069def _profile_blocks : Flag<["--"], "profile-blocks">, Alias<a>;
4070def _profile : Flag<["--"], "profile">, Alias<p>;
4071def _resource_EQ : Joined<["--"], "resource=">, Alias<fcompile_resource_EQ>;
4072def _resource : Separate<["--"], "resource">, Alias<fcompile_resource_EQ>;
4073def _rtlib : Separate<["--"], "rtlib">, Alias<rtlib_EQ>;
4074def _serialize_diags : Separate<["-", "--"], "serialize-diagnostics">, Flags<[NoXarchOption]>,
4075  HelpText<"Serialize compiler diagnostics to a file">;
4076// We give --version different semantics from -version.
4077def _version : Flag<["--"], "version">,
4078  Flags<[CoreOption, CC1Option, FC1Option, FlangOption]>,
4079  HelpText<"Print version information">;
4080def _signed_char : Flag<["--"], "signed-char">, Alias<fsigned_char>;
4081def _std : Separate<["--"], "std">, Alias<std_EQ>;
4082def _stdlib : Separate<["--"], "stdlib">, Alias<stdlib_EQ>;
4083def _sysroot_EQ : Joined<["--"], "sysroot=">;
4084def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>;
4085def _target_help : Flag<["--"], "target-help">;
4086def _trace_includes : Flag<["--"], "trace-includes">, Alias<H>;
4087def _undefine_macro_EQ : Joined<["--"], "undefine-macro=">, Alias<U>;
4088def _undefine_macro : Separate<["--"], "undefine-macro">, Alias<U>;
4089def _unsigned_char : Flag<["--"], "unsigned-char">, Alias<funsigned_char>;
4090def _user_dependencies : Flag<["--"], "user-dependencies">, Alias<MM>;
4091def _verbose : Flag<["--"], "verbose">, Alias<v>;
4092def _warn__EQ : Joined<["--"], "warn-=">, Alias<W_Joined>;
4093def _warn_ : Joined<["--"], "warn-">, Alias<W_Joined>;
4094def _write_dependencies : Flag<["--"], "write-dependencies">, Alias<MD>;
4095def _write_user_dependencies : Flag<["--"], "write-user-dependencies">, Alias<MMD>;
4096def _ : Joined<["--"], "">, Flags<[Unsupported]>;
4097
4098// Hexagon feature flags.
4099def mieee_rnd_near : Flag<["-"], "mieee-rnd-near">,
4100  Group<m_hexagon_Features_Group>;
4101def mv5 : Flag<["-"], "mv5">, Group<m_hexagon_Features_Group>, Alias<mcpu_EQ>,
4102  AliasArgs<["hexagonv5"]>;
4103def mv55 : Flag<["-"], "mv55">, Group<m_hexagon_Features_Group>,
4104  Alias<mcpu_EQ>, AliasArgs<["hexagonv55"]>;
4105def mv60 : Flag<["-"], "mv60">, Group<m_hexagon_Features_Group>,
4106  Alias<mcpu_EQ>, AliasArgs<["hexagonv60"]>;
4107def mv62 : Flag<["-"], "mv62">, Group<m_hexagon_Features_Group>,
4108  Alias<mcpu_EQ>, AliasArgs<["hexagonv62"]>;
4109def mv65 : Flag<["-"], "mv65">, Group<m_hexagon_Features_Group>,
4110  Alias<mcpu_EQ>, AliasArgs<["hexagonv65"]>;
4111def mv66 : Flag<["-"], "mv66">, Group<m_hexagon_Features_Group>,
4112  Alias<mcpu_EQ>, AliasArgs<["hexagonv66"]>;
4113def mv67 : Flag<["-"], "mv67">, Group<m_hexagon_Features_Group>,
4114  Alias<mcpu_EQ>, AliasArgs<["hexagonv67"]>;
4115def mv67t : Flag<["-"], "mv67t">, Group<m_hexagon_Features_Group>,
4116  Alias<mcpu_EQ>, AliasArgs<["hexagonv67t"]>;
4117def mv68 : Flag<["-"], "mv68">, Group<m_hexagon_Features_Group>,
4118  Alias<mcpu_EQ>, AliasArgs<["hexagonv68"]>;
4119def mhexagon_hvx : Flag<["-"], "mhvx">, Group<m_hexagon_Features_HVX_Group>,
4120  HelpText<"Enable Hexagon Vector eXtensions">;
4121def mhexagon_hvx_EQ : Joined<["-"], "mhvx=">,
4122  Group<m_hexagon_Features_HVX_Group>,
4123  HelpText<"Enable Hexagon Vector eXtensions">;
4124def mno_hexagon_hvx : Flag<["-"], "mno-hvx">,
4125  Group<m_hexagon_Features_HVX_Group>,
4126  HelpText<"Disable Hexagon Vector eXtensions">;
4127def mhexagon_hvx_length_EQ : Joined<["-"], "mhvx-length=">,
4128  Group<m_hexagon_Features_HVX_Group>, HelpText<"Set Hexagon Vector Length">,
4129  Values<"64B,128B">;
4130def ffixed_r19: Flag<["-"], "ffixed-r19">,
4131  HelpText<"Reserve register r19 (Hexagon only)">;
4132def mmemops : Flag<["-"], "mmemops">, Group<m_hexagon_Features_Group>,
4133  Flags<[CC1Option]>, HelpText<"Enable generation of memop instructions">;
4134def mno_memops : Flag<["-"], "mno-memops">, Group<m_hexagon_Features_Group>,
4135  Flags<[CC1Option]>, HelpText<"Disable generation of memop instructions">;
4136def mpackets : Flag<["-"], "mpackets">, Group<m_hexagon_Features_Group>,
4137  Flags<[CC1Option]>, HelpText<"Enable generation of instruction packets">;
4138def mno_packets : Flag<["-"], "mno-packets">, Group<m_hexagon_Features_Group>,
4139  Flags<[CC1Option]>, HelpText<"Disable generation of instruction packets">;
4140def mnvj : Flag<["-"], "mnvj">, Group<m_hexagon_Features_Group>,
4141  Flags<[CC1Option]>, HelpText<"Enable generation of new-value jumps">;
4142def mno_nvj : Flag<["-"], "mno-nvj">, Group<m_hexagon_Features_Group>,
4143  Flags<[CC1Option]>, HelpText<"Disable generation of new-value jumps">;
4144def mnvs : Flag<["-"], "mnvs">, Group<m_hexagon_Features_Group>,
4145  Flags<[CC1Option]>, HelpText<"Enable generation of new-value stores">;
4146def mno_nvs : Flag<["-"], "mno-nvs">, Group<m_hexagon_Features_Group>,
4147  Flags<[CC1Option]>, HelpText<"Disable generation of new-value stores">;
4148
4149// M68k features flags
4150def m68000 : Flag<["-"], "m68000">, Group<m_m68k_Features_Group>;
4151def m68010 : Flag<["-"], "m68010">, Group<m_m68k_Features_Group>;
4152def m68020 : Flag<["-"], "m68020">, Group<m_m68k_Features_Group>;
4153def m68030 : Flag<["-"], "m68030">, Group<m_m68k_Features_Group>;
4154def m68040 : Flag<["-"], "m68040">, Group<m_m68k_Features_Group>;
4155def m68060 : Flag<["-"], "m68060">, Group<m_m68k_Features_Group>;
4156
4157foreach i = {0-6} in
4158  def ffixed_a#i : Flag<["-"], "ffixed-a"#i>, Group<m_m68k_Features_Group>,
4159    HelpText<"Reserve the a"#i#" register (M68k only)">;
4160foreach i = {0-7} in
4161  def ffixed_d#i : Flag<["-"], "ffixed-d"#i>, Group<m_m68k_Features_Group>,
4162    HelpText<"Reserve the d"#i#" register (M68k only)">;
4163
4164// X86 feature flags
4165def mx87 : Flag<["-"], "mx87">, Group<m_x86_Features_Group>;
4166def mno_x87 : Flag<["-"], "mno-x87">, Group<m_x86_Features_Group>;
4167def m80387 : Flag<["-"], "m80387">, Alias<mx87>;
4168def mno_80387 : Flag<["-"], "mno-80387">, Alias<mno_x87>;
4169def mmmx : Flag<["-"], "mmmx">, Group<m_x86_Features_Group>;
4170def mno_mmx : Flag<["-"], "mno-mmx">, Group<m_x86_Features_Group>;
4171def m3dnow : Flag<["-"], "m3dnow">, Group<m_x86_Features_Group>;
4172def mno_3dnow : Flag<["-"], "mno-3dnow">, Group<m_x86_Features_Group>;
4173def m3dnowa : Flag<["-"], "m3dnowa">, Group<m_x86_Features_Group>;
4174def mno_3dnowa : Flag<["-"], "mno-3dnowa">, Group<m_x86_Features_Group>;
4175def mamx_bf16 : Flag<["-"], "mamx-bf16">, Group<m_x86_Features_Group>;
4176def mno_amx_bf16 : Flag<["-"], "mno-amx-bf16">, Group<m_x86_Features_Group>;
4177def mtamx_int8 : Flag<["-"], "mamx-int8">, Group<m_x86_Features_Group>;
4178def mno_amx_int8 : Flag<["-"], "mno-amx-int8">, Group<m_x86_Features_Group>;
4179def mamx_tile : Flag<["-"], "mamx-tile">, Group<m_x86_Features_Group>;
4180def mno_amx_tile : Flag<["-"], "mno-amx-tile">, Group<m_x86_Features_Group>;
4181def msse : Flag<["-"], "msse">, Group<m_x86_Features_Group>;
4182def mno_sse : Flag<["-"], "mno-sse">, Group<m_x86_Features_Group>;
4183def msse2 : Flag<["-"], "msse2">, Group<m_x86_Features_Group>;
4184def mno_sse2 : Flag<["-"], "mno-sse2">, Group<m_x86_Features_Group>;
4185def msse3 : Flag<["-"], "msse3">, Group<m_x86_Features_Group>;
4186def mno_sse3 : Flag<["-"], "mno-sse3">, Group<m_x86_Features_Group>;
4187def mssse3 : Flag<["-"], "mssse3">, Group<m_x86_Features_Group>;
4188def mno_ssse3 : Flag<["-"], "mno-ssse3">, Group<m_x86_Features_Group>;
4189def msse4_1 : Flag<["-"], "msse4.1">, Group<m_x86_Features_Group>;
4190def mno_sse4_1 : Flag<["-"], "mno-sse4.1">, Group<m_x86_Features_Group>;
4191def msse4_2 : Flag<["-"], "msse4.2">, Group<m_x86_Features_Group>;
4192def mno_sse4_2 : Flag<["-"], "mno-sse4.2">, Group<m_x86_Features_Group>;
4193def msse4 : Flag<["-"], "msse4">, Alias<msse4_2>;
4194// -mno-sse4 turns off sse4.1 which has the effect of turning off everything
4195// later than 4.1. -msse4 turns on 4.2 which has the effect of turning on
4196// everything earlier than 4.2.
4197def mno_sse4 : Flag<["-"], "mno-sse4">, Alias<mno_sse4_1>;
4198def msse4a : Flag<["-"], "msse4a">, Group<m_x86_Features_Group>;
4199def mno_sse4a : Flag<["-"], "mno-sse4a">, Group<m_x86_Features_Group>;
4200def mavx : Flag<["-"], "mavx">, Group<m_x86_Features_Group>;
4201def mno_avx : Flag<["-"], "mno-avx">, Group<m_x86_Features_Group>;
4202def mavx2 : Flag<["-"], "mavx2">, Group<m_x86_Features_Group>;
4203def mno_avx2 : Flag<["-"], "mno-avx2">, Group<m_x86_Features_Group>;
4204def mavx512f : Flag<["-"], "mavx512f">, Group<m_x86_Features_Group>;
4205def mno_avx512f : Flag<["-"], "mno-avx512f">, Group<m_x86_Features_Group>;
4206def mavx512bf16 : Flag<["-"], "mavx512bf16">, Group<m_x86_Features_Group>;
4207def mno_avx512bf16 : Flag<["-"], "mno-avx512bf16">, Group<m_x86_Features_Group>;
4208def mavx512bitalg : Flag<["-"], "mavx512bitalg">, Group<m_x86_Features_Group>;
4209def mno_avx512bitalg : Flag<["-"], "mno-avx512bitalg">, Group<m_x86_Features_Group>;
4210def mavx512bw : Flag<["-"], "mavx512bw">, Group<m_x86_Features_Group>;
4211def mno_avx512bw : Flag<["-"], "mno-avx512bw">, Group<m_x86_Features_Group>;
4212def mavx512cd : Flag<["-"], "mavx512cd">, Group<m_x86_Features_Group>;
4213def mno_avx512cd : Flag<["-"], "mno-avx512cd">, Group<m_x86_Features_Group>;
4214def mavx512dq : Flag<["-"], "mavx512dq">, Group<m_x86_Features_Group>;
4215def mno_avx512dq : Flag<["-"], "mno-avx512dq">, Group<m_x86_Features_Group>;
4216def mavx512er : Flag<["-"], "mavx512er">, Group<m_x86_Features_Group>;
4217def mno_avx512er : Flag<["-"], "mno-avx512er">, Group<m_x86_Features_Group>;
4218def mavx512fp16 : Flag<["-"], "mavx512fp16">, Group<m_x86_Features_Group>;
4219def mno_avx512fp16 : Flag<["-"], "mno-avx512fp16">, Group<m_x86_Features_Group>;
4220def mavx512ifma : Flag<["-"], "mavx512ifma">, Group<m_x86_Features_Group>;
4221def mno_avx512ifma : Flag<["-"], "mno-avx512ifma">, Group<m_x86_Features_Group>;
4222def mavx512pf : Flag<["-"], "mavx512pf">, Group<m_x86_Features_Group>;
4223def mno_avx512pf : Flag<["-"], "mno-avx512pf">, Group<m_x86_Features_Group>;
4224def mavx512vbmi : Flag<["-"], "mavx512vbmi">, Group<m_x86_Features_Group>;
4225def mno_avx512vbmi : Flag<["-"], "mno-avx512vbmi">, Group<m_x86_Features_Group>;
4226def mavx512vbmi2 : Flag<["-"], "mavx512vbmi2">, Group<m_x86_Features_Group>;
4227def mno_avx512vbmi2 : Flag<["-"], "mno-avx512vbmi2">, Group<m_x86_Features_Group>;
4228def mavx512vl : Flag<["-"], "mavx512vl">, Group<m_x86_Features_Group>;
4229def mno_avx512vl : Flag<["-"], "mno-avx512vl">, Group<m_x86_Features_Group>;
4230def mavx512vnni : Flag<["-"], "mavx512vnni">, Group<m_x86_Features_Group>;
4231def mno_avx512vnni : Flag<["-"], "mno-avx512vnni">, Group<m_x86_Features_Group>;
4232def mavx512vpopcntdq : Flag<["-"], "mavx512vpopcntdq">, Group<m_x86_Features_Group>;
4233def mno_avx512vpopcntdq : Flag<["-"], "mno-avx512vpopcntdq">, Group<m_x86_Features_Group>;
4234def mavx512vp2intersect : Flag<["-"], "mavx512vp2intersect">, Group<m_x86_Features_Group>;
4235def mno_avx512vp2intersect : Flag<["-"], "mno-avx512vp2intersect">, Group<m_x86_Features_Group>;
4236def mavxvnni : Flag<["-"], "mavxvnni">, Group<m_x86_Features_Group>;
4237def mno_avxvnni : Flag<["-"], "mno-avxvnni">, Group<m_x86_Features_Group>;
4238def madx : Flag<["-"], "madx">, Group<m_x86_Features_Group>;
4239def mno_adx : Flag<["-"], "mno-adx">, Group<m_x86_Features_Group>;
4240def maes : Flag<["-"], "maes">, Group<m_x86_Features_Group>;
4241def mno_aes : Flag<["-"], "mno-aes">, Group<m_x86_Features_Group>;
4242def mbmi : Flag<["-"], "mbmi">, Group<m_x86_Features_Group>;
4243def mno_bmi : Flag<["-"], "mno-bmi">, Group<m_x86_Features_Group>;
4244def mbmi2 : Flag<["-"], "mbmi2">, Group<m_x86_Features_Group>;
4245def mno_bmi2 : Flag<["-"], "mno-bmi2">, Group<m_x86_Features_Group>;
4246def mcldemote : Flag<["-"], "mcldemote">, Group<m_x86_Features_Group>;
4247def mno_cldemote : Flag<["-"], "mno-cldemote">, Group<m_x86_Features_Group>;
4248def mclflushopt : Flag<["-"], "mclflushopt">, Group<m_x86_Features_Group>;
4249def mno_clflushopt : Flag<["-"], "mno-clflushopt">, Group<m_x86_Features_Group>;
4250def mclwb : Flag<["-"], "mclwb">, Group<m_x86_Features_Group>;
4251def mno_clwb : Flag<["-"], "mno-clwb">, Group<m_x86_Features_Group>;
4252def mwbnoinvd : Flag<["-"], "mwbnoinvd">, Group<m_x86_Features_Group>;
4253def mno_wbnoinvd : Flag<["-"], "mno-wbnoinvd">, Group<m_x86_Features_Group>;
4254def mclzero : Flag<["-"], "mclzero">, Group<m_x86_Features_Group>;
4255def mno_clzero : Flag<["-"], "mno-clzero">, Group<m_x86_Features_Group>;
4256def mcrc32 : Flag<["-"], "mcrc32">, Group<m_x86_Features_Group>;
4257def mno_crc32 : Flag<["-"], "mno-crc32">, Group<m_x86_Features_Group>;
4258def mcx16 : Flag<["-"], "mcx16">, Group<m_x86_Features_Group>;
4259def mno_cx16 : Flag<["-"], "mno-cx16">, Group<m_x86_Features_Group>;
4260def menqcmd : Flag<["-"], "menqcmd">, Group<m_x86_Features_Group>;
4261def mno_enqcmd : Flag<["-"], "mno-enqcmd">, Group<m_x86_Features_Group>;
4262def mf16c : Flag<["-"], "mf16c">, Group<m_x86_Features_Group>;
4263def mno_f16c : Flag<["-"], "mno-f16c">, Group<m_x86_Features_Group>;
4264def mfma : Flag<["-"], "mfma">, Group<m_x86_Features_Group>;
4265def mno_fma : Flag<["-"], "mno-fma">, Group<m_x86_Features_Group>;
4266def mfma4 : Flag<["-"], "mfma4">, Group<m_x86_Features_Group>;
4267def mno_fma4 : Flag<["-"], "mno-fma4">, Group<m_x86_Features_Group>;
4268def mfsgsbase : Flag<["-"], "mfsgsbase">, Group<m_x86_Features_Group>;
4269def mno_fsgsbase : Flag<["-"], "mno-fsgsbase">, Group<m_x86_Features_Group>;
4270def mfxsr : Flag<["-"], "mfxsr">, Group<m_x86_Features_Group>;
4271def mno_fxsr : Flag<["-"], "mno-fxsr">, Group<m_x86_Features_Group>;
4272def minvpcid : Flag<["-"], "minvpcid">, Group<m_x86_Features_Group>;
4273def mno_invpcid : Flag<["-"], "mno-invpcid">, Group<m_x86_Features_Group>;
4274def mgfni : Flag<["-"], "mgfni">, Group<m_x86_Features_Group>;
4275def mno_gfni : Flag<["-"], "mno-gfni">, Group<m_x86_Features_Group>;
4276def mhreset : Flag<["-"], "mhreset">, Group<m_x86_Features_Group>;
4277def mno_hreset : Flag<["-"], "mno-hreset">, Group<m_x86_Features_Group>;
4278def mkl : Flag<["-"], "mkl">, Group<m_x86_Features_Group>;
4279def mno_kl : Flag<["-"], "mno-kl">, Group<m_x86_Features_Group>;
4280def mwidekl : Flag<["-"], "mwidekl">, Group<m_x86_Features_Group>;
4281def mno_widekl : Flag<["-"], "mno-widekl">, Group<m_x86_Features_Group>;
4282def mlwp : Flag<["-"], "mlwp">, Group<m_x86_Features_Group>;
4283def mno_lwp : Flag<["-"], "mno-lwp">, Group<m_x86_Features_Group>;
4284def mlzcnt : Flag<["-"], "mlzcnt">, Group<m_x86_Features_Group>;
4285def mno_lzcnt : Flag<["-"], "mno-lzcnt">, Group<m_x86_Features_Group>;
4286def mmovbe : Flag<["-"], "mmovbe">, Group<m_x86_Features_Group>;
4287def mno_movbe : Flag<["-"], "mno-movbe">, Group<m_x86_Features_Group>;
4288def mmovdiri : Flag<["-"], "mmovdiri">, Group<m_x86_Features_Group>;
4289def mno_movdiri : Flag<["-"], "mno-movdiri">, Group<m_x86_Features_Group>;
4290def mmovdir64b : Flag<["-"], "mmovdir64b">, Group<m_x86_Features_Group>;
4291def mno_movdir64b : Flag<["-"], "mno-movdir64b">, Group<m_x86_Features_Group>;
4292def mmwaitx : Flag<["-"], "mmwaitx">, Group<m_x86_Features_Group>;
4293def mno_mwaitx : Flag<["-"], "mno-mwaitx">, Group<m_x86_Features_Group>;
4294def mpku : Flag<["-"], "mpku">, Group<m_x86_Features_Group>;
4295def mno_pku : Flag<["-"], "mno-pku">, Group<m_x86_Features_Group>;
4296def mpclmul : Flag<["-"], "mpclmul">, Group<m_x86_Features_Group>;
4297def mno_pclmul : Flag<["-"], "mno-pclmul">, Group<m_x86_Features_Group>;
4298def mpconfig : Flag<["-"], "mpconfig">, Group<m_x86_Features_Group>;
4299def mno_pconfig : Flag<["-"], "mno-pconfig">, Group<m_x86_Features_Group>;
4300def mpopcnt : Flag<["-"], "mpopcnt">, Group<m_x86_Features_Group>;
4301def mno_popcnt : Flag<["-"], "mno-popcnt">, Group<m_x86_Features_Group>;
4302def mprefetchwt1 : Flag<["-"], "mprefetchwt1">, Group<m_x86_Features_Group>;
4303def mno_prefetchwt1 : Flag<["-"], "mno-prefetchwt1">, Group<m_x86_Features_Group>;
4304def mprfchw : Flag<["-"], "mprfchw">, Group<m_x86_Features_Group>;
4305def mno_prfchw : Flag<["-"], "mno-prfchw">, Group<m_x86_Features_Group>;
4306def mptwrite : Flag<["-"], "mptwrite">, Group<m_x86_Features_Group>;
4307def mno_ptwrite : Flag<["-"], "mno-ptwrite">, Group<m_x86_Features_Group>;
4308def mrdpid : Flag<["-"], "mrdpid">, Group<m_x86_Features_Group>;
4309def mno_rdpid : Flag<["-"], "mno-rdpid">, Group<m_x86_Features_Group>;
4310def mrdrnd : Flag<["-"], "mrdrnd">, Group<m_x86_Features_Group>;
4311def mno_rdrnd : Flag<["-"], "mno-rdrnd">, Group<m_x86_Features_Group>;
4312def mrtm : Flag<["-"], "mrtm">, Group<m_x86_Features_Group>;
4313def mno_rtm : Flag<["-"], "mno-rtm">, Group<m_x86_Features_Group>;
4314def mrdseed : Flag<["-"], "mrdseed">, Group<m_x86_Features_Group>;
4315def mno_rdseed : Flag<["-"], "mno-rdseed">, Group<m_x86_Features_Group>;
4316def msahf : Flag<["-"], "msahf">, Group<m_x86_Features_Group>;
4317def mno_sahf : Flag<["-"], "mno-sahf">, Group<m_x86_Features_Group>;
4318def mserialize : Flag<["-"], "mserialize">, Group<m_x86_Features_Group>;
4319def mno_serialize : Flag<["-"], "mno-serialize">, Group<m_x86_Features_Group>;
4320def msgx : Flag<["-"], "msgx">, Group<m_x86_Features_Group>;
4321def mno_sgx : Flag<["-"], "mno-sgx">, Group<m_x86_Features_Group>;
4322def msha : Flag<["-"], "msha">, Group<m_x86_Features_Group>;
4323def mno_sha : Flag<["-"], "mno-sha">, Group<m_x86_Features_Group>;
4324def mtbm : Flag<["-"], "mtbm">, Group<m_x86_Features_Group>;
4325def mno_tbm : Flag<["-"], "mno-tbm">, Group<m_x86_Features_Group>;
4326def mtsxldtrk : Flag<["-"], "mtsxldtrk">, Group<m_x86_Features_Group>;
4327def mno_tsxldtrk : Flag<["-"], "mno-tsxldtrk">, Group<m_x86_Features_Group>;
4328def muintr : Flag<["-"], "muintr">, Group<m_x86_Features_Group>;
4329def mno_uintr : Flag<["-"], "mno-uintr">, Group<m_x86_Features_Group>;
4330def mvaes : Flag<["-"], "mvaes">, Group<m_x86_Features_Group>;
4331def mno_vaes : Flag<["-"], "mno-vaes">, Group<m_x86_Features_Group>;
4332def mvpclmulqdq : Flag<["-"], "mvpclmulqdq">, Group<m_x86_Features_Group>;
4333def mno_vpclmulqdq : Flag<["-"], "mno-vpclmulqdq">, Group<m_x86_Features_Group>;
4334def mwaitpkg : Flag<["-"], "mwaitpkg">, Group<m_x86_Features_Group>;
4335def mno_waitpkg : Flag<["-"], "mno-waitpkg">, Group<m_x86_Features_Group>;
4336def mxop : Flag<["-"], "mxop">, Group<m_x86_Features_Group>;
4337def mno_xop : Flag<["-"], "mno-xop">, Group<m_x86_Features_Group>;
4338def mxsave : Flag<["-"], "mxsave">, Group<m_x86_Features_Group>;
4339def mno_xsave : Flag<["-"], "mno-xsave">, Group<m_x86_Features_Group>;
4340def mxsavec : Flag<["-"], "mxsavec">, Group<m_x86_Features_Group>;
4341def mno_xsavec : Flag<["-"], "mno-xsavec">, Group<m_x86_Features_Group>;
4342def mxsaveopt : Flag<["-"], "mxsaveopt">, Group<m_x86_Features_Group>;
4343def mno_xsaveopt : Flag<["-"], "mno-xsaveopt">, Group<m_x86_Features_Group>;
4344def mxsaves : Flag<["-"], "mxsaves">, Group<m_x86_Features_Group>;
4345def mno_xsaves : Flag<["-"], "mno-xsaves">, Group<m_x86_Features_Group>;
4346def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Features_Group>;
4347def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
4348def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
4349def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
4350def mvzeroupper : Flag<["-"], "mvzeroupper">, Group<m_x86_Features_Group>;
4351def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group<m_x86_Features_Group>;
4352
4353// These are legacy user-facing driver-level option spellings. They are always
4354// aliases for options that are spelled using the more common Unix / GNU flag
4355// style of double-dash and equals-joined flags.
4356def target_legacy_spelling : Separate<["-"], "target">, Alias<target>;
4357
4358// Special internal option to handle -Xlinker --no-demangle.
4359def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">,
4360    Flags<[Unsupported, NoArgumentUnused]>;
4361
4362// Special internal option to allow forwarding arbitrary arguments to linker.
4363def Zlinker_input : Separate<["-"], "Zlinker-input">,
4364    Flags<[Unsupported, NoArgumentUnused]>;
4365
4366// Reserved library options.
4367def Z_reserved_lib_stdcxx : Flag<["-"], "Z-reserved-lib-stdc++">,
4368    Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>;
4369def Z_reserved_lib_cckext : Flag<["-"], "Z-reserved-lib-cckext">,
4370    Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>;
4371
4372// Ignored options
4373multiclass BooleanFFlag<string name> {
4374  def f#NAME : Flag<["-"], "f"#name>;
4375  def fno_#NAME : Flag<["-"], "fno-"#name>;
4376}
4377
4378defm : BooleanFFlag<"keep-inline-functions">, Group<clang_ignored_gcc_optimization_f_Group>;
4379
4380def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group<f_Group>;
4381
4382// The default value matches BinutilsVersion in MCAsmInfo.h.
4383def fbinutils_version_EQ : Joined<["-"], "fbinutils-version=">,
4384  MetaVarName<"<major.minor>">, Group<f_Group>, Flags<[CC1Option]>,
4385  HelpText<"Produced object files can use all ELF features supported by this "
4386  "binutils version and newer. If -fno-integrated-as is specified, the "
4387  "generated assembly will consider GNU as support. 'none' means that all ELF "
4388  "features can be used, regardless of binutils support. Defaults to 2.26.">;
4389def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>, Flags<[CoreOption, LinkOption]>;
4390def ld_path_EQ : Joined<["--"], "ld-path=">, Group<Link_Group>;
4391
4392defm align_labels : BooleanFFlag<"align-labels">, Group<clang_ignored_gcc_optimization_f_Group>;
4393def falign_labels_EQ : Joined<["-"], "falign-labels=">, Group<clang_ignored_gcc_optimization_f_Group>;
4394defm align_loops : BooleanFFlag<"align-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
4395defm align_jumps : BooleanFFlag<"align-jumps">, Group<clang_ignored_gcc_optimization_f_Group>;
4396def falign_jumps_EQ : Joined<["-"], "falign-jumps=">, Group<clang_ignored_gcc_optimization_f_Group>;
4397
4398// FIXME: This option should be supported and wired up to our diognostics, but
4399// ignore it for now to avoid breaking builds that use it.
4400def fdiagnostics_show_location_EQ : Joined<["-"], "fdiagnostics-show-location=">, Group<clang_ignored_f_Group>;
4401
4402defm fcheck_new : BooleanFFlag<"check-new">, Group<clang_ignored_f_Group>;
4403defm caller_saves : BooleanFFlag<"caller-saves">, Group<clang_ignored_gcc_optimization_f_Group>;
4404defm reorder_blocks : BooleanFFlag<"reorder-blocks">, Group<clang_ignored_gcc_optimization_f_Group>;
4405defm branch_count_reg : BooleanFFlag<"branch-count-reg">, Group<clang_ignored_gcc_optimization_f_Group>;
4406defm default_inline : BooleanFFlag<"default-inline">, Group<clang_ignored_gcc_optimization_f_Group>;
4407defm fat_lto_objects : BooleanFFlag<"fat-lto-objects">, Group<clang_ignored_gcc_optimization_f_Group>;
4408defm float_store : BooleanFFlag<"float-store">, Group<clang_ignored_gcc_optimization_f_Group>;
4409defm friend_injection : BooleanFFlag<"friend-injection">, Group<clang_ignored_f_Group>;
4410defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group<clang_ignored_f_Group>;
4411defm gcse : BooleanFFlag<"gcse">, Group<clang_ignored_gcc_optimization_f_Group>;
4412defm gcse_after_reload: BooleanFFlag<"gcse-after-reload">, Group<clang_ignored_gcc_optimization_f_Group>;
4413defm gcse_las: BooleanFFlag<"gcse-las">, Group<clang_ignored_gcc_optimization_f_Group>;
4414defm gcse_sm: BooleanFFlag<"gcse-sm">, Group<clang_ignored_gcc_optimization_f_Group>;
4415defm gnu : BooleanFFlag<"gnu">, Group<clang_ignored_f_Group>;
4416defm implicit_templates : BooleanFFlag<"implicit-templates">, Group<clang_ignored_f_Group>;
4417defm implement_inlines : BooleanFFlag<"implement-inlines">, Group<clang_ignored_f_Group>;
4418defm merge_constants : BooleanFFlag<"merge-constants">, Group<clang_ignored_gcc_optimization_f_Group>;
4419defm modulo_sched : BooleanFFlag<"modulo-sched">, Group<clang_ignored_gcc_optimization_f_Group>;
4420defm modulo_sched_allow_regmoves : BooleanFFlag<"modulo-sched-allow-regmoves">,
4421    Group<clang_ignored_gcc_optimization_f_Group>;
4422defm inline_functions_called_once : BooleanFFlag<"inline-functions-called-once">,
4423    Group<clang_ignored_gcc_optimization_f_Group>;
4424def finline_limit_EQ : Joined<["-"], "finline-limit=">, Group<clang_ignored_gcc_optimization_f_Group>;
4425defm finline_limit : BooleanFFlag<"inline-limit">, Group<clang_ignored_gcc_optimization_f_Group>;
4426defm inline_small_functions : BooleanFFlag<"inline-small-functions">,
4427    Group<clang_ignored_gcc_optimization_f_Group>;
4428defm ipa_cp : BooleanFFlag<"ipa-cp">,
4429    Group<clang_ignored_gcc_optimization_f_Group>;
4430defm ivopts : BooleanFFlag<"ivopts">, Group<clang_ignored_gcc_optimization_f_Group>;
4431defm semantic_interposition : BoolFOption<"semantic-interposition",
4432  LangOpts<"SemanticInterposition">, DefaultFalse,
4433  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>>;
4434defm non_call_exceptions : BooleanFFlag<"non-call-exceptions">, Group<clang_ignored_f_Group>;
4435defm peel_loops : BooleanFFlag<"peel-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
4436defm permissive : BooleanFFlag<"permissive">, Group<clang_ignored_f_Group>;
4437defm prefetch_loop_arrays : BooleanFFlag<"prefetch-loop-arrays">, Group<clang_ignored_gcc_optimization_f_Group>;
4438defm printf : BooleanFFlag<"printf">, Group<clang_ignored_f_Group>;
4439defm profile : BooleanFFlag<"profile">, Group<clang_ignored_f_Group>;
4440defm profile_correction : BooleanFFlag<"profile-correction">, Group<clang_ignored_gcc_optimization_f_Group>;
4441defm profile_generate_sampling : BooleanFFlag<"profile-generate-sampling">, Group<clang_ignored_f_Group>;
4442defm profile_reusedist : BooleanFFlag<"profile-reusedist">, Group<clang_ignored_f_Group>;
4443defm profile_values : BooleanFFlag<"profile-values">, Group<clang_ignored_gcc_optimization_f_Group>;
4444defm regs_graph : BooleanFFlag<"regs-graph">, Group<clang_ignored_f_Group>;
4445defm rename_registers : BooleanFFlag<"rename-registers">, Group<clang_ignored_gcc_optimization_f_Group>;
4446defm ripa : BooleanFFlag<"ripa">, Group<clang_ignored_f_Group>;
4447defm schedule_insns : BooleanFFlag<"schedule-insns">, Group<clang_ignored_gcc_optimization_f_Group>;
4448defm schedule_insns2 : BooleanFFlag<"schedule-insns2">, Group<clang_ignored_gcc_optimization_f_Group>;
4449defm see : BooleanFFlag<"see">, Group<clang_ignored_f_Group>;
4450defm signaling_nans : BooleanFFlag<"signaling-nans">, Group<clang_ignored_gcc_optimization_f_Group>;
4451defm single_precision_constant : BooleanFFlag<"single-precision-constant">,
4452    Group<clang_ignored_gcc_optimization_f_Group>;
4453defm spec_constr_count : BooleanFFlag<"spec-constr-count">, Group<clang_ignored_f_Group>;
4454defm stack_check : BooleanFFlag<"stack-check">, Group<clang_ignored_f_Group>;
4455defm strength_reduce :
4456    BooleanFFlag<"strength-reduce">, Group<clang_ignored_gcc_optimization_f_Group>;
4457defm tls_model : BooleanFFlag<"tls-model">, Group<clang_ignored_f_Group>;
4458defm tracer : BooleanFFlag<"tracer">, Group<clang_ignored_gcc_optimization_f_Group>;
4459defm tree_dce : BooleanFFlag<"tree-dce">, Group<clang_ignored_gcc_optimization_f_Group>;
4460defm tree_salias : BooleanFFlag<"tree-salias">, Group<clang_ignored_f_Group>;
4461defm tree_ter : BooleanFFlag<"tree-ter">, Group<clang_ignored_gcc_optimization_f_Group>;
4462defm tree_vectorizer_verbose : BooleanFFlag<"tree-vectorizer-verbose">, Group<clang_ignored_f_Group>;
4463defm tree_vrp : BooleanFFlag<"tree-vrp">, Group<clang_ignored_gcc_optimization_f_Group>;
4464defm unroll_all_loops : BooleanFFlag<"unroll-all-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
4465defm unsafe_loop_optimizations : BooleanFFlag<"unsafe-loop-optimizations">,
4466    Group<clang_ignored_gcc_optimization_f_Group>;
4467defm unswitch_loops : BooleanFFlag<"unswitch-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
4468defm use_linker_plugin : BooleanFFlag<"use-linker-plugin">, Group<clang_ignored_gcc_optimization_f_Group>;
4469defm vect_cost_model : BooleanFFlag<"vect-cost-model">, Group<clang_ignored_gcc_optimization_f_Group>;
4470defm variable_expansion_in_unroller : BooleanFFlag<"variable-expansion-in-unroller">,
4471    Group<clang_ignored_gcc_optimization_f_Group>;
4472defm web : BooleanFFlag<"web">, Group<clang_ignored_gcc_optimization_f_Group>;
4473defm whole_program : BooleanFFlag<"whole-program">, Group<clang_ignored_gcc_optimization_f_Group>;
4474defm devirtualize : BooleanFFlag<"devirtualize">, Group<clang_ignored_gcc_optimization_f_Group>;
4475defm devirtualize_speculatively : BooleanFFlag<"devirtualize-speculatively">,
4476    Group<clang_ignored_gcc_optimization_f_Group>;
4477
4478// Generic gfortran options.
4479def A_DASH : Joined<["-"], "A-">, Group<gfortran_Group>;
4480def static_libgfortran : Flag<["-"], "static-libgfortran">, Group<gfortran_Group>;
4481
4482// "f" options with values for gfortran.
4483def fblas_matmul_limit_EQ : Joined<["-"], "fblas-matmul-limit=">, Group<gfortran_Group>;
4484def fcheck_EQ : Joined<["-"], "fcheck=">, Group<gfortran_Group>;
4485def fcoarray_EQ : Joined<["-"], "fcoarray=">, Group<gfortran_Group>;
4486def fconvert_EQ : Joined<["-"], "fconvert=">, Group<gfortran_Group>;
4487def ffpe_trap_EQ : Joined<["-"], "ffpe-trap=">, Group<gfortran_Group>;
4488def ffree_line_length_VALUE : Joined<["-"], "ffree-line-length-">, Group<gfortran_Group>;
4489def finit_character_EQ : Joined<["-"], "finit-character=">, Group<gfortran_Group>;
4490def finit_integer_EQ : Joined<["-"], "finit-integer=">, Group<gfortran_Group>;
4491def finit_logical_EQ : Joined<["-"], "finit-logical=">, Group<gfortran_Group>;
4492def finit_real_EQ : Joined<["-"], "finit-real=">, Group<gfortran_Group>;
4493def fmax_array_constructor_EQ : Joined<["-"], "fmax-array-constructor=">, Group<gfortran_Group>;
4494def fmax_errors_EQ : Joined<["-"], "fmax-errors=">, Group<gfortran_Group>;
4495def fmax_stack_var_size_EQ : Joined<["-"], "fmax-stack-var-size=">, Group<gfortran_Group>;
4496def fmax_subrecord_length_EQ : Joined<["-"], "fmax-subrecord-length=">, Group<gfortran_Group>;
4497def frecord_marker_EQ : Joined<["-"], "frecord-marker=">, Group<gfortran_Group>;
4498
4499// "f" flags for gfortran.
4500defm aggressive_function_elimination : BooleanFFlag<"aggressive-function-elimination">, Group<gfortran_Group>;
4501defm align_commons : BooleanFFlag<"align-commons">, Group<gfortran_Group>;
4502defm all_intrinsics : BooleanFFlag<"all-intrinsics">, Group<gfortran_Group>;
4503defm automatic : BooleanFFlag<"automatic">, Group<gfortran_Group>;
4504defm backtrace : BooleanFFlag<"backtrace">, Group<gfortran_Group>;
4505defm bounds_check : BooleanFFlag<"bounds-check">, Group<gfortran_Group>;
4506defm check_array_temporaries : BooleanFFlag<"check-array-temporaries">, Group<gfortran_Group>;
4507defm cray_pointer : BooleanFFlag<"cray-pointer">, Group<gfortran_Group>;
4508defm d_lines_as_code : BooleanFFlag<"d-lines-as-code">, Group<gfortran_Group>;
4509defm d_lines_as_comments : BooleanFFlag<"d-lines-as-comments">, Group<gfortran_Group>;
4510defm dollar_ok : BooleanFFlag<"dollar-ok">, Group<gfortran_Group>;
4511defm dump_fortran_optimized : BooleanFFlag<"dump-fortran-optimized">, Group<gfortran_Group>;
4512defm dump_fortran_original : BooleanFFlag<"dump-fortran-original">, Group<gfortran_Group>;
4513defm dump_parse_tree : BooleanFFlag<"dump-parse-tree">, Group<gfortran_Group>;
4514defm external_blas : BooleanFFlag<"external-blas">, Group<gfortran_Group>;
4515defm f2c : BooleanFFlag<"f2c">, Group<gfortran_Group>;
4516defm frontend_optimize : BooleanFFlag<"frontend-optimize">, Group<gfortran_Group>;
4517defm init_local_zero : BooleanFFlag<"init-local-zero">, Group<gfortran_Group>;
4518defm integer_4_integer_8 : BooleanFFlag<"integer-4-integer-8">, Group<gfortran_Group>;
4519defm max_identifier_length : BooleanFFlag<"max-identifier-length">, Group<gfortran_Group>;
4520defm module_private : BooleanFFlag<"module-private">, Group<gfortran_Group>;
4521defm pack_derived : BooleanFFlag<"pack-derived">, Group<gfortran_Group>;
4522//defm protect_parens : BooleanFFlag<"protect-parens">, Group<gfortran_Group>;
4523defm range_check : BooleanFFlag<"range-check">, Group<gfortran_Group>;
4524defm real_4_real_10 : BooleanFFlag<"real-4-real-10">, Group<gfortran_Group>;
4525defm real_4_real_16 : BooleanFFlag<"real-4-real-16">, Group<gfortran_Group>;
4526defm real_4_real_8 : BooleanFFlag<"real-4-real-8">, Group<gfortran_Group>;
4527defm real_8_real_10 : BooleanFFlag<"real-8-real-10">, Group<gfortran_Group>;
4528defm real_8_real_16 : BooleanFFlag<"real-8-real-16">, Group<gfortran_Group>;
4529defm real_8_real_4 : BooleanFFlag<"real-8-real-4">, Group<gfortran_Group>;
4530defm realloc_lhs : BooleanFFlag<"realloc-lhs">, Group<gfortran_Group>;
4531defm recursive : BooleanFFlag<"recursive">, Group<gfortran_Group>;
4532defm repack_arrays : BooleanFFlag<"repack-arrays">, Group<gfortran_Group>;
4533defm second_underscore : BooleanFFlag<"second-underscore">, Group<gfortran_Group>;
4534defm sign_zero : BooleanFFlag<"sign-zero">, Group<gfortran_Group>;
4535defm stack_arrays : BooleanFFlag<"stack-arrays">, Group<gfortran_Group>;
4536defm underscoring : BooleanFFlag<"underscoring">, Group<gfortran_Group>;
4537defm whole_file : BooleanFFlag<"whole-file">, Group<gfortran_Group>;
4538
4539// C++ SYCL options
4540def fsycl : Flag<["-"], "fsycl">, Flags<[NoXarchOption, CoreOption]>,
4541  Group<sycl_Group>, HelpText<"Enables SYCL kernels compilation for device">;
4542def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>,
4543  Group<sycl_Group>, HelpText<"Disables SYCL kernels compilation for device">;
4544
4545//===----------------------------------------------------------------------===//
4546// FLangOption + CoreOption + NoXarchOption
4547//===----------------------------------------------------------------------===//
4548let Flags = [FlangOption, FlangOnlyOption, NoXarchOption, CoreOption] in {
4549def Xflang : Separate<["-"], "Xflang">,
4550  HelpText<"Pass <arg> to the flang compiler">, MetaVarName<"<arg>">,
4551  Flags<[NoXarchOption, CoreOption]>, Group<CompileOnly_Group>;
4552}
4553
4554//===----------------------------------------------------------------------===//
4555// FlangOption and FC1 Options
4556//===----------------------------------------------------------------------===//
4557let Flags = [FC1Option, FlangOption, FlangOnlyOption] in {
4558
4559def cpp : Flag<["-"], "cpp">, Group<f_Group>,
4560  HelpText<"Enable predefined and command line preprocessor macros">;
4561def nocpp : Flag<["-"], "nocpp">, Group<f_Group>,
4562  HelpText<"Disable predefined and command line preprocessor macros">;
4563def module_dir : Separate<["-"], "module-dir">, MetaVarName<"<dir>">,
4564  HelpText<"Put MODULE files in <dir>">,
4565  DocBrief<[{This option specifies where to put .mod files for compiled modules.
4566It is also added to the list of directories to be searched by an USE statement.
4567The default is the current directory.}]>;
4568
4569def ffixed_form : Flag<["-"], "ffixed-form">, Group<f_Group>,
4570  HelpText<"Process source files in fixed form">;
4571def ffree_form : Flag<["-"], "ffree-form">, Group<f_Group>,
4572  HelpText<"Process source files in free form">;
4573def ffixed_line_length_EQ : Joined<["-"], "ffixed-line-length=">, Group<f_Group>,
4574  HelpText<"Use <value> as character line width in fixed mode">,
4575  DocBrief<[{Set column after which characters are ignored in typical fixed-form lines in the source
4576file}]>;
4577def ffixed_line_length_VALUE : Joined<["-"], "ffixed-line-length-">, Group<f_Group>, Alias<ffixed_line_length_EQ>;
4578def fopenacc : Flag<["-"], "fopenacc">, Group<f_Group>,
4579  HelpText<"Enable OpenACC">;
4580def fdefault_double_8 : Flag<["-"],"fdefault-double-8">, Group<f_Group>,
4581  HelpText<"Set the default double precision kind to an 8 byte wide type">;
4582def fdefault_integer_8 : Flag<["-"],"fdefault-integer-8">, Group<f_Group>,
4583  HelpText<"Set the default integer kind to an 8 byte wide type">;
4584def fdefault_real_8 : Flag<["-"],"fdefault-real-8">, Group<f_Group>,
4585  HelpText<"Set the default real kind to an 8 byte wide type">;
4586def flarge_sizes : Flag<["-"],"flarge-sizes">, Group<f_Group>,
4587  HelpText<"Use INTEGER(KIND=8) for the result type in size-related intrinsics">;
4588
4589def falternative_parameter_statement : Flag<["-"], "falternative-parameter-statement">, Group<f_Group>,
4590  HelpText<"Enable the old style PARAMETER statement">;
4591def fintrinsic_modules_path : Separate<["-"], "fintrinsic-modules-path">,  Group<f_Group>, MetaVarName<"<dir>">,
4592  HelpText<"Specify where to find the compiled intrinsic modules">,
4593  DocBrief<[{This option specifies the location of pre-compiled intrinsic modules,
4594  if they are not in the default location expected by the compiler.}]>;
4595
4596defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string introduces an escape character">;
4597defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">;
4598defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">;
4599defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">;
4600}
4601
4602def J : JoinedOrSeparate<["-"], "J">,
4603  Flags<[RenderJoined, FlangOption, FC1Option, FlangOnlyOption]>,
4604  Group<gfortran_Group>,
4605  Alias<module_dir>;
4606
4607//===----------------------------------------------------------------------===//
4608// FC1 Options
4609//===----------------------------------------------------------------------===//
4610let Flags = [FC1Option, FlangOnlyOption] in {
4611
4612def fget_definition : MultiArg<["-"], "fget-definition", 3>,
4613  HelpText<"Get the symbol definition from <line> <start-column> <end-column>">,
4614  Group<Action_Group>;
4615def test_io : Flag<["-"], "test-io">, Group<Action_Group>,
4616  HelpText<"Run the InputOuputTest action. Use for development and testing only.">;
4617def fdebug_unparse_no_sema : Flag<["-"], "fdebug-unparse-no-sema">, Group<Action_Group>,
4618  HelpText<"Unparse and stop (skips the semantic checks)">,
4619  DocBrief<[{Only run the parser, then unparse the parse-tree and output the
4620generated Fortran source file. Semantic checks are disabled.}]>;
4621def fdebug_unparse : Flag<["-"], "fdebug-unparse">, Group<Action_Group>,
4622  HelpText<"Unparse and stop.">,
4623  DocBrief<[{Run the parser and the semantic checks. Then unparse the
4624parse-tree and output the generated Fortran source file.}]>;
4625def fdebug_unparse_with_symbols : Flag<["-"], "fdebug-unparse-with-symbols">, Group<Action_Group>,
4626  HelpText<"Unparse and stop.">;
4627def fdebug_dump_symbols : Flag<["-"], "fdebug-dump-symbols">, Group<Action_Group>,
4628  HelpText<"Dump symbols after the semantic analysis">;
4629def fdebug_dump_parse_tree : Flag<["-"], "fdebug-dump-parse-tree">, Group<Action_Group>,
4630  HelpText<"Dump the parse tree">,
4631  DocBrief<[{Run the Parser and the semantic checks, and then output the
4632parse tree.}]>;
4633def fdebug_dump_parse_tree_no_sema : Flag<["-"], "fdebug-dump-parse-tree-no-sema">, Group<Action_Group>,
4634  HelpText<"Dump the parse tree (skips the semantic checks)">,
4635  DocBrief<[{Run the Parser and then output the parse tree. Semantic
4636checks are disabled.}]>;
4637def fdebug_dump_all : Flag<["-"], "fdebug-dump-all">, Group<Action_Group>,
4638  HelpText<"Dump symbols and the parse tree after the semantic checks">;
4639def fdebug_dump_provenance : Flag<["-"], "fdebug-dump-provenance">, Group<Action_Group>,
4640  HelpText<"Dump provenance">;
4641def fdebug_dump_parsing_log : Flag<["-"], "fdebug-dump-parsing-log">, Group<Action_Group>,
4642  HelpText<"Run instrumented parse and dump the parsing log">;
4643def fdebug_measure_parse_tree : Flag<["-"], "fdebug-measure-parse-tree">, Group<Action_Group>,
4644  HelpText<"Measure the parse tree">;
4645def fdebug_pre_fir_tree : Flag<["-"], "fdebug-pre-fir-tree">, Group<Action_Group>,
4646  HelpText<"Dump the pre-FIR tree">;
4647def fdebug_module_writer : Flag<["-"],"fdebug-module-writer">,
4648  HelpText<"Enable debug messages while writing module files">;
4649def fget_symbols_sources : Flag<["-"], "fget-symbols-sources">, Group<Action_Group>,
4650  HelpText<"Dump symbols and their source code locations">;
4651
4652def module_suffix : Separate<["-"], "module-suffix">,  Group<f_Group>, MetaVarName<"<suffix>">,
4653  HelpText<"Use <suffix> as the suffix for module files (the default value is `.mod`)">;
4654def fno_reformat : Flag<["-"], "fno-reformat">, Group<Preprocessor_Group>,
4655  HelpText<"Dump the cooked character stream in -E mode">;
4656defm analyzed_objects_for_unparse : OptOutFC1FFlag<"analyzed-objects-for-unparse", "", "Do not use the analyzed objects when unparsing">;
4657
4658}
4659
4660//===----------------------------------------------------------------------===//
4661// CC1 Options
4662//===----------------------------------------------------------------------===//
4663
4664let Flags = [CC1Option, NoDriverOption] in {
4665
4666//===----------------------------------------------------------------------===//
4667// Target Options
4668//===----------------------------------------------------------------------===//
4669
4670let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
4671
4672def target_cpu : Separate<["-"], "target-cpu">,
4673  HelpText<"Target a specific cpu type">,
4674  MarshallingInfoString<TargetOpts<"CPU">>;
4675def tune_cpu : Separate<["-"], "tune-cpu">,
4676  HelpText<"Tune for a specific cpu type">,
4677  MarshallingInfoString<TargetOpts<"TuneCPU">>;
4678def target_feature : Separate<["-"], "target-feature">,
4679  HelpText<"Target specific attributes">,
4680  MarshallingInfoStringVector<TargetOpts<"FeaturesAsWritten">>;
4681def triple : Separate<["-"], "triple">,
4682  HelpText<"Specify target triple (e.g. i686-apple-darwin9)">,
4683  MarshallingInfoString<TargetOpts<"Triple">, "llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple())">,
4684  AlwaysEmit, Normalizer<"normalizeTriple">;
4685def target_abi : Separate<["-"], "target-abi">,
4686  HelpText<"Target a particular ABI type">,
4687  MarshallingInfoString<TargetOpts<"ABI">>;
4688def target_sdk_version_EQ : Joined<["-"], "target-sdk-version=">,
4689  HelpText<"The version of target SDK used for compilation">;
4690
4691}
4692
4693def target_linker_version : Separate<["-"], "target-linker-version">,
4694  HelpText<"Target linker version">,
4695  MarshallingInfoString<TargetOpts<"LinkerVersion">>;
4696def triple_EQ : Joined<["-"], "triple=">, Alias<triple>;
4697def mfpmath : Separate<["-"], "mfpmath">,
4698  HelpText<"Which unit to use for fp math">,
4699  MarshallingInfoString<TargetOpts<"FPMath">>;
4700
4701defm padding_on_unsigned_fixed_point : BoolOption<"f", "padding-on-unsigned-fixed-point",
4702  LangOpts<"PaddingOnUnsignedFixedPoint">, DefaultFalse,
4703  PosFlag<SetTrue, [], "Force each unsigned fixed point type to have an extra bit of padding to align their scales with those of signed fixed point types">,
4704  NegFlag<SetFalse>>,
4705  ShouldParseIf<ffixed_point.KeyPath>;
4706
4707//===----------------------------------------------------------------------===//
4708// Analyzer Options
4709//===----------------------------------------------------------------------===//
4710
4711def analysis_UnoptimizedCFG : Flag<["-"], "unoptimized-cfg">,
4712  HelpText<"Generate unoptimized CFGs for all analyses">,
4713  MarshallingInfoFlag<AnalyzerOpts<"UnoptimizedCFG">>;
4714def analysis_CFGAddImplicitDtors : Flag<["-"], "cfg-add-implicit-dtors">,
4715  HelpText<"Add C++ implicit destructors to CFGs for all analyses">;
4716
4717def analyzer_store : Separate<["-"], "analyzer-store">,
4718  HelpText<"Source Code Analysis - Abstract Memory Store Models">;
4719def analyzer_store_EQ : Joined<["-"], "analyzer-store=">, Alias<analyzer_store>;
4720
4721def analyzer_constraints : Separate<["-"], "analyzer-constraints">,
4722  HelpText<"Source Code Analysis - Symbolic Constraint Engines">;
4723def analyzer_constraints_EQ : Joined<["-"], "analyzer-constraints=">,
4724  Alias<analyzer_constraints>;
4725
4726def analyzer_output : Separate<["-"], "analyzer-output">,
4727  HelpText<"Source Code Analysis - Output Options">;
4728def analyzer_output_EQ : Joined<["-"], "analyzer-output=">,
4729  Alias<analyzer_output>;
4730
4731def analyzer_purge : Separate<["-"], "analyzer-purge">,
4732  HelpText<"Source Code Analysis - Dead Symbol Removal Frequency">;
4733def analyzer_purge_EQ : Joined<["-"], "analyzer-purge=">, Alias<analyzer_purge>;
4734
4735def analyzer_opt_analyze_headers : Flag<["-"], "analyzer-opt-analyze-headers">,
4736  HelpText<"Force the static analyzer to analyze functions defined in header files">,
4737  MarshallingInfoFlag<AnalyzerOpts<"AnalyzeAll">>;
4738def analyzer_opt_analyze_nested_blocks : Flag<["-"], "analyzer-opt-analyze-nested-blocks">,
4739  HelpText<"Analyze the definitions of blocks in addition to functions">,
4740  MarshallingInfoFlag<AnalyzerOpts<"AnalyzeNestedBlocks">>;
4741def analyzer_display_progress : Flag<["-"], "analyzer-display-progress">,
4742  HelpText<"Emit verbose output about the analyzer's progress">,
4743  MarshallingInfoFlag<AnalyzerOpts<"AnalyzerDisplayProgress">>;
4744def analyze_function : Separate<["-"], "analyze-function">,
4745  HelpText<"Run analysis on specific function (for C++ include parameters in name)">,
4746  MarshallingInfoString<AnalyzerOpts<"AnalyzeSpecificFunction">>;
4747def analyze_function_EQ : Joined<["-"], "analyze-function=">, Alias<analyze_function>;
4748def trim_egraph : Flag<["-"], "trim-egraph">,
4749  HelpText<"Only show error-related paths in the analysis graph">,
4750  MarshallingInfoFlag<AnalyzerOpts<"TrimGraph">>;
4751def analyzer_viz_egraph_graphviz : Flag<["-"], "analyzer-viz-egraph-graphviz">,
4752  HelpText<"Display exploded graph using GraphViz">,
4753  MarshallingInfoFlag<AnalyzerOpts<"visualizeExplodedGraphWithGraphViz">>;
4754def analyzer_dump_egraph : Separate<["-"], "analyzer-dump-egraph">,
4755  HelpText<"Dump exploded graph to the specified file">,
4756  MarshallingInfoString<AnalyzerOpts<"DumpExplodedGraphTo">>;
4757def analyzer_dump_egraph_EQ : Joined<["-"], "analyzer-dump-egraph=">, Alias<analyzer_dump_egraph>;
4758
4759def analyzer_inline_max_stack_depth : Separate<["-"], "analyzer-inline-max-stack-depth">,
4760  HelpText<"Bound on stack depth while inlining (4 by default)">,
4761  // Cap the stack depth at 4 calls (5 stack frames, base + 4 calls).
4762  MarshallingInfoInt<AnalyzerOpts<"InlineMaxStackDepth">, "5">;
4763def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">,
4764  Alias<analyzer_inline_max_stack_depth>;
4765
4766def analyzer_inlining_mode : Separate<["-"], "analyzer-inlining-mode">,
4767  HelpText<"Specify the function selection heuristic used during inlining">;
4768def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>;
4769
4770def analyzer_disable_retry_exhausted : Flag<["-"], "analyzer-disable-retry-exhausted">,
4771  HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">,
4772  MarshallingInfoFlag<AnalyzerOpts<"NoRetryExhausted">>;
4773
4774def analyzer_max_loop : Separate<["-"], "analyzer-max-loop">,
4775  HelpText<"The maximum number of times the analyzer will go through a loop">,
4776  MarshallingInfoInt<AnalyzerOpts<"maxBlockVisitOnPath">, "4">;
4777def analyzer_stats : Flag<["-"], "analyzer-stats">,
4778  HelpText<"Print internal analyzer statistics.">,
4779  MarshallingInfoFlag<AnalyzerOpts<"PrintStats">>;
4780
4781def analyzer_checker : Separate<["-"], "analyzer-checker">,
4782  HelpText<"Choose analyzer checkers to enable">,
4783  ValuesCode<[{
4784    const char *Values =
4785    #define GET_CHECKERS
4786    #define CHECKER(FULLNAME, CLASS, HT, DOC_URI, IS_HIDDEN)  FULLNAME ","
4787    #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
4788    #undef GET_CHECKERS
4789    #define GET_PACKAGES
4790    #define PACKAGE(FULLNAME)  FULLNAME ","
4791    #include "clang/StaticAnalyzer/Checkers/Checkers.inc"
4792    #undef GET_PACKAGES
4793    ;
4794  }]>;
4795def analyzer_checker_EQ : Joined<["-"], "analyzer-checker=">,
4796  Alias<analyzer_checker>;
4797
4798def analyzer_disable_checker : Separate<["-"], "analyzer-disable-checker">,
4799  HelpText<"Choose analyzer checkers to disable">;
4800def analyzer_disable_checker_EQ : Joined<["-"], "analyzer-disable-checker=">,
4801  Alias<analyzer_disable_checker>;
4802
4803def analyzer_disable_all_checks : Flag<["-"], "analyzer-disable-all-checks">,
4804  HelpText<"Disable all static analyzer checks">,
4805  MarshallingInfoFlag<AnalyzerOpts<"DisableAllCheckers">>;
4806
4807def analyzer_checker_help : Flag<["-"], "analyzer-checker-help">,
4808  HelpText<"Display the list of analyzer checkers that are available">,
4809  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelp">>;
4810
4811def analyzer_checker_help_alpha : Flag<["-"], "analyzer-checker-help-alpha">,
4812  HelpText<"Display the list of in development analyzer checkers. These "
4813           "are NOT considered safe, they are unstable and will emit incorrect "
4814           "reports. Enable ONLY FOR DEVELOPMENT purposes">,
4815  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelpAlpha">>;
4816
4817def analyzer_checker_help_developer : Flag<["-"], "analyzer-checker-help-developer">,
4818  HelpText<"Display the list of developer-only checkers such as modeling "
4819           "and debug checkers">,
4820  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerHelpDeveloper">>;
4821
4822def analyzer_config_help : Flag<["-"], "analyzer-config-help">,
4823  HelpText<"Display the list of -analyzer-config options. These are meant for "
4824           "development purposes only!">,
4825  MarshallingInfoFlag<AnalyzerOpts<"ShowConfigOptionsList">>;
4826
4827def analyzer_list_enabled_checkers : Flag<["-"], "analyzer-list-enabled-checkers">,
4828  HelpText<"Display the list of enabled analyzer checkers">,
4829  MarshallingInfoFlag<AnalyzerOpts<"ShowEnabledCheckerList">>;
4830
4831def analyzer_config : Separate<["-"], "analyzer-config">,
4832  HelpText<"Choose analyzer options to enable">;
4833
4834def analyzer_checker_option_help : Flag<["-"], "analyzer-checker-option-help">,
4835  HelpText<"Display the list of checker and package options">,
4836  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionList">>;
4837
4838def analyzer_checker_option_help_alpha : Flag<["-"], "analyzer-checker-option-help-alpha">,
4839  HelpText<"Display the list of in development checker and package options. "
4840           "These are NOT considered safe, they are unstable and will emit "
4841           "incorrect reports. Enable ONLY FOR DEVELOPMENT purposes">,
4842  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionAlphaList">>;
4843
4844def analyzer_checker_option_help_developer : Flag<["-"], "analyzer-checker-option-help-developer">,
4845  HelpText<"Display the list of checker and package options meant for "
4846           "development purposes only">,
4847  MarshallingInfoFlag<AnalyzerOpts<"ShowCheckerOptionDeveloperList">>;
4848
4849def analyzer_config_compatibility_mode : Separate<["-"], "analyzer-config-compatibility-mode">,
4850  HelpText<"Don't emit errors on invalid analyzer-config inputs">,
4851  Values<"true,false">, NormalizedValues<[[{false}], [{true}]]>,
4852  MarshallingInfoEnum<AnalyzerOpts<"ShouldEmitErrorsOnInvalidConfigValue">, [{true}]>;
4853
4854def analyzer_config_compatibility_mode_EQ : Joined<["-"], "analyzer-config-compatibility-mode=">,
4855  Alias<analyzer_config_compatibility_mode>;
4856
4857def analyzer_werror : Flag<["-"], "analyzer-werror">,
4858  HelpText<"Emit analyzer results as errors rather than warnings">,
4859  MarshallingInfoFlag<AnalyzerOpts<"AnalyzerWerror">>;
4860
4861//===----------------------------------------------------------------------===//
4862// Migrator Options
4863//===----------------------------------------------------------------------===//
4864def migrator_no_nsalloc_error : Flag<["-"], "no-ns-alloc-error">,
4865  HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">,
4866  MarshallingInfoFlag<MigratorOpts<"NoNSAllocReallocError">>;
4867
4868def migrator_no_finalize_removal : Flag<["-"], "no-finalize-removal">,
4869  HelpText<"Do not remove finalize method in gc mode">,
4870  MarshallingInfoFlag<MigratorOpts<"NoFinalizeRemoval">>;
4871
4872//===----------------------------------------------------------------------===//
4873// CodeGen Options
4874//===----------------------------------------------------------------------===//
4875
4876let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
4877def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
4878def debug_info_macro : Flag<["-"], "debug-info-macro">,
4879  HelpText<"Emit macro debug information">,
4880  MarshallingInfoFlag<CodeGenOpts<"MacroDebugInfo">>;
4881def default_function_attr : Separate<["-"], "default-function-attr">,
4882  HelpText<"Apply given attribute to all functions">,
4883  MarshallingInfoStringVector<CodeGenOpts<"DefaultFunctionAttrs">>;
4884def dwarf_version_EQ : Joined<["-"], "dwarf-version=">,
4885  MarshallingInfoInt<CodeGenOpts<"DwarfVersion">>;
4886def debugger_tuning_EQ : Joined<["-"], "debugger-tuning=">,
4887  Values<"gdb,lldb,sce,dbx">,
4888  NormalizedValuesScope<"llvm::DebuggerKind">, NormalizedValues<["GDB", "LLDB", "SCE", "DBX"]>,
4889  MarshallingInfoEnum<CodeGenOpts<"DebuggerTuning">, "Default">;
4890def dwarf_debug_flags : Separate<["-"], "dwarf-debug-flags">,
4891  HelpText<"The string to embed in the Dwarf debug flags record.">,
4892  MarshallingInfoString<CodeGenOpts<"DwarfDebugFlags">>;
4893def record_command_line : Separate<["-"], "record-command-line">,
4894  HelpText<"The string to embed in the .LLVM.command.line section.">,
4895  MarshallingInfoString<CodeGenOpts<"RecordCommandLine">>;
4896def compress_debug_sections_EQ : Joined<["-", "--"], "compress-debug-sections=">,
4897    HelpText<"DWARF debug sections compression type">, Values<"none,zlib,zlib-gnu">,
4898    NormalizedValuesScope<"llvm::DebugCompressionType">, NormalizedValues<["None", "Z", "GNU"]>,
4899    MarshallingInfoEnum<CodeGenOpts<"CompressDebugSections">, "None">;
4900def compress_debug_sections : Flag<["-", "--"], "compress-debug-sections">,
4901  Alias<compress_debug_sections_EQ>, AliasArgs<["zlib"]>;
4902def mno_exec_stack : Flag<["-"], "mnoexecstack">,
4903  HelpText<"Mark the file as not needing an executable stack">,
4904  MarshallingInfoFlag<CodeGenOpts<"NoExecStack">>;
4905def massembler_no_warn : Flag<["-"], "massembler-no-warn">,
4906  HelpText<"Make assembler not emit warnings">,
4907  MarshallingInfoFlag<CodeGenOpts<"NoWarn">>;
4908def massembler_fatal_warnings : Flag<["-"], "massembler-fatal-warnings">,
4909  HelpText<"Make assembler warnings fatal">,
4910  MarshallingInfoFlag<CodeGenOpts<"FatalWarnings">>;
4911def mrelax_relocations : Flag<["--"], "mrelax-relocations">,
4912    HelpText<"Use relaxable elf relocations">,
4913    MarshallingInfoFlag<CodeGenOpts<"RelaxELFRelocations">>;
4914def msave_temp_labels : Flag<["-"], "msave-temp-labels">,
4915  HelpText<"Save temporary labels in the symbol table. "
4916           "Note this may change .s semantics and shouldn't generally be used "
4917           "on compiler-generated code.">,
4918  MarshallingInfoFlag<CodeGenOpts<"SaveTempLabels">>;
4919def mrelocation_model : Separate<["-"], "mrelocation-model">,
4920  HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">,
4921  NormalizedValuesScope<"llvm::Reloc">,
4922  NormalizedValues<["Static", "PIC_", "ROPI", "RWPI", "ROPI_RWPI", "DynamicNoPIC"]>,
4923  MarshallingInfoEnum<CodeGenOpts<"RelocationModel">, "PIC_">;
4924def fno_math_builtin : Flag<["-"], "fno-math-builtin">,
4925  HelpText<"Disable implicit builtin knowledge of math functions">,
4926  MarshallingInfoFlag<LangOpts<"NoMathBuiltin">>;
4927def fno_use_ctor_homing: Flag<["-"], "fno-use-ctor-homing">,
4928    HelpText<"Don't use constructor homing for debug info">;
4929def fuse_ctor_homing: Flag<["-"], "fuse-ctor-homing">,
4930    HelpText<"Use constructor homing if we are using limited debug info already">;
4931}
4932
4933def disable_llvm_verifier : Flag<["-"], "disable-llvm-verifier">,
4934  HelpText<"Don't run the LLVM IR verifier pass">,
4935  MarshallingInfoNegativeFlag<CodeGenOpts<"VerifyModule">>;
4936def disable_llvm_passes : Flag<["-"], "disable-llvm-passes">,
4937  HelpText<"Use together with -emit-llvm to get pristine LLVM IR from the "
4938           "frontend by not running any LLVM passes at all">,
4939  MarshallingInfoFlag<CodeGenOpts<"DisableLLVMPasses">>;
4940def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">,
4941  Alias<disable_llvm_passes>;
4942def disable_lifetimemarkers : Flag<["-"], "disable-lifetime-markers">,
4943  HelpText<"Disable lifetime-markers emission even when optimizations are "
4944           "enabled">,
4945  MarshallingInfoFlag<CodeGenOpts<"DisableLifetimeMarkers">>;
4946def disable_O0_optnone : Flag<["-"], "disable-O0-optnone">,
4947  HelpText<"Disable adding the optnone attribute to functions at O0">,
4948  MarshallingInfoFlag<CodeGenOpts<"DisableO0ImplyOptNone">>;
4949def disable_red_zone : Flag<["-"], "disable-red-zone">,
4950  HelpText<"Do not emit code that uses the red zone.">,
4951  MarshallingInfoFlag<CodeGenOpts<"DisableRedZone">>;
4952def dwarf_ext_refs : Flag<["-"], "dwarf-ext-refs">,
4953  HelpText<"Generate debug info with external references to clang modules"
4954           " or precompiled headers">,
4955  MarshallingInfoFlag<CodeGenOpts<"DebugTypeExtRefs">>;
4956def dwarf_explicit_import : Flag<["-"], "dwarf-explicit-import">,
4957  HelpText<"Generate explicit import from anonymous namespace to containing"
4958           " scope">,
4959  MarshallingInfoFlag<CodeGenOpts<"DebugExplicitImport">>;
4960def debug_forward_template_params : Flag<["-"], "debug-forward-template-params">,
4961  HelpText<"Emit complete descriptions of template parameters in forward"
4962           " declarations">,
4963  MarshallingInfoFlag<CodeGenOpts<"DebugFwdTemplateParams">>;
4964def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">,
4965  HelpText<"Emit an error if a C++ static local initializer would need a guard variable">,
4966  MarshallingInfoFlag<CodeGenOpts<"ForbidGuardVariables">>;
4967def no_implicit_float : Flag<["-"], "no-implicit-float">,
4968  HelpText<"Don't generate implicit floating point instructions">,
4969  MarshallingInfoFlag<CodeGenOpts<"NoImplicitFloat">>;
4970def fdump_vtable_layouts : Flag<["-"], "fdump-vtable-layouts">,
4971  HelpText<"Dump the layouts of all vtables that will be emitted in a translation unit">,
4972  MarshallingInfoFlag<LangOpts<"DumpVTableLayouts">>;
4973def fmerge_functions : Flag<["-"], "fmerge-functions">,
4974  HelpText<"Permit merging of identical functions when optimizing.">,
4975  MarshallingInfoFlag<CodeGenOpts<"MergeFunctions">>;
4976def coverage_data_file : Separate<["-"], "coverage-data-file">,
4977  HelpText<"Emit coverage data to this filename.">,
4978  MarshallingInfoString<CodeGenOpts<"CoverageDataFile">>,
4979  ShouldParseIf<!strconcat(fprofile_arcs.KeyPath, "||", ftest_coverage.KeyPath)>;
4980def coverage_data_file_EQ : Joined<["-"], "coverage-data-file=">,
4981  Alias<coverage_data_file>;
4982def coverage_notes_file : Separate<["-"], "coverage-notes-file">,
4983  HelpText<"Emit coverage notes to this filename.">,
4984  MarshallingInfoString<CodeGenOpts<"CoverageNotesFile">>,
4985  ShouldParseIf<!strconcat(fprofile_arcs.KeyPath, "||", ftest_coverage.KeyPath)>;
4986def coverage_notes_file_EQ : Joined<["-"], "coverage-notes-file=">,
4987  Alias<coverage_notes_file>;
4988def coverage_version_EQ : Joined<["-"], "coverage-version=">,
4989  HelpText<"Four-byte version string for gcov files.">;
4990def dump_coverage_mapping : Flag<["-"], "dump-coverage-mapping">,
4991  HelpText<"Dump the coverage mapping records, for testing">,
4992  MarshallingInfoFlag<CodeGenOpts<"DumpCoverageMapping">>;
4993def fuse_register_sized_bitfield_access: Flag<["-"], "fuse-register-sized-bitfield-access">,
4994  HelpText<"Use register sized accesses to bit-fields, when possible.">,
4995  MarshallingInfoFlag<CodeGenOpts<"UseRegisterSizedBitfieldAccess">>;
4996def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
4997  HelpText<"Turn off Type Based Alias Analysis">,
4998  MarshallingInfoFlag<CodeGenOpts<"RelaxedAliasing">>;
4999def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">,
5000  HelpText<"Turn off struct-path aware Type Based Alias Analysis">,
5001  MarshallingInfoNegativeFlag<CodeGenOpts<"StructPathTBAA">>;
5002def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">,
5003  HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">;
5004def mdebug_pass : Separate<["-"], "mdebug-pass">,
5005  HelpText<"Enable additional debug output">,
5006  MarshallingInfoString<CodeGenOpts<"DebugPass">>;
5007def mframe_pointer_EQ : Joined<["-"], "mframe-pointer=">,
5008  HelpText<"Specify which frame pointers to retain (all, non-leaf, none).">, Values<"all,non-leaf,none">,
5009  NormalizedValuesScope<"CodeGenOptions::FramePointerKind">, NormalizedValues<["All", "NonLeaf", "None"]>,
5010  MarshallingInfoEnum<CodeGenOpts<"FramePointer">, "None">;
5011def mdisable_tail_calls : Flag<["-"], "mdisable-tail-calls">,
5012  HelpText<"Disable tail call optimization, keeping the call stack accurate">,
5013  MarshallingInfoFlag<CodeGenOpts<"DisableTailCalls">>;
5014def menable_no_infinities : Flag<["-"], "menable-no-infs">,
5015  HelpText<"Allow optimization to assume there are no infinities.">,
5016  MarshallingInfoFlag<LangOpts<"NoHonorInfs">>, ImpliedByAnyOf<[ffinite_math_only.KeyPath]>;
5017def menable_no_nans : Flag<["-"], "menable-no-nans">,
5018  HelpText<"Allow optimization to assume there are no NaNs.">,
5019  MarshallingInfoFlag<LangOpts<"NoHonorNaNs">>, ImpliedByAnyOf<[ffinite_math_only.KeyPath]>;
5020def mreassociate : Flag<["-"], "mreassociate">,
5021  HelpText<"Allow reassociation transformations for floating-point instructions">,
5022  MarshallingInfoFlag<LangOpts<"AllowFPReassoc">>, ImpliedByAnyOf<[menable_unsafe_fp_math.KeyPath]>;
5023def mabi_EQ_ieeelongdouble : Flag<["-"], "mabi=ieeelongdouble">,
5024  HelpText<"Use IEEE 754 quadruple-precision for long double">,
5025  MarshallingInfoFlag<LangOpts<"PPCIEEELongDouble">>;
5026def mfloat_abi : Separate<["-"], "mfloat-abi">,
5027  HelpText<"The float ABI to use">,
5028  MarshallingInfoString<CodeGenOpts<"FloatABI">>;
5029def mtp : Separate<["-"], "mtp">,
5030  HelpText<"Mode for reading thread pointer">;
5031def mlimit_float_precision : Separate<["-"], "mlimit-float-precision">,
5032  HelpText<"Limit float precision to the given value">,
5033  MarshallingInfoString<CodeGenOpts<"LimitFloatPrecision">>;
5034def mregparm : Separate<["-"], "mregparm">,
5035  HelpText<"Limit the number of registers available for integer arguments">,
5036  MarshallingInfoInt<CodeGenOpts<"NumRegisterParameters">>;
5037def msmall_data_limit : Separate<["-"], "msmall-data-limit">,
5038  HelpText<"Put global and static data smaller than the limit into a special section">,
5039  MarshallingInfoInt<CodeGenOpts<"SmallDataLimit">>;
5040def funwind_tables_EQ : Joined<["-"], "funwind-tables=">,
5041  HelpText<"Generate unwinding tables for all functions">,
5042  MarshallingInfoInt<CodeGenOpts<"UnwindTables">>;
5043def mconstructor_aliases : Flag<["-"], "mconstructor-aliases">,
5044  HelpText<"Emit complete constructors and destructors as aliases when possible">,
5045  MarshallingInfoFlag<CodeGenOpts<"CXXCtorDtorAliases">>;
5046def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">,
5047  HelpText<"Link the given bitcode file before performing optimizations.">;
5048def mlink_builtin_bitcode : Separate<["-"], "mlink-builtin-bitcode">,
5049  HelpText<"Link and internalize needed symbols from the given bitcode file "
5050           "before performing optimizations.">;
5051def mlink_cuda_bitcode : Separate<["-"], "mlink-cuda-bitcode">,
5052  Alias<mlink_builtin_bitcode>;
5053def vectorize_loops : Flag<["-"], "vectorize-loops">,
5054  HelpText<"Run the Loop vectorization passes">,
5055  MarshallingInfoFlag<CodeGenOpts<"VectorizeLoop">>;
5056def vectorize_slp : Flag<["-"], "vectorize-slp">,
5057  HelpText<"Run the SLP vectorization passes">,
5058  MarshallingInfoFlag<CodeGenOpts<"VectorizeSLP">>;
5059def dependent_lib : Joined<["--"], "dependent-lib=">,
5060  HelpText<"Add dependent library">,
5061  MarshallingInfoStringVector<CodeGenOpts<"DependentLibraries">>;
5062def linker_option : Joined<["--"], "linker-option=">,
5063  HelpText<"Add linker option">,
5064  MarshallingInfoStringVector<CodeGenOpts<"LinkerOptions">>;
5065def fsanitize_coverage_type : Joined<["-"], "fsanitize-coverage-type=">,
5066                              HelpText<"Sanitizer coverage type">,
5067                              MarshallingInfoInt<CodeGenOpts<"SanitizeCoverageType">>;
5068def fsanitize_coverage_indirect_calls
5069    : Flag<["-"], "fsanitize-coverage-indirect-calls">,
5070      HelpText<"Enable sanitizer coverage for indirect calls">,
5071      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageIndirectCalls">>;
5072def fsanitize_coverage_trace_bb
5073    : Flag<["-"], "fsanitize-coverage-trace-bb">,
5074      HelpText<"Enable basic block tracing in sanitizer coverage">,
5075      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceBB">>;
5076def fsanitize_coverage_trace_cmp
5077    : Flag<["-"], "fsanitize-coverage-trace-cmp">,
5078      HelpText<"Enable cmp instruction tracing in sanitizer coverage">,
5079      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceCmp">>;
5080def fsanitize_coverage_trace_div
5081    : Flag<["-"], "fsanitize-coverage-trace-div">,
5082      HelpText<"Enable div instruction tracing in sanitizer coverage">,
5083      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceDiv">>;
5084def fsanitize_coverage_trace_gep
5085    : Flag<["-"], "fsanitize-coverage-trace-gep">,
5086      HelpText<"Enable gep instruction tracing in sanitizer coverage">,
5087      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceGep">>;
5088def fsanitize_coverage_8bit_counters
5089    : Flag<["-"], "fsanitize-coverage-8bit-counters">,
5090      HelpText<"Enable frequency counters in sanitizer coverage">,
5091      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverage8bitCounters">>;
5092def fsanitize_coverage_inline_8bit_counters
5093    : Flag<["-"], "fsanitize-coverage-inline-8bit-counters">,
5094      HelpText<"Enable inline 8-bit counters in sanitizer coverage">,
5095      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInline8bitCounters">>;
5096def fsanitize_coverage_inline_bool_flag
5097    : Flag<["-"], "fsanitize-coverage-inline-bool-flag">,
5098      HelpText<"Enable inline bool flag in sanitizer coverage">,
5099      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageInlineBoolFlag">>;
5100def fsanitize_coverage_pc_table
5101    : Flag<["-"], "fsanitize-coverage-pc-table">,
5102      HelpText<"Create a table of coverage-instrumented PCs">,
5103      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoveragePCTable">>;
5104def fsanitize_coverage_trace_pc
5105    : Flag<["-"], "fsanitize-coverage-trace-pc">,
5106      HelpText<"Enable PC tracing in sanitizer coverage">,
5107      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePC">>;
5108def fsanitize_coverage_trace_pc_guard
5109    : Flag<["-"], "fsanitize-coverage-trace-pc-guard">,
5110      HelpText<"Enable PC tracing with guard in sanitizer coverage">,
5111      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTracePCGuard">>;
5112def fsanitize_coverage_no_prune
5113    : Flag<["-"], "fsanitize-coverage-no-prune">,
5114      HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">,
5115      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageNoPrune">>;
5116def fsanitize_coverage_stack_depth
5117    : Flag<["-"], "fsanitize-coverage-stack-depth">,
5118      HelpText<"Enable max stack depth tracing">,
5119      MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageStackDepth">>;
5120def fpatchable_function_entry_offset_EQ
5121    : Joined<["-"], "fpatchable-function-entry-offset=">, MetaVarName<"<M>">,
5122      HelpText<"Generate M NOPs before function entry">,
5123      MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryOffset">>;
5124def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
5125    HelpText<"Enable PGO instrumentation. The accepted value is clang, llvm, "
5126             "or none">, Values<"none,clang,llvm,csllvm">,
5127    NormalizedValuesScope<"CodeGenOptions">,
5128    NormalizedValues<["ProfileNone", "ProfileClangInstr", "ProfileIRInstr", "ProfileCSIRInstr"]>,
5129    MarshallingInfoEnum<CodeGenOpts<"ProfileInstr">, "ProfileNone">;
5130def fprofile_instrument_path_EQ : Joined<["-"], "fprofile-instrument-path=">,
5131    HelpText<"Generate instrumented code to collect execution counts into "
5132             "<file> (overridden by LLVM_PROFILE_FILE env var)">,
5133    MarshallingInfoString<CodeGenOpts<"InstrProfileOutput">>;
5134def fprofile_instrument_use_path_EQ :
5135    Joined<["-"], "fprofile-instrument-use-path=">,
5136    HelpText<"Specify the profile path in PGO use compilation">,
5137    MarshallingInfoString<CodeGenOpts<"ProfileInstrumentUsePath">>;
5138def flto_visibility_public_std:
5139    Flag<["-"], "flto-visibility-public-std">,
5140    HelpText<"Use public LTO visibility for classes in std and stdext namespaces">,
5141    MarshallingInfoFlag<CodeGenOpts<"LTOVisibilityPublicStd">>;
5142defm lto_unit : BoolOption<"f", "lto-unit",
5143  CodeGenOpts<"LTOUnit">, DefaultFalse,
5144  PosFlag<SetTrue, [CC1Option], "Emit IR to support LTO unit features (CFI, whole program vtable opt)">,
5145  NegFlag<SetFalse>>;
5146defm debug_pass_manager : BoolOption<"f", "debug-pass-manager",
5147  CodeGenOpts<"DebugPassManager">, DefaultFalse,
5148  PosFlag<SetTrue, [], "Prints debug information for the new pass manager">,
5149  NegFlag<SetFalse, [], "Disables debug printing for the new pass manager">>;
5150def fexperimental_debug_variable_locations : Flag<["-"],
5151    "fexperimental-debug-variable-locations">,
5152    HelpText<"Use experimental new value-tracking variable locations">,
5153    MarshallingInfoFlag<CodeGenOpts<"ValueTrackingVariableLocations">>;
5154def fverify_debuginfo_preserve
5155    : Flag<["-"], "fverify-debuginfo-preserve">,
5156      HelpText<"Enable Debug Info Metadata preservation testing in "
5157               "optimizations.">,
5158      MarshallingInfoFlag<CodeGenOpts<"EnableDIPreservationVerify">>;
5159def fverify_debuginfo_preserve_export
5160    : Joined<["-"], "fverify-debuginfo-preserve-export=">,
5161      MetaVarName<"<file>">,
5162      HelpText<"Export debug info (by testing original Debug Info) failures "
5163               "into specified (JSON) file (should be abs path as we use "
5164               "append mode to insert new JSON objects).">,
5165      MarshallingInfoString<CodeGenOpts<"DIBugsReportFilePath">>;
5166def fwarn_stack_size_EQ
5167    : Joined<["-"], "fwarn-stack-size=">,
5168      MarshallingInfoInt<CodeGenOpts<"WarnStackSize">, "UINT_MAX">;
5169// The driver option takes the key as a parameter to the -msign-return-address=
5170// and -mbranch-protection= options, but CC1 has a separate option so we
5171// don't have to parse the parameter twice.
5172def msign_return_address_key_EQ : Joined<["-"], "msign-return-address-key=">,
5173    Values<"a_key,b_key">;
5174def mbranch_target_enforce : Flag<["-"], "mbranch-target-enforce">,
5175  MarshallingInfoFlag<LangOpts<"BranchTargetEnforcement">>;
5176def fno_dllexport_inlines : Flag<["-"], "fno-dllexport-inlines">,
5177  MarshallingInfoNegativeFlag<LangOpts<"DllExportInlines">>;
5178def cfguard_no_checks : Flag<["-"], "cfguard-no-checks">,
5179    HelpText<"Emit Windows Control Flow Guard tables only (no checks)">,
5180    MarshallingInfoFlag<CodeGenOpts<"ControlFlowGuardNoChecks">>;
5181def cfguard : Flag<["-"], "cfguard">,
5182    HelpText<"Emit Windows Control Flow Guard tables and checks">,
5183    MarshallingInfoFlag<CodeGenOpts<"ControlFlowGuard">>;
5184def ehcontguard : Flag<["-"], "ehcontguard">,
5185    HelpText<"Emit Windows EH Continuation Guard tables">,
5186    MarshallingInfoFlag<CodeGenOpts<"EHContGuard">>;
5187
5188def fdenormal_fp_math_f32_EQ : Joined<["-"], "fdenormal-fp-math-f32=">,
5189   Group<f_Group>;
5190
5191//===----------------------------------------------------------------------===//
5192// Dependency Output Options
5193//===----------------------------------------------------------------------===//
5194
5195def sys_header_deps : Flag<["-"], "sys-header-deps">,
5196  HelpText<"Include system headers in dependency output">,
5197  MarshallingInfoFlag<DependencyOutputOpts<"IncludeSystemHeaders">>;
5198def module_file_deps : Flag<["-"], "module-file-deps">,
5199  HelpText<"Include module files in dependency output">,
5200  MarshallingInfoFlag<DependencyOutputOpts<"IncludeModuleFiles">>;
5201def header_include_file : Separate<["-"], "header-include-file">,
5202  HelpText<"Filename (or -) to write header include output to">,
5203  MarshallingInfoString<DependencyOutputOpts<"HeaderIncludeOutputFile">>;
5204def show_includes : Flag<["--"], "show-includes">,
5205  HelpText<"Print cl.exe style /showIncludes to stdout">;
5206
5207//===----------------------------------------------------------------------===//
5208// Diagnostic Options
5209//===----------------------------------------------------------------------===//
5210
5211def diagnostic_log_file : Separate<["-"], "diagnostic-log-file">,
5212  HelpText<"Filename (or -) to log diagnostics to">,
5213  MarshallingInfoString<DiagnosticOpts<"DiagnosticLogFile">>;
5214def diagnostic_serialized_file : Separate<["-"], "serialize-diagnostic-file">,
5215  MetaVarName<"<filename>">,
5216  HelpText<"File for serializing diagnostics in a binary format">;
5217
5218def fdiagnostics_format : Separate<["-"], "fdiagnostics-format">,
5219  HelpText<"Change diagnostic formatting to match IDE and command line tools">, Values<"clang,msvc,vi">,
5220  NormalizedValuesScope<"DiagnosticOptions">, NormalizedValues<["Clang", "MSVC", "Vi"]>,
5221  MarshallingInfoEnum<DiagnosticOpts<"Format">, "Clang">;
5222def fdiagnostics_show_category : Separate<["-"], "fdiagnostics-show-category">,
5223  HelpText<"Print diagnostic category">, Values<"none,id,name">,
5224  NormalizedValues<["0", "1", "2"]>,
5225  MarshallingInfoEnum<DiagnosticOpts<"ShowCategories">, "0">;
5226def fno_diagnostics_use_presumed_location : Flag<["-"], "fno-diagnostics-use-presumed-location">,
5227  HelpText<"Ignore #line directives when displaying diagnostic locations">,
5228  MarshallingInfoNegativeFlag<DiagnosticOpts<"ShowPresumedLoc">>;
5229def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">,
5230  HelpText<"Set the tab stop distance.">,
5231  MarshallingInfoInt<DiagnosticOpts<"TabStop">, "DiagnosticOptions::DefaultTabStop">;
5232def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"<N>">,
5233  HelpText<"Set the maximum number of errors to emit before stopping (0 = no limit).">,
5234  MarshallingInfoInt<DiagnosticOpts<"ErrorLimit">>;
5235def fmacro_backtrace_limit : Separate<["-"], "fmacro-backtrace-limit">, MetaVarName<"<N>">,
5236  HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit).">,
5237  MarshallingInfoInt<DiagnosticOpts<"MacroBacktraceLimit">, "DiagnosticOptions::DefaultMacroBacktraceLimit">;
5238def ftemplate_backtrace_limit : Separate<["-"], "ftemplate-backtrace-limit">, MetaVarName<"<N>">,
5239  HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit).">,
5240  MarshallingInfoInt<DiagnosticOpts<"TemplateBacktraceLimit">, "DiagnosticOptions::DefaultTemplateBacktraceLimit">;
5241def fconstexpr_backtrace_limit : Separate<["-"], "fconstexpr-backtrace-limit">, MetaVarName<"<N>">,
5242  HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit).">,
5243  MarshallingInfoInt<DiagnosticOpts<"ConstexprBacktraceLimit">, "DiagnosticOptions::DefaultConstexprBacktraceLimit">;
5244def fspell_checking_limit : Separate<["-"], "fspell-checking-limit">, MetaVarName<"<N>">,
5245  HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit).">,
5246  MarshallingInfoInt<DiagnosticOpts<"SpellCheckingLimit">, "DiagnosticOptions::DefaultSpellCheckingLimit">;
5247def fcaret_diagnostics_max_lines :
5248  Separate<["-"], "fcaret-diagnostics-max-lines">, MetaVarName<"<N>">,
5249  HelpText<"Set the maximum number of source lines to show in a caret diagnostic">,
5250  MarshallingInfoInt<DiagnosticOpts<"SnippetLineLimit">, "DiagnosticOptions::DefaultSnippetLineLimit">;
5251def verify_EQ : CommaJoined<["-"], "verify=">,
5252  MetaVarName<"<prefixes>">,
5253  HelpText<"Verify diagnostic output using comment directives that start with"
5254           " prefixes in the comma-separated sequence <prefixes>">;
5255def verify : Flag<["-"], "verify">,
5256  HelpText<"Equivalent to -verify=expected">;
5257def verify_ignore_unexpected : Flag<["-"], "verify-ignore-unexpected">,
5258  HelpText<"Ignore unexpected diagnostic messages">;
5259def verify_ignore_unexpected_EQ : CommaJoined<["-"], "verify-ignore-unexpected=">,
5260  HelpText<"Ignore unexpected diagnostic messages">;
5261def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">,
5262  HelpText<"Silence ObjC rewriting warnings">,
5263  MarshallingInfoFlag<DiagnosticOpts<"NoRewriteMacros">>;
5264
5265//===----------------------------------------------------------------------===//
5266// Frontend Options
5267//===----------------------------------------------------------------------===//
5268
5269// This isn't normally used, it is just here so we can parse a
5270// CompilerInvocation out of a driver-derived argument vector.
5271def cc1 : Flag<["-"], "cc1">;
5272def cc1as : Flag<["-"], "cc1as">;
5273
5274def ast_merge : Separate<["-"], "ast-merge">,
5275  MetaVarName<"<ast file>">,
5276  HelpText<"Merge the given AST file into the translation unit being compiled.">,
5277  MarshallingInfoStringVector<FrontendOpts<"ASTMergeFiles">>;
5278def aux_target_cpu : Separate<["-"], "aux-target-cpu">,
5279  HelpText<"Target a specific auxiliary cpu type">;
5280def aux_target_feature : Separate<["-"], "aux-target-feature">,
5281  HelpText<"Target specific auxiliary attributes">;
5282def aux_triple : Separate<["-"], "aux-triple">,
5283  HelpText<"Auxiliary target triple.">,
5284  MarshallingInfoString<FrontendOpts<"AuxTriple">>;
5285def code_completion_at : Separate<["-"], "code-completion-at">,
5286  MetaVarName<"<file>:<line>:<column>">,
5287  HelpText<"Dump code-completion information at a location">;
5288def remap_file : Separate<["-"], "remap-file">,
5289  MetaVarName<"<from>;<to>">,
5290  HelpText<"Replace the contents of the <from> file with the contents of the <to> file">;
5291def code_completion_at_EQ : Joined<["-"], "code-completion-at=">,
5292  Alias<code_completion_at>;
5293def code_completion_macros : Flag<["-"], "code-completion-macros">,
5294  HelpText<"Include macros in code-completion results">,
5295  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeMacros">>;
5296def code_completion_patterns : Flag<["-"], "code-completion-patterns">,
5297  HelpText<"Include code patterns in code-completion results">,
5298  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeCodePatterns">>;
5299def no_code_completion_globals : Flag<["-"], "no-code-completion-globals">,
5300  HelpText<"Do not include global declarations in code-completion results.">,
5301  MarshallingInfoNegativeFlag<FrontendOpts<"CodeCompleteOpts.IncludeGlobals">>;
5302def no_code_completion_ns_level_decls : Flag<["-"], "no-code-completion-ns-level-decls">,
5303  HelpText<"Do not include declarations inside namespaces (incl. global namespace) in the code-completion results.">,
5304  MarshallingInfoNegativeFlag<FrontendOpts<"CodeCompleteOpts.IncludeNamespaceLevelDecls">>;
5305def code_completion_brief_comments : Flag<["-"], "code-completion-brief-comments">,
5306  HelpText<"Include brief documentation comments in code-completion results.">,
5307  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeBriefComments">>;
5308def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">,
5309  HelpText<"Include code completion results which require small fix-its.">,
5310  MarshallingInfoFlag<FrontendOpts<"CodeCompleteOpts.IncludeFixIts">>;
5311def disable_free : Flag<["-"], "disable-free">,
5312  HelpText<"Disable freeing of memory on exit">,
5313  MarshallingInfoFlag<FrontendOpts<"DisableFree">>;
5314def clear_ast_before_backend : Flag<["-"], "clear-ast-before-backend">,
5315  HelpText<"Clear the Clang AST before running backend code generation">,
5316  MarshallingInfoFlag<CodeGenOpts<"ClearASTBeforeBackend">>;
5317def enable_noundef_analysis : Flag<["-"], "enable-noundef-analysis">, Group<f_Group>,
5318  HelpText<"Enable analyzing function argument and return types for mandatory definedness">,
5319  MarshallingInfoFlag<CodeGenOpts<"EnableNoundefAttrs">>;
5320def discard_value_names : Flag<["-"], "discard-value-names">,
5321  HelpText<"Discard value names in LLVM IR">,
5322  MarshallingInfoFlag<CodeGenOpts<"DiscardValueNames">>;
5323def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">,
5324    MetaVarName<"<name> <arg>">,
5325    HelpText<"Pass <arg> to plugin <name>">;
5326def add_plugin : Separate<["-"], "add-plugin">, MetaVarName<"<name>">,
5327  HelpText<"Use the named plugin action in addition to the default action">,
5328  MarshallingInfoStringVector<FrontendOpts<"AddPluginActions">>;
5329def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
5330  MetaVarName<"<dump_filter>">,
5331  HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration"
5332           " nodes having a certain substring in a qualified name. Use"
5333           " -ast-list to list all filterable declaration node names.">,
5334  MarshallingInfoString<FrontendOpts<"ASTDumpFilter">>;
5335def ast_dump_filter_EQ : Joined<["-"], "ast-dump-filter=">,
5336  Alias<ast_dump_filter>;
5337def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
5338  HelpText<"Do not automatically generate or update the global module index">,
5339  MarshallingInfoNegativeFlag<FrontendOpts<"UseGlobalModuleIndex">>;
5340def fno_modules_error_recovery : Flag<["-"], "fno-modules-error-recovery">,
5341  HelpText<"Do not automatically import modules for error recovery">,
5342  MarshallingInfoNegativeFlag<LangOpts<"ModulesErrorRecovery">>;
5343def fmodule_map_file_home_is_cwd : Flag<["-"], "fmodule-map-file-home-is-cwd">,
5344  HelpText<"Use the current working directory as the home directory of "
5345           "module maps specified by -fmodule-map-file=<FILE>">,
5346  MarshallingInfoFlag<HeaderSearchOpts<"ModuleMapFileHomeIsCwd">>;
5347def fmodule_feature : Separate<["-"], "fmodule-feature">,
5348  MetaVarName<"<feature>">,
5349  HelpText<"Enable <feature> in module map requires declarations">,
5350  MarshallingInfoStringVector<LangOpts<"ModuleFeatures">>;
5351def fmodules_embed_file_EQ : Joined<["-"], "fmodules-embed-file=">,
5352  MetaVarName<"<file>">,
5353  HelpText<"Embed the contents of the specified file into the module file "
5354           "being compiled.">,
5355  MarshallingInfoStringVector<FrontendOpts<"ModulesEmbedFiles">>;
5356def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">,
5357  HelpText<"Embed the contents of all files read by this compilation into "
5358           "the produced module file.">,
5359  MarshallingInfoFlag<FrontendOpts<"ModulesEmbedAllFiles">>;
5360defm fimplicit_modules_use_lock : BoolOption<"f", "implicit-modules-use-lock",
5361  FrontendOpts<"BuildingImplicitModuleUsesLock">, DefaultTrue,
5362  NegFlag<SetFalse>,
5363  PosFlag<SetTrue, [],
5364          "Use filesystem locks for implicit modules builds to avoid "
5365          "duplicating work in competing clang invocations.">>;
5366// FIXME: We only need this in C++ modules / Modules TS if we might textually
5367// enter a different module (eg, when building a header unit).
5368def fmodules_local_submodule_visibility :
5369  Flag<["-"], "fmodules-local-submodule-visibility">,
5370  HelpText<"Enforce name visibility rules across submodules of the same "
5371           "top-level module.">,
5372  MarshallingInfoFlag<LangOpts<"ModulesLocalVisibility">>,
5373  ImpliedByAnyOf<[fmodules_ts.KeyPath, fcxx_modules.KeyPath]>;
5374def fmodules_codegen :
5375  Flag<["-"], "fmodules-codegen">,
5376  HelpText<"Generate code for uses of this module that assumes an explicit "
5377           "object file will be built for the module">,
5378  MarshallingInfoFlag<LangOpts<"ModulesCodegen">>;
5379def fmodules_debuginfo :
5380  Flag<["-"], "fmodules-debuginfo">,
5381  HelpText<"Generate debug info for types in an object file built from this "
5382           "module and do not generate them elsewhere">,
5383  MarshallingInfoFlag<LangOpts<"ModulesDebugInfo">>;
5384def fmodule_format_EQ : Joined<["-"], "fmodule-format=">,
5385  HelpText<"Select the container format for clang modules and PCH. "
5386           "Supported options are 'raw' and 'obj'.">,
5387  MarshallingInfoString<HeaderSearchOpts<"ModuleFormat">, [{"raw"}]>;
5388def ftest_module_file_extension_EQ :
5389  Joined<["-"], "ftest-module-file-extension=">,
5390  HelpText<"introduce a module file extension for testing purposes. "
5391           "The argument is parsed as blockname:major:minor:hashed:user info">;
5392def fconcepts_ts : Flag<["-"], "fconcepts-ts">,
5393  HelpText<"Enable C++ Extensions for Concepts. (deprecated - use -std=c++2a)">;
5394def fno_concept_satisfaction_caching : Flag<["-"],
5395                                            "fno-concept-satisfaction-caching">,
5396  HelpText<"Disable satisfaction caching for C++2a Concepts.">,
5397  MarshallingInfoNegativeFlag<LangOpts<"ConceptSatisfactionCaching">>;
5398
5399defm recovery_ast : BoolOption<"f", "recovery-ast",
5400  LangOpts<"RecoveryAST">, DefaultTrue,
5401  NegFlag<SetFalse>, PosFlag<SetTrue, [], "Preserve expressions in AST rather "
5402                              "than dropping them when encountering semantic errors">>;
5403defm recovery_ast_type : BoolOption<"f", "recovery-ast-type",
5404  LangOpts<"RecoveryASTType">, DefaultTrue,
5405  NegFlag<SetFalse>, PosFlag<SetTrue, [], "Preserve the type for recovery "
5406                              "expressions when possible">>;
5407
5408let Group = Action_Group in {
5409
5410def Eonly : Flag<["-"], "Eonly">,
5411  HelpText<"Just run preprocessor, no output (for timings)">;
5412def dump_raw_tokens : Flag<["-"], "dump-raw-tokens">,
5413  HelpText<"Lex file in raw mode and dump raw tokens">;
5414def analyze : Flag<["-"], "analyze">,
5415  HelpText<"Run static analysis engine">;
5416def dump_tokens : Flag<["-"], "dump-tokens">,
5417  HelpText<"Run preprocessor, dump internal rep of tokens">;
5418def fixit : Flag<["-"], "fixit">,
5419  HelpText<"Apply fix-it advice to the input source">;
5420def fixit_EQ : Joined<["-"], "fixit=">,
5421  HelpText<"Apply fix-it advice creating a file with the given suffix">;
5422def print_preamble : Flag<["-"], "print-preamble">,
5423  HelpText<"Print the \"preamble\" of a file, which is a candidate for implicit"
5424           " precompiled headers.">;
5425def emit_html : Flag<["-"], "emit-html">,
5426  HelpText<"Output input source as HTML">;
5427def ast_print : Flag<["-"], "ast-print">,
5428  HelpText<"Build ASTs and then pretty-print them">;
5429def ast_list : Flag<["-"], "ast-list">,
5430  HelpText<"Build ASTs and print the list of declaration node qualified names">;
5431def ast_dump : Flag<["-"], "ast-dump">,
5432  HelpText<"Build ASTs and then debug dump them">;
5433def ast_dump_EQ : Joined<["-"], "ast-dump=">,
5434  HelpText<"Build ASTs and then debug dump them in the specified format. "
5435           "Supported formats include: default, json">;
5436def ast_dump_all : Flag<["-"], "ast-dump-all">,
5437  HelpText<"Build ASTs and then debug dump them, forcing deserialization">;
5438def ast_dump_all_EQ : Joined<["-"], "ast-dump-all=">,
5439  HelpText<"Build ASTs and then debug dump them in the specified format, "
5440           "forcing deserialization. Supported formats include: default, json">;
5441def ast_dump_decl_types : Flag<["-"], "ast-dump-decl-types">,
5442  HelpText<"Include declaration types in AST dumps">,
5443  MarshallingInfoFlag<FrontendOpts<"ASTDumpDeclTypes">>;
5444def templight_dump : Flag<["-"], "templight-dump">,
5445  HelpText<"Dump templight information to stdout">;
5446def ast_dump_lookups : Flag<["-"], "ast-dump-lookups">,
5447  HelpText<"Build ASTs and then debug dump their name lookup tables">,
5448  MarshallingInfoFlag<FrontendOpts<"ASTDumpLookups">>;
5449def ast_view : Flag<["-"], "ast-view">,
5450  HelpText<"Build ASTs and view them with GraphViz">;
5451def emit_module : Flag<["-"], "emit-module">,
5452  HelpText<"Generate pre-compiled module file from a module map">;
5453def emit_module_interface : Flag<["-"], "emit-module-interface">,
5454  HelpText<"Generate pre-compiled module file from a C++ module interface">;
5455def emit_header_module : Flag<["-"], "emit-header-module">,
5456  HelpText<"Generate pre-compiled module file from a set of header files">;
5457def emit_pch : Flag<["-"], "emit-pch">,
5458  HelpText<"Generate pre-compiled header file">;
5459def emit_llvm_bc : Flag<["-"], "emit-llvm-bc">,
5460  HelpText<"Build ASTs then convert to LLVM, emit .bc file">;
5461def emit_llvm_only : Flag<["-"], "emit-llvm-only">,
5462  HelpText<"Build ASTs and convert to LLVM, discarding output">;
5463def emit_codegen_only : Flag<["-"], "emit-codegen-only">,
5464  HelpText<"Generate machine code, but discard output">;
5465def rewrite_test : Flag<["-"], "rewrite-test">,
5466  HelpText<"Rewriter playground">;
5467def rewrite_macros : Flag<["-"], "rewrite-macros">,
5468  HelpText<"Expand macros without full preprocessing">;
5469def migrate : Flag<["-"], "migrate">,
5470  HelpText<"Migrate source code">;
5471def compiler_options_dump : Flag<["-"], "compiler-options-dump">,
5472  HelpText<"Dump the compiler configuration options">;
5473def print_dependency_directives_minimized_source : Flag<["-"],
5474  "print-dependency-directives-minimized-source">,
5475  HelpText<"Print the output of the dependency directives source minimizer">;
5476}
5477
5478defm emit_llvm_uselists : BoolOption<"", "emit-llvm-uselists",
5479  CodeGenOpts<"EmitLLVMUseLists">, DefaultFalse,
5480  PosFlag<SetTrue, [], "Preserve">,
5481  NegFlag<SetFalse, [], "Don't preserve">,
5482  BothFlags<[], " order of LLVM use-lists when serializing">>;
5483
5484def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">,
5485  HelpText<"Directory for temporary files produced during ARC or ObjC migration">,
5486  MarshallingInfoString<FrontendOpts<"MTMigrateDir">>;
5487
5488def arcmt_action_EQ : Joined<["-"], "arcmt-action=">, Flags<[CC1Option, NoDriverOption]>,
5489  HelpText<"The ARC migration action to take">, Values<"check,modify,migrate">,
5490  NormalizedValuesScope<"FrontendOptions">,
5491  NormalizedValues<["ARCMT_Check", "ARCMT_Modify", "ARCMT_Migrate"]>,
5492  MarshallingInfoEnum<FrontendOpts<"ARCMTAction">, "ARCMT_None">;
5493
5494def opt_record_file : Separate<["-"], "opt-record-file">,
5495  HelpText<"File name to use for YAML optimization record output">,
5496  MarshallingInfoString<CodeGenOpts<"OptRecordFile">>;
5497def opt_record_passes : Separate<["-"], "opt-record-passes">,
5498  HelpText<"Only record remark information for passes whose names match the given regular expression">;
5499def opt_record_format : Separate<["-"], "opt-record-format">,
5500  HelpText<"The format used for serializing remarks (default: YAML)">;
5501
5502def print_stats : Flag<["-"], "print-stats">,
5503  HelpText<"Print performance metrics and statistics">,
5504  MarshallingInfoFlag<FrontendOpts<"ShowStats">>;
5505def stats_file : Joined<["-"], "stats-file=">,
5506  HelpText<"Filename to write statistics to">,
5507  MarshallingInfoString<FrontendOpts<"StatsFile">>;
5508def fdump_record_layouts_simple : Flag<["-"], "fdump-record-layouts-simple">,
5509  HelpText<"Dump record layout information in a simple form used for testing">,
5510  MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsSimple">>;
5511def fdump_record_layouts_canonical : Flag<["-"], "fdump-record-layouts-canonical">,
5512  HelpText<"Dump record layout information with canonical field types">,
5513  MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsCanonical">>;
5514def fdump_record_layouts_complete : Flag<["-"], "fdump-record-layouts-complete">,
5515  HelpText<"Dump record layout information for all complete types">,
5516  MarshallingInfoFlag<LangOpts<"DumpRecordLayoutsComplete">>;
5517def fdump_record_layouts : Flag<["-"], "fdump-record-layouts">,
5518  HelpText<"Dump record layout information">,
5519  MarshallingInfoFlag<LangOpts<"DumpRecordLayouts">>,
5520  ImpliedByAnyOf<[fdump_record_layouts_simple.KeyPath, fdump_record_layouts_complete.KeyPath, fdump_record_layouts_canonical.KeyPath]>;
5521def fix_what_you_can : Flag<["-"], "fix-what-you-can">,
5522  HelpText<"Apply fix-it advice even in the presence of unfixable errors">,
5523  MarshallingInfoFlag<FrontendOpts<"FixWhatYouCan">>;
5524def fix_only_warnings : Flag<["-"], "fix-only-warnings">,
5525  HelpText<"Apply fix-it advice only for warnings, not errors">,
5526  MarshallingInfoFlag<FrontendOpts<"FixOnlyWarnings">>;
5527def fixit_recompile : Flag<["-"], "fixit-recompile">,
5528  HelpText<"Apply fix-it changes and recompile">,
5529  MarshallingInfoFlag<FrontendOpts<"FixAndRecompile">>;
5530def fixit_to_temp : Flag<["-"], "fixit-to-temporary">,
5531  HelpText<"Apply fix-it changes to temporary files">,
5532  MarshallingInfoFlag<FrontendOpts<"FixToTemporaries">>;
5533
5534def foverride_record_layout_EQ : Joined<["-"], "foverride-record-layout=">,
5535  HelpText<"Override record layouts with those in the given file">,
5536  MarshallingInfoString<FrontendOpts<"OverrideRecordLayoutsFile">>;
5537def pch_through_header_EQ : Joined<["-"], "pch-through-header=">,
5538  HelpText<"Stop PCH generation after including this file.  When using a PCH, "
5539           "skip tokens until after this file is included.">,
5540  MarshallingInfoString<PreprocessorOpts<"PCHThroughHeader">>;
5541def pch_through_hdrstop_create : Flag<["-"], "pch-through-hdrstop-create">,
5542  HelpText<"When creating a PCH, stop PCH generation after #pragma hdrstop.">,
5543  MarshallingInfoFlag<PreprocessorOpts<"PCHWithHdrStopCreate">>;
5544def pch_through_hdrstop_use : Flag<["-"], "pch-through-hdrstop-use">,
5545  HelpText<"When using a PCH, skip tokens until after a #pragma hdrstop.">;
5546def fno_pch_timestamp : Flag<["-"], "fno-pch-timestamp">,
5547  HelpText<"Disable inclusion of timestamp in precompiled headers">,
5548  MarshallingInfoNegativeFlag<FrontendOpts<"IncludeTimestamps">>;
5549def building_pch_with_obj : Flag<["-"], "building-pch-with-obj">,
5550  HelpText<"This compilation is part of building a PCH with corresponding object file.">,
5551  MarshallingInfoFlag<LangOpts<"BuildingPCHWithObjectFile">>;
5552
5553def aligned_alloc_unavailable : Flag<["-"], "faligned-alloc-unavailable">,
5554  HelpText<"Aligned allocation/deallocation functions are unavailable">,
5555  MarshallingInfoFlag<LangOpts<"AlignedAllocationUnavailable">>,
5556  ShouldParseIf<faligned_allocation.KeyPath>;
5557
5558//===----------------------------------------------------------------------===//
5559// Language Options
5560//===----------------------------------------------------------------------===//
5561
5562let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
5563
5564def version : Flag<["-"], "version">,
5565  HelpText<"Print the compiler version">,
5566  MarshallingInfoFlag<FrontendOpts<"ShowVersion">>;
5567def main_file_name : Separate<["-"], "main-file-name">,
5568  HelpText<"Main file name to use for debug info and source if missing">,
5569  MarshallingInfoString<CodeGenOpts<"MainFileName">>;
5570def split_dwarf_output : Separate<["-"], "split-dwarf-output">,
5571  HelpText<"File name to use for split dwarf debug info output">,
5572  MarshallingInfoString<CodeGenOpts<"SplitDwarfOutput">>;
5573
5574}
5575
5576def fblocks_runtime_optional : Flag<["-"], "fblocks-runtime-optional">,
5577  HelpText<"Weakly link in the blocks runtime">,
5578  MarshallingInfoFlag<LangOpts<"BlocksRuntimeOptional">>;
5579def fexternc_nounwind : Flag<["-"], "fexternc-nounwind">,
5580  HelpText<"Assume all functions with C linkage do not unwind">,
5581  MarshallingInfoFlag<LangOpts<"ExternCNoUnwind">>;
5582def split_dwarf_file : Separate<["-"], "split-dwarf-file">,
5583  HelpText<"Name of the split dwarf debug info file to encode in the object file">,
5584  MarshallingInfoString<CodeGenOpts<"SplitDwarfFile">>;
5585def fno_wchar : Flag<["-"], "fno-wchar">,
5586  HelpText<"Disable C++ builtin type wchar_t">,
5587  MarshallingInfoNegativeFlag<LangOpts<"WChar">, cplusplus.KeyPath>,
5588  ShouldParseIf<cplusplus.KeyPath>;
5589def fconstant_string_class : Separate<["-"], "fconstant-string-class">,
5590  MetaVarName<"<class name>">,
5591  HelpText<"Specify the class to use for constant Objective-C string objects.">,
5592  MarshallingInfoString<LangOpts<"ObjCConstantStringClass">>;
5593def fobjc_arc_cxxlib_EQ : Joined<["-"], "fobjc-arc-cxxlib=">,
5594  HelpText<"Objective-C++ Automatic Reference Counting standard library kind">, Values<"libc++,libstdc++,none">,
5595  NormalizedValues<["ARCXX_libcxx", "ARCXX_libstdcxx", "ARCXX_nolib"]>,
5596  MarshallingInfoEnum<PreprocessorOpts<"ObjCXXARCStandardLibrary">, "ARCXX_nolib">;
5597def fobjc_runtime_has_weak : Flag<["-"], "fobjc-runtime-has-weak">,
5598  HelpText<"The target Objective-C runtime supports ARC weak operations">;
5599def fobjc_dispatch_method_EQ : Joined<["-"], "fobjc-dispatch-method=">,
5600  HelpText<"Objective-C dispatch method to use">, Values<"legacy,non-legacy,mixed">,
5601  NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["Legacy", "NonLegacy", "Mixed"]>,
5602  MarshallingInfoEnum<CodeGenOpts<"ObjCDispatchMethod">, "Legacy">;
5603def disable_objc_default_synthesize_properties : Flag<["-"], "disable-objc-default-synthesize-properties">,
5604  HelpText<"disable the default synthesis of Objective-C properties">,
5605  MarshallingInfoNegativeFlag<LangOpts<"ObjCDefaultSynthProperties">>;
5606def fencode_extended_block_signature : Flag<["-"], "fencode-extended-block-signature">,
5607  HelpText<"enable extended encoding of block type signature">,
5608  MarshallingInfoFlag<LangOpts<"EncodeExtendedBlockSig">>;
5609def function_alignment : Separate<["-"], "function-alignment">,
5610    HelpText<"default alignment for functions">,
5611    MarshallingInfoInt<LangOpts<"FunctionAlignment">>;
5612def pic_level : Separate<["-"], "pic-level">,
5613  HelpText<"Value for __PIC__">,
5614  MarshallingInfoInt<LangOpts<"PICLevel">>;
5615def pic_is_pie : Flag<["-"], "pic-is-pie">,
5616  HelpText<"File is for a position independent executable">,
5617  MarshallingInfoFlag<LangOpts<"PIE">>;
5618def fhalf_no_semantic_interposition : Flag<["-"], "fhalf-no-semantic-interposition">,
5619  HelpText<"Like -fno-semantic-interposition but don't use local aliases">,
5620  MarshallingInfoFlag<LangOpts<"HalfNoSemanticInterposition">>;
5621def fno_validate_pch : Flag<["-"], "fno-validate-pch">,
5622  HelpText<"Disable validation of precompiled headers">,
5623  MarshallingInfoFlag<PreprocessorOpts<"DisablePCHOrModuleValidation">, "DisableValidationForModuleKind::None">,
5624  Normalizer<"makeFlagToValueNormalizer(DisableValidationForModuleKind::All)">;
5625def fallow_pcm_with_errors : Flag<["-"], "fallow-pcm-with-compiler-errors">,
5626  HelpText<"Accept a PCM file that was created with compiler errors">,
5627  MarshallingInfoFlag<FrontendOpts<"AllowPCMWithCompilerErrors">>;
5628def fallow_pch_with_errors : Flag<["-"], "fallow-pch-with-compiler-errors">,
5629  HelpText<"Accept a PCH file that was created with compiler errors">,
5630  MarshallingInfoFlag<PreprocessorOpts<"AllowPCHWithCompilerErrors">>,
5631  ImpliedByAnyOf<[fallow_pcm_with_errors.KeyPath]>;
5632def fallow_pch_with_different_modules_cache_path :
5633  Flag<["-"], "fallow-pch-with-different-modules-cache-path">,
5634  HelpText<"Accept a PCH file that was created with a different modules cache path">,
5635  MarshallingInfoFlag<PreprocessorOpts<"AllowPCHWithDifferentModulesCachePath">>;
5636def dump_deserialized_pch_decls : Flag<["-"], "dump-deserialized-decls">,
5637  HelpText<"Dump declarations that are deserialized from PCH, for testing">,
5638  MarshallingInfoFlag<PreprocessorOpts<"DumpDeserializedPCHDecls">>;
5639def error_on_deserialized_pch_decl : Separate<["-"], "error-on-deserialized-decl">,
5640  HelpText<"Emit error if a specific declaration is deserialized from PCH, for testing">;
5641def error_on_deserialized_pch_decl_EQ : Joined<["-"], "error-on-deserialized-decl=">,
5642  Alias<error_on_deserialized_pch_decl>;
5643def static_define : Flag<["-"], "static-define">,
5644  HelpText<"Should __STATIC__ be defined">,
5645  MarshallingInfoFlag<LangOpts<"Static">>;
5646def stack_protector : Separate<["-"], "stack-protector">,
5647  HelpText<"Enable stack protectors">, Values<"0,1,2,3">,
5648  NormalizedValuesScope<"LangOptions">,
5649  NormalizedValues<["SSPOff", "SSPOn", "SSPStrong", "SSPReq"]>,
5650  MarshallingInfoEnum<LangOpts<"StackProtector">, "SSPOff">;
5651def stack_protector_buffer_size : Separate<["-"], "stack-protector-buffer-size">,
5652  HelpText<"Lower bound for a buffer to be considered for stack protection">,
5653  MarshallingInfoInt<CodeGenOpts<"SSPBufferSize">, "8">;
5654def fvisibility : Separate<["-"], "fvisibility">,
5655  HelpText<"Default type and symbol visibility">,
5656  MarshallingInfoVisibility<LangOpts<"ValueVisibilityMode">, "DefaultVisibility">,
5657  // Always emitting because of the relation to `-mignore-xcoff-visibility`.
5658  AlwaysEmit;
5659def ftype_visibility : Separate<["-"], "ftype-visibility">,
5660  HelpText<"Default type visibility">,
5661  MarshallingInfoVisibility<LangOpts<"TypeVisibilityMode">, fvisibility.KeyPath>;
5662def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-to-externs">,
5663  HelpText<"Apply global symbol visibility to external declarations without an explicit visibility">,
5664  MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
5665def ftemplate_depth : Separate<["-"], "ftemplate-depth">,
5666  HelpText<"Maximum depth of recursive template instantiation">,
5667  MarshallingInfoInt<LangOpts<"InstantiationDepth">, "1024">;
5668def foperator_arrow_depth : Separate<["-"], "foperator-arrow-depth">,
5669  HelpText<"Maximum number of 'operator->'s to call for a member access">,
5670  MarshallingInfoInt<LangOpts<"ArrowDepth">, "256">;
5671def fconstexpr_depth : Separate<["-"], "fconstexpr-depth">,
5672  HelpText<"Maximum depth of recursive constexpr function calls">,
5673  MarshallingInfoInt<LangOpts<"ConstexprCallDepth">, "512">;
5674def fconstexpr_steps : Separate<["-"], "fconstexpr-steps">,
5675  HelpText<"Maximum number of steps in constexpr function evaluation">,
5676  MarshallingInfoInt<LangOpts<"ConstexprStepLimit">, "1048576">;
5677def fbracket_depth : Separate<["-"], "fbracket-depth">,
5678  HelpText<"Maximum nesting level for parentheses, brackets, and braces">,
5679  MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
5680defm const_strings : BoolOption<"f", "const-strings",
5681  LangOpts<"ConstStrings">, DefaultFalse,
5682  PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
5683  BothFlags<[], " a const qualified type for string literals in C and ObjC">>;
5684def fno_bitfield_type_align : Flag<["-"], "fno-bitfield-type-align">,
5685  HelpText<"Ignore bit-field types when aligning structures">,
5686  MarshallingInfoFlag<LangOpts<"NoBitFieldTypeAlign">>;
5687def ffake_address_space_map : Flag<["-"], "ffake-address-space-map">,
5688  HelpText<"Use a fake address space map; OpenCL testing purposes only">,
5689  MarshallingInfoFlag<LangOpts<"FakeAddressSpaceMap">>;
5690def faddress_space_map_mangling_EQ : Joined<["-"], "faddress-space-map-mangling=">, MetaVarName<"<yes|no|target>">,
5691  HelpText<"Set the mode for address space map based mangling; OpenCL testing purposes only">,
5692  Values<"target,no,yes">, NormalizedValuesScope<"LangOptions">,
5693  NormalizedValues<["ASMM_Target", "ASMM_Off", "ASMM_On"]>,
5694  MarshallingInfoEnum<LangOpts<"AddressSpaceMapMangling">, "ASMM_Target">;
5695def funknown_anytype : Flag<["-"], "funknown-anytype">,
5696  HelpText<"Enable parser support for the __unknown_anytype type; for testing purposes only">,
5697  MarshallingInfoFlag<LangOpts<"ParseUnknownAnytype">>;
5698def fdebugger_support : Flag<["-"], "fdebugger-support">,
5699  HelpText<"Enable special debugger support behavior">,
5700  MarshallingInfoFlag<LangOpts<"DebuggerSupport">>;
5701def fdebugger_cast_result_to_id : Flag<["-"], "fdebugger-cast-result-to-id">,
5702  HelpText<"Enable casting unknown expression results to id">,
5703  MarshallingInfoFlag<LangOpts<"DebuggerCastResultToId">>;
5704def fdebugger_objc_literal : Flag<["-"], "fdebugger-objc-literal">,
5705  HelpText<"Enable special debugger support for Objective-C subscripting and literals">,
5706  MarshallingInfoFlag<LangOpts<"DebuggerObjCLiteral">>;
5707defm deprecated_macro : BoolOption<"f", "deprecated-macro",
5708  LangOpts<"Deprecated">, DefaultFalse,
5709  PosFlag<SetTrue, [], "Defines">, NegFlag<SetFalse, [], "Undefines">,
5710  BothFlags<[], " the __DEPRECATED macro">>;
5711def fobjc_subscripting_legacy_runtime : Flag<["-"], "fobjc-subscripting-legacy-runtime">,
5712  HelpText<"Allow Objective-C array and dictionary subscripting in legacy runtime">;
5713// TODO: Enforce values valid for MSVtorDispMode.
5714def vtordisp_mode_EQ : Joined<["-"], "vtordisp-mode=">,
5715  HelpText<"Control vtordisp placement on win32 targets">,
5716  MarshallingInfoInt<LangOpts<"VtorDispMode">, "1">;
5717def fnative_half_type: Flag<["-"], "fnative-half-type">,
5718  HelpText<"Use the native half type for __fp16 instead of promoting to float">,
5719  MarshallingInfoFlag<LangOpts<"NativeHalfType">>,
5720  ImpliedByAnyOf<[open_cl.KeyPath, render_script.KeyPath]>;
5721def fnative_half_arguments_and_returns : Flag<["-"], "fnative-half-arguments-and-returns">,
5722  HelpText<"Use the native __fp16 type for arguments and returns (and skip ABI-specific lowering)">,
5723  MarshallingInfoFlag<LangOpts<"NativeHalfArgsAndReturns">>,
5724  ImpliedByAnyOf<[open_cl.KeyPath, render_script.KeyPath]>;
5725def fallow_half_arguments_and_returns : Flag<["-"], "fallow-half-arguments-and-returns">,
5726  HelpText<"Allow function arguments and returns of type half">,
5727  MarshallingInfoFlag<LangOpts<"HalfArgsAndReturns">>,
5728  ImpliedByAnyOf<[fnative_half_arguments_and_returns.KeyPath]>;
5729def fdefault_calling_conv_EQ : Joined<["-"], "fdefault-calling-conv=">,
5730  HelpText<"Set default calling convention">, Values<"cdecl,fastcall,stdcall,vectorcall,regcall">,
5731  NormalizedValuesScope<"LangOptions">,
5732  NormalizedValues<["DCC_CDecl", "DCC_FastCall", "DCC_StdCall", "DCC_VectorCall", "DCC_RegCall"]>,
5733  MarshallingInfoEnum<LangOpts<"DefaultCallingConv">, "DCC_None">;
5734
5735// These options cannot be marshalled, because they are used to set up the LangOptions defaults.
5736def finclude_default_header : Flag<["-"], "finclude-default-header">,
5737  HelpText<"Include default header file for OpenCL">;
5738def fdeclare_opencl_builtins : Flag<["-"], "fdeclare-opencl-builtins">,
5739  HelpText<"Add OpenCL builtin function declarations (experimental)">;
5740
5741def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">,
5742  HelpText<"Preserve 3-component vector type">,
5743  MarshallingInfoFlag<CodeGenOpts<"PreserveVec3Type">>;
5744def fwchar_type_EQ : Joined<["-"], "fwchar-type=">,
5745  HelpText<"Select underlying type for wchar_t">, Values<"char,short,int">,
5746  NormalizedValues<["1", "2", "4"]>,
5747  MarshallingInfoEnum<LangOpts<"WCharSize">, "0">;
5748defm signed_wchar : BoolOption<"f", "signed-wchar",
5749  LangOpts<"WCharIsSigned">, DefaultTrue,
5750  NegFlag<SetFalse, [CC1Option], "Use an unsigned">, PosFlag<SetTrue, [], "Use a signed">,
5751  BothFlags<[], " type for wchar_t">>;
5752def fcompatibility_qualified_id_block_param_type_checking : Flag<["-"], "fcompatibility-qualified-id-block-type-checking">,
5753  HelpText<"Allow using blocks with parameters of more specific type than "
5754           "the type system guarantees when a parameter is qualified id">,
5755  MarshallingInfoFlag<LangOpts<"CompatibilityQualifiedIdBlockParamTypeChecking">>;
5756def fpass_by_value_is_noalias: Flag<["-"], "fpass-by-value-is-noalias">,
5757  HelpText<"Allows assuming by-value parameters do not alias any other value. "
5758           "Has no effect on non-trivially-copyable classes in C++.">, Group<f_Group>,
5759  MarshallingInfoFlag<CodeGenOpts<"PassByValueIsNoAlias">>;
5760
5761// FIXME: Remove these entirely once functionality/tests have been excised.
5762def fobjc_gc_only : Flag<["-"], "fobjc-gc-only">, Group<f_Group>,
5763  HelpText<"Use GC exclusively for Objective-C related memory management">;
5764def fobjc_gc : Flag<["-"], "fobjc-gc">, Group<f_Group>,
5765  HelpText<"Enable Objective-C garbage collection">;
5766
5767//===----------------------------------------------------------------------===//
5768// Header Search Options
5769//===----------------------------------------------------------------------===//
5770
5771def nostdsysteminc : Flag<["-"], "nostdsysteminc">,
5772  HelpText<"Disable standard system #include directories">,
5773  MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardSystemIncludes">>;
5774def fdisable_module_hash : Flag<["-"], "fdisable-module-hash">,
5775  HelpText<"Disable the module hash">,
5776  MarshallingInfoFlag<HeaderSearchOpts<"DisableModuleHash">>;
5777def fmodules_hash_content : Flag<["-"], "fmodules-hash-content">,
5778  HelpText<"Enable hashing the content of a module file">,
5779  MarshallingInfoFlag<HeaderSearchOpts<"ModulesHashContent">>;
5780def fmodules_strict_context_hash : Flag<["-"], "fmodules-strict-context-hash">,
5781  HelpText<"Enable hashing of all compiler options that could impact the "
5782           "semantics of a module in an implicit build">,
5783  MarshallingInfoFlag<HeaderSearchOpts<"ModulesStrictContextHash">>;
5784def c_isystem : JoinedOrSeparate<["-"], "c-isystem">, MetaVarName<"<directory>">,
5785  HelpText<"Add directory to the C SYSTEM include search path">;
5786def objc_isystem : JoinedOrSeparate<["-"], "objc-isystem">,
5787  MetaVarName<"<directory>">,
5788  HelpText<"Add directory to the ObjC SYSTEM include search path">;
5789def objcxx_isystem : JoinedOrSeparate<["-"], "objcxx-isystem">,
5790  MetaVarName<"<directory>">,
5791  HelpText<"Add directory to the ObjC++ SYSTEM include search path">;
5792def internal_isystem : JoinedOrSeparate<["-"], "internal-isystem">,
5793  MetaVarName<"<directory>">,
5794  HelpText<"Add directory to the internal system include search path; these "
5795           "are assumed to not be user-provided and are used to model system "
5796           "and standard headers' paths.">;
5797def internal_externc_isystem : JoinedOrSeparate<["-"], "internal-externc-isystem">,
5798  MetaVarName<"<directory>">,
5799  HelpText<"Add directory to the internal system include search path with "
5800           "implicit extern \"C\" semantics; these are assumed to not be "
5801           "user-provided and are used to model system and standard headers' "
5802           "paths.">;
5803
5804//===----------------------------------------------------------------------===//
5805// Preprocessor Options
5806//===----------------------------------------------------------------------===//
5807
5808def chain_include : Separate<["-"], "chain-include">, MetaVarName<"<file>">,
5809  HelpText<"Include and chain a header file after turning it into PCH">;
5810def preamble_bytes_EQ : Joined<["-"], "preamble-bytes=">,
5811  HelpText<"Assume that the precompiled header is a precompiled preamble "
5812           "covering the first N bytes of the main file">;
5813def detailed_preprocessing_record : Flag<["-"], "detailed-preprocessing-record">,
5814  HelpText<"include a detailed record of preprocessing actions">,
5815  MarshallingInfoFlag<PreprocessorOpts<"DetailedRecord">>;
5816def setup_static_analyzer : Flag<["-"], "setup-static-analyzer">,
5817  HelpText<"Set up preprocessor for static analyzer (done automatically when static analyzer is run).">,
5818  MarshallingInfoFlag<PreprocessorOpts<"SetUpStaticAnalyzer">>;
5819def disable_pragma_debug_crash : Flag<["-"], "disable-pragma-debug-crash">,
5820  HelpText<"Disable any #pragma clang __debug that can lead to crashing behavior. This is meant for testing.">,
5821  MarshallingInfoFlag<PreprocessorOpts<"DisablePragmaDebugCrash">>;
5822
5823//===----------------------------------------------------------------------===//
5824// OpenCL Options
5825//===----------------------------------------------------------------------===//
5826
5827def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">,
5828  HelpText<"OpenCL only. Enable or disable OpenCL extensions. The argument is a comma-separated sequence of one or more extension names, each prefixed by '+' or '-'.">,
5829  MarshallingInfoStringVector<TargetOpts<"OpenCLExtensionsAsWritten">>;
5830
5831//===----------------------------------------------------------------------===//
5832// CUDA Options
5833//===----------------------------------------------------------------------===//
5834
5835def fcuda_is_device : Flag<["-"], "fcuda-is-device">,
5836  HelpText<"Generate code for CUDA device">,
5837  MarshallingInfoFlag<LangOpts<"CUDAIsDevice">>;
5838def fcuda_include_gpubinary : Separate<["-"], "fcuda-include-gpubinary">,
5839  HelpText<"Incorporate CUDA device-side binary into host object file.">,
5840  MarshallingInfoString<CodeGenOpts<"CudaGpuBinaryFileName">>;
5841def fcuda_allow_variadic_functions : Flag<["-"], "fcuda-allow-variadic-functions">,
5842  HelpText<"Allow variadic functions in CUDA device code.">,
5843  MarshallingInfoFlag<LangOpts<"CUDAAllowVariadicFunctions">>;
5844def fno_cuda_host_device_constexpr : Flag<["-"], "fno-cuda-host-device-constexpr">,
5845  HelpText<"Don't treat unattributed constexpr functions as __host__ __device__.">,
5846  MarshallingInfoNegativeFlag<LangOpts<"CUDAHostDeviceConstexpr">>;
5847
5848//===----------------------------------------------------------------------===//
5849// OpenMP Options
5850//===----------------------------------------------------------------------===//
5851
5852def fopenmp_is_device : Flag<["-"], "fopenmp-is-device">,
5853  HelpText<"Generate code only for an OpenMP target device.">;
5854def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
5855  HelpText<"Path to the IR file produced by the frontend for the host.">;
5856
5857//===----------------------------------------------------------------------===//
5858// SYCL Options
5859//===----------------------------------------------------------------------===//
5860
5861def fsycl_is_device : Flag<["-"], "fsycl-is-device">,
5862  HelpText<"Generate code for SYCL device.">,
5863  MarshallingInfoFlag<LangOpts<"SYCLIsDevice">>;
5864def fsycl_is_host : Flag<["-"], "fsycl-is-host">,
5865  HelpText<"SYCL host compilation">,
5866  MarshallingInfoFlag<LangOpts<"SYCLIsHost">>;
5867
5868} // let Flags = [CC1Option, NoDriverOption]
5869
5870def sycl_std_EQ : Joined<["-"], "sycl-std=">, Group<sycl_Group>,
5871  Flags<[CC1Option, NoArgumentUnused, CoreOption]>,
5872  HelpText<"SYCL language standard to compile for.">,
5873  Values<"2020,2017,121,1.2.1,sycl-1.2.1">,
5874  NormalizedValues<["SYCL_2020", "SYCL_2017", "SYCL_2017", "SYCL_2017", "SYCL_2017"]>,
5875  NormalizedValuesScope<"LangOptions">,
5876  MarshallingInfoEnum<LangOpts<"SYCLVersion">, "SYCL_None">,
5877  ShouldParseIf<!strconcat(fsycl_is_device.KeyPath, "||", fsycl_is_host.KeyPath)>;
5878
5879defm cuda_approx_transcendentals : BoolFOption<"cuda-approx-transcendentals",
5880  LangOpts<"CUDADeviceApproxTranscendentals">, DefaultFalse,
5881  PosFlag<SetTrue, [CC1Option], "Use">, NegFlag<SetFalse, [], "Don't use">,
5882  BothFlags<[], " approximate transcendental functions">>,
5883  ShouldParseIf<fcuda_is_device.KeyPath>;
5884
5885//===----------------------------------------------------------------------===//
5886// Frontend Options - cc1 + fc1
5887//===----------------------------------------------------------------------===//
5888let Flags = [CC1Option, FC1Option, NoDriverOption] in {
5889let Group = Action_Group in {
5890
5891def emit_obj : Flag<["-"], "emit-obj">,
5892  HelpText<"Emit native object files">;
5893def init_only : Flag<["-"], "init-only">,
5894  HelpText<"Only execute frontend initialization">;
5895
5896} // let Group = Action_Group
5897
5898def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">,
5899  HelpText<"Load the named plugin (dynamic shared object)">;
5900def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">,
5901  HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">;
5902
5903} // let Flags = [CC1Option, FC1Option, NoDriverOption]
5904
5905//===----------------------------------------------------------------------===//
5906// cc1as-only Options
5907//===----------------------------------------------------------------------===//
5908
5909let Flags = [CC1AsOption, NoDriverOption] in {
5910
5911// Language Options
5912def n : Flag<["-"], "n">,
5913  HelpText<"Don't automatically start assembly file with a text section">;
5914
5915// Frontend Options
5916def filetype : Separate<["-"], "filetype">,
5917    HelpText<"Specify the output file type ('asm', 'null', or 'obj')">;
5918
5919// Transliterate Options
5920def output_asm_variant : Separate<["-"], "output-asm-variant">,
5921    HelpText<"Select the asm variant index to use for output">;
5922def show_encoding : Flag<["-"], "show-encoding">,
5923    HelpText<"Show instruction encoding information in transliterate mode">;
5924def show_inst : Flag<["-"], "show-inst">,
5925    HelpText<"Show internal instruction representation in transliterate mode">;
5926
5927// Assemble Options
5928def dwarf_debug_producer : Separate<["-"], "dwarf-debug-producer">,
5929  HelpText<"The string to embed in the Dwarf debug AT_producer record.">;
5930
5931def defsym : Separate<["-"], "defsym">,
5932  HelpText<"Define a value for a symbol">;
5933
5934} // let Flags = [CC1AsOption]
5935
5936//===----------------------------------------------------------------------===//
5937// clang-cl Options
5938//===----------------------------------------------------------------------===//
5939
5940def cl_Group : OptionGroup<"<clang-cl options>">, Flags<[CLOption]>,
5941  HelpText<"CL.EXE COMPATIBILITY OPTIONS">;
5942
5943def cl_compile_Group : OptionGroup<"<clang-cl compile-only options>">,
5944  Group<cl_Group>;
5945
5946def cl_ignored_Group : OptionGroup<"<clang-cl ignored options>">,
5947  Group<cl_Group>;
5948
5949class CLFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
5950  Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
5951
5952class CLCompileFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
5953  Group<cl_compile_Group>, Flags<[CLOption, NoXarchOption]>;
5954
5955class CLIgnoredFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
5956  Group<cl_ignored_Group>, Flags<[CLOption, NoXarchOption]>;
5957
5958class CLJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
5959  Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
5960
5961class CLCompileJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
5962  Group<cl_compile_Group>, Flags<[CLOption, NoXarchOption]>;
5963
5964class CLIgnoredJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
5965  Group<cl_ignored_Group>, Flags<[CLOption, NoXarchOption, HelpHidden]>;
5966
5967class CLJoinedOrSeparate<string name> : Option<["/", "-"], name,
5968  KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
5969
5970class CLCompileJoinedOrSeparate<string name> : Option<["/", "-"], name,
5971  KIND_JOINED_OR_SEPARATE>, Group<cl_compile_Group>,
5972  Flags<[CLOption, NoXarchOption]>;
5973
5974class CLRemainingArgsJoined<string name> : Option<["/", "-"], name,
5975  KIND_REMAINING_ARGS_JOINED>, Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
5976
5977// Aliases:
5978// (We don't put any of these in cl_compile_Group as the options they alias are
5979// already in the right group.)
5980
5981def _SLASH_Brepro : CLFlag<"Brepro">,
5982  HelpText<"Do not write current time into COFF output (breaks link.exe /incremental)">,
5983  Alias<mno_incremental_linker_compatible>;
5984def _SLASH_Brepro_ : CLFlag<"Brepro-">,
5985  HelpText<"Write current time into COFF output (default)">,
5986  Alias<mincremental_linker_compatible>;
5987def _SLASH_C : CLFlag<"C">,
5988  HelpText<"Do not discard comments when preprocessing">, Alias<C>;
5989def _SLASH_c : CLFlag<"c">, HelpText<"Compile only">, Alias<c>;
5990def _SLASH_d1PP : CLFlag<"d1PP">,
5991  HelpText<"Retain macro definitions in /E mode">, Alias<dD>;
5992def _SLASH_d1reportAllClassLayout : CLFlag<"d1reportAllClassLayout">,
5993  HelpText<"Dump record layout information">,
5994  Alias<Xclang>, AliasArgs<["-fdump-record-layouts"]>;
5995def _SLASH_diagnostics_caret : CLFlag<"diagnostics:caret">,
5996  HelpText<"Enable caret and column diagnostics (default)">;
5997def _SLASH_diagnostics_column : CLFlag<"diagnostics:column">,
5998  HelpText<"Disable caret diagnostics but keep column info">;
5999def _SLASH_diagnostics_classic : CLFlag<"diagnostics:classic">,
6000  HelpText<"Disable column and caret diagnostics">;
6001def _SLASH_D : CLJoinedOrSeparate<"D">, HelpText<"Define macro">,
6002  MetaVarName<"<macro[=value]>">, Alias<D>;
6003def _SLASH_E : CLFlag<"E">, HelpText<"Preprocess to stdout">, Alias<E>;
6004def _SLASH_external_COLON_I : CLJoinedOrSeparate<"external:I">, Alias<isystem>,
6005  HelpText<"Add directory to include search path with warnings suppressed">,
6006  MetaVarName<"<dir>">;
6007def _SLASH_fp_except : CLFlag<"fp:except">, HelpText<"">, Alias<ftrapping_math>;
6008def _SLASH_fp_except_ : CLFlag<"fp:except-">,
6009  HelpText<"">, Alias<fno_trapping_math>;
6010def _SLASH_fp_fast : CLFlag<"fp:fast">, HelpText<"">, Alias<ffast_math>;
6011def _SLASH_fp_precise : CLFlag<"fp:precise">,
6012  HelpText<"">, Alias<fno_fast_math>;
6013def _SLASH_fp_strict : CLFlag<"fp:strict">, HelpText<"">, Alias<fno_fast_math>;
6014def _SLASH_fsanitize_EQ_address : CLFlag<"fsanitize=address">,
6015  HelpText<"Enable AddressSanitizer">,
6016  Alias<fsanitize_EQ>, AliasArgs<["address"]>;
6017def _SLASH_GA : CLFlag<"GA">, Alias<ftlsmodel_EQ>, AliasArgs<["local-exec"]>,
6018  HelpText<"Assume thread-local variables are defined in the executable">;
6019def _SLASH_GR : CLFlag<"GR">, HelpText<"Emit RTTI data (default)">;
6020def _SLASH_GR_ : CLFlag<"GR-">, HelpText<"Do not emit RTTI data">;
6021def _SLASH_GF : CLIgnoredFlag<"GF">,
6022  HelpText<"Enable string pooling (default)">;
6023def _SLASH_GF_ : CLFlag<"GF-">, HelpText<"Disable string pooling">,
6024  Alias<fwritable_strings>;
6025def _SLASH_GS : CLFlag<"GS">,
6026  HelpText<"Enable buffer security check (default)">;
6027def _SLASH_GS_ : CLFlag<"GS-">, HelpText<"Disable buffer security check">;
6028def : CLFlag<"Gs">, HelpText<"Use stack probes (default)">,
6029  Alias<mstack_probe_size>, AliasArgs<["4096"]>;
6030def _SLASH_Gs : CLJoined<"Gs">,
6031  HelpText<"Set stack probe size (default 4096)">, Alias<mstack_probe_size>;
6032def _SLASH_Gy : CLFlag<"Gy">, HelpText<"Put each function in its own section">,
6033  Alias<ffunction_sections>;
6034def _SLASH_Gy_ : CLFlag<"Gy-">,
6035  HelpText<"Do not put each function in its own section (default)">,
6036  Alias<fno_function_sections>;
6037def _SLASH_Gw : CLFlag<"Gw">, HelpText<"Put each data item in its own section">,
6038  Alias<fdata_sections>;
6039def _SLASH_Gw_ : CLFlag<"Gw-">,
6040  HelpText<"Do not put each data item in its own section (default)">,
6041  Alias<fno_data_sections>;
6042def _SLASH_help : CLFlag<"help">, Alias<help>,
6043  HelpText<"Display available options">;
6044def _SLASH_HELP : CLFlag<"HELP">, Alias<help>;
6045def _SLASH_I : CLJoinedOrSeparate<"I">,
6046  HelpText<"Add directory to include search path">, MetaVarName<"<dir>">,
6047  Alias<I>;
6048def _SLASH_J : CLFlag<"J">, HelpText<"Make char type unsigned">,
6049  Alias<funsigned_char>;
6050
6051// The _SLASH_O option handles all the /O flags, but we also provide separate
6052// aliased options to provide separate help messages.
6053def _SLASH_O : CLJoined<"O">,
6054  HelpText<"Set multiple /O flags at once; e.g. '/O2y-' for '/O2 /Oy-'">,
6055  MetaVarName<"<flags>">;
6056def : CLFlag<"O1">, Alias<_SLASH_O>, AliasArgs<["1"]>,
6057  HelpText<"Optimize for size  (like /Og     /Os /Oy /Ob2 /GF /Gy)">;
6058def : CLFlag<"O2">, Alias<_SLASH_O>, AliasArgs<["2"]>,
6059  HelpText<"Optimize for speed (like /Og /Oi /Ot /Oy /Ob2 /GF /Gy)">;
6060def : CLFlag<"Ob0">, Alias<_SLASH_O>, AliasArgs<["b0"]>,
6061  HelpText<"Disable function inlining">;
6062def : CLFlag<"Ob1">, Alias<_SLASH_O>, AliasArgs<["b1"]>,
6063  HelpText<"Only inline functions explicitly or implicitly marked inline">;
6064def : CLFlag<"Ob2">, Alias<_SLASH_O>, AliasArgs<["b2"]>,
6065  HelpText<"Inline functions as deemed beneficial by the compiler">;
6066def : CLFlag<"Od">, Alias<_SLASH_O>, AliasArgs<["d"]>,
6067  HelpText<"Disable optimization">;
6068def : CLFlag<"Og">, Alias<_SLASH_O>, AliasArgs<["g"]>,
6069  HelpText<"No effect">;
6070def : CLFlag<"Oi">, Alias<_SLASH_O>, AliasArgs<["i"]>,
6071  HelpText<"Enable use of builtin functions">;
6072def : CLFlag<"Oi-">, Alias<_SLASH_O>, AliasArgs<["i-"]>,
6073  HelpText<"Disable use of builtin functions">;
6074def : CLFlag<"Os">, Alias<_SLASH_O>, AliasArgs<["s"]>,
6075  HelpText<"Optimize for size">;
6076def : CLFlag<"Ot">, Alias<_SLASH_O>, AliasArgs<["t"]>,
6077  HelpText<"Optimize for speed">;
6078def : CLFlag<"Ox">, Alias<_SLASH_O>, AliasArgs<["x"]>,
6079  HelpText<"Deprecated (like /Og /Oi /Ot /Oy /Ob2); use /O2">;
6080def : CLFlag<"Oy">, Alias<_SLASH_O>, AliasArgs<["y"]>,
6081  HelpText<"Enable frame pointer omission (x86 only)">;
6082def : CLFlag<"Oy-">, Alias<_SLASH_O>, AliasArgs<["y-"]>,
6083  HelpText<"Disable frame pointer omission (x86 only, default)">;
6084
6085def _SLASH_QUESTION : CLFlag<"?">, Alias<help>,
6086  HelpText<"Display available options">;
6087def _SLASH_Qvec : CLFlag<"Qvec">,
6088  HelpText<"Enable the loop vectorization passes">, Alias<fvectorize>;
6089def _SLASH_Qvec_ : CLFlag<"Qvec-">,
6090  HelpText<"Disable the loop vectorization passes">, Alias<fno_vectorize>;
6091def _SLASH_showIncludes : CLFlag<"showIncludes">,
6092  HelpText<"Print info about included files to stderr">;
6093def _SLASH_showIncludes_user : CLFlag<"showIncludes:user">,
6094  HelpText<"Like /showIncludes but omit system headers">;
6095def _SLASH_showFilenames : CLFlag<"showFilenames">,
6096  HelpText<"Print the name of each compiled file">;
6097def _SLASH_showFilenames_ : CLFlag<"showFilenames-">,
6098  HelpText<"Do not print the name of each compiled file (default)">;
6099def _SLASH_source_charset : CLCompileJoined<"source-charset:">,
6100  HelpText<"Set source encoding, supports only UTF-8">,
6101  Alias<finput_charset_EQ>;
6102def _SLASH_execution_charset : CLCompileJoined<"execution-charset:">,
6103  HelpText<"Set runtime encoding, supports only UTF-8">,
6104  Alias<fexec_charset_EQ>;
6105def _SLASH_std : CLCompileJoined<"std:">,
6106  HelpText<"Set language version (c++14,c++17,c++20,c++latest,c11,c17)">;
6107def _SLASH_U : CLJoinedOrSeparate<"U">, HelpText<"Undefine macro">,
6108  MetaVarName<"<macro>">, Alias<U>;
6109def _SLASH_validate_charset : CLFlag<"validate-charset">,
6110  Alias<W_Joined>, AliasArgs<["invalid-source-encoding"]>;
6111def _SLASH_validate_charset_ : CLFlag<"validate-charset-">,
6112  Alias<W_Joined>, AliasArgs<["no-invalid-source-encoding"]>;
6113def _SLASH_W0 : CLFlag<"W0">, HelpText<"Disable all warnings">, Alias<w>;
6114def _SLASH_W1 : CLFlag<"W1">, HelpText<"Enable -Wall">, Alias<Wall>;
6115def _SLASH_W2 : CLFlag<"W2">, HelpText<"Enable -Wall">, Alias<Wall>;
6116def _SLASH_W3 : CLFlag<"W3">, HelpText<"Enable -Wall">, Alias<Wall>;
6117def _SLASH_W4 : CLFlag<"W4">, HelpText<"Enable -Wall and -Wextra">, Alias<WCL4>;
6118def _SLASH_Wall : CLFlag<"Wall">, HelpText<"Enable -Weverything">,
6119  Alias<W_Joined>, AliasArgs<["everything"]>;
6120def _SLASH_WX : CLFlag<"WX">, HelpText<"Treat warnings as errors">,
6121  Alias<W_Joined>, AliasArgs<["error"]>;
6122def _SLASH_WX_ : CLFlag<"WX-">,
6123  HelpText<"Do not treat warnings as errors (default)">,
6124  Alias<W_Joined>, AliasArgs<["no-error"]>;
6125def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias<w>;
6126def _SLASH_wd : CLCompileJoined<"wd">;
6127def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
6128  Alias<vtordisp_mode_EQ>;
6129def _SLASH_X : CLFlag<"X">,
6130  HelpText<"Do not add %INCLUDE% to include search path">, Alias<nostdlibinc>;
6131def _SLASH_Zc_sizedDealloc : CLFlag<"Zc:sizedDealloc">,
6132  HelpText<"Enable C++14 sized global deallocation functions">,
6133  Alias<fsized_deallocation>;
6134def _SLASH_Zc_sizedDealloc_ : CLFlag<"Zc:sizedDealloc-">,
6135  HelpText<"Disable C++14 sized global deallocation functions">,
6136  Alias<fno_sized_deallocation>;
6137def _SLASH_Zc_alignedNew : CLFlag<"Zc:alignedNew">,
6138  HelpText<"Enable C++17 aligned allocation functions">,
6139  Alias<faligned_allocation>;
6140def _SLASH_Zc_alignedNew_ : CLFlag<"Zc:alignedNew-">,
6141  HelpText<"Disable C++17 aligned allocation functions">,
6142  Alias<fno_aligned_allocation>;
6143def _SLASH_Zc_char8_t : CLFlag<"Zc:char8_t">,
6144  HelpText<"Enable char8_t from C++2a">,
6145  Alias<fchar8__t>;
6146def _SLASH_Zc_char8_t_ : CLFlag<"Zc:char8_t-">,
6147  HelpText<"Disable char8_t from c++2a">,
6148  Alias<fno_char8__t>;
6149def _SLASH_Zc_strictStrings : CLFlag<"Zc:strictStrings">,
6150  HelpText<"Treat string literals as const">, Alias<W_Joined>,
6151  AliasArgs<["error=c++11-compat-deprecated-writable-strings"]>;
6152def _SLASH_Zc_threadSafeInit : CLFlag<"Zc:threadSafeInit">,
6153  HelpText<"Enable thread-safe initialization of static variables">,
6154  Alias<fthreadsafe_statics>;
6155def _SLASH_Zc_threadSafeInit_ : CLFlag<"Zc:threadSafeInit-">,
6156  HelpText<"Disable thread-safe initialization of static variables">,
6157  Alias<fno_threadsafe_statics>;
6158def _SLASH_Zc_trigraphs : CLFlag<"Zc:trigraphs">,
6159  HelpText<"Enable trigraphs">, Alias<ftrigraphs>;
6160def _SLASH_Zc_trigraphs_off : CLFlag<"Zc:trigraphs-">,
6161  HelpText<"Disable trigraphs (default)">, Alias<fno_trigraphs>;
6162def _SLASH_Zc_twoPhase : CLFlag<"Zc:twoPhase">,
6163  HelpText<"Enable two-phase name lookup in templates">,
6164  Alias<fno_delayed_template_parsing>;
6165def _SLASH_Zc_twoPhase_ : CLFlag<"Zc:twoPhase-">,
6166  HelpText<"Disable two-phase name lookup in templates (default)">,
6167  Alias<fdelayed_template_parsing>;
6168def _SLASH_Z7 : CLFlag<"Z7">,
6169  HelpText<"Enable CodeView debug information in object files">;
6170def _SLASH_Zi : CLFlag<"Zi">, Alias<_SLASH_Z7>,
6171  HelpText<"Like /Z7">;
6172def _SLASH_Zp : CLJoined<"Zp">,
6173  HelpText<"Set default maximum struct packing alignment">,
6174  Alias<fpack_struct_EQ>;
6175def _SLASH_Zp_flag : CLFlag<"Zp">,
6176  HelpText<"Set default maximum struct packing alignment to 1">,
6177  Alias<fpack_struct_EQ>, AliasArgs<["1"]>;
6178def _SLASH_Zs : CLFlag<"Zs">, HelpText<"Syntax-check only">,
6179  Alias<fsyntax_only>;
6180def _SLASH_openmp_ : CLFlag<"openmp-">,
6181  HelpText<"Disable OpenMP support">, Alias<fno_openmp>;
6182def _SLASH_openmp : CLFlag<"openmp">, HelpText<"Enable OpenMP support">,
6183  Alias<fopenmp>;
6184def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">,
6185  HelpText<"Enable OpenMP support with experimental SIMD support">,
6186  Alias<fopenmp>;
6187def _SLASH_tune : CLCompileJoined<"tune:">,
6188  HelpText<"Set CPU for optimization without affecting instruction set">,
6189  Alias<mtune_EQ>;
6190def _SLASH_QIntel_jcc_erratum : CLFlag<"QIntel-jcc-erratum">,
6191  HelpText<"Align branches within 32-byte boundaries to mitigate the performance impact of the Intel JCC erratum.">,
6192  Alias<mbranches_within_32B_boundaries>;
6193
6194// Non-aliases:
6195
6196def _SLASH_arch : CLCompileJoined<"arch:">,
6197  HelpText<"Set architecture for code generation">;
6198
6199def _SLASH_M_Group : OptionGroup<"</M group>">, Group<cl_compile_Group>;
6200def _SLASH_volatile_Group : OptionGroup<"</volatile group>">,
6201  Group<cl_compile_Group>;
6202
6203def _SLASH_EH : CLJoined<"EH">, HelpText<"Set exception handling model">;
6204def _SLASH_EP : CLFlag<"EP">,
6205  HelpText<"Disable linemarker output and preprocess to stdout">;
6206def _SLASH_external_env : CLJoined<"external:env:">,
6207  HelpText<"Add dirs in env var <var> to include search path with warnings suppressed">,
6208  MetaVarName<"<var>">;
6209def _SLASH_FA : CLFlag<"FA">,
6210  HelpText<"Output assembly code file during compilation">;
6211def _SLASH_Fa : CLJoined<"Fa">,
6212  HelpText<"Set assembly output file name (with /FA)">,
6213  MetaVarName<"<file or dir/>">;
6214def _SLASH_FI : CLJoinedOrSeparate<"FI">,
6215  HelpText<"Include file before parsing">, Alias<include_>;
6216def _SLASH_Fe : CLJoined<"Fe">,
6217  HelpText<"Set output executable file name">,
6218  MetaVarName<"<file or dir/>">;
6219def _SLASH_Fe_COLON : CLJoined<"Fe:">, Alias<_SLASH_Fe>;
6220def _SLASH_Fi : CLCompileJoined<"Fi">,
6221  HelpText<"Set preprocess output file name (with /P)">,
6222  MetaVarName<"<file>">;
6223def _SLASH_Fo : CLCompileJoined<"Fo">,
6224  HelpText<"Set output object file (with /c)">,
6225  MetaVarName<"<file or dir/>">;
6226def _SLASH_guard : CLJoined<"guard:">,
6227  HelpText<"Enable Control Flow Guard with /guard:cf, or only the table with /guard:cf,nochecks. "
6228           "Enable EH Continuation Guard with /guard:ehcont">;
6229def _SLASH_GX : CLFlag<"GX">,
6230  HelpText<"Deprecated; use /EHsc">;
6231def _SLASH_GX_ : CLFlag<"GX-">,
6232  HelpText<"Deprecated (like not passing /EH)">;
6233def _SLASH_imsvc : CLJoinedOrSeparate<"imsvc">,
6234  HelpText<"Add <dir> to system include search path, as if in %INCLUDE%">,
6235  MetaVarName<"<dir>">;
6236def _SLASH_LD : CLFlag<"LD">, HelpText<"Create DLL">;
6237def _SLASH_LDd : CLFlag<"LDd">, HelpText<"Create debug DLL">;
6238def _SLASH_link : CLRemainingArgsJoined<"link">,
6239  HelpText<"Forward options to the linker">, MetaVarName<"<options>">;
6240def _SLASH_MD : Option<["/", "-"], "MD", KIND_FLAG>, Group<_SLASH_M_Group>,
6241  Flags<[CLOption, NoXarchOption]>, HelpText<"Use DLL run-time">;
6242def _SLASH_MDd : Option<["/", "-"], "MDd", KIND_FLAG>, Group<_SLASH_M_Group>,
6243  Flags<[CLOption, NoXarchOption]>, HelpText<"Use DLL debug run-time">;
6244def _SLASH_MT : Option<["/", "-"], "MT", KIND_FLAG>, Group<_SLASH_M_Group>,
6245  Flags<[CLOption, NoXarchOption]>, HelpText<"Use static run-time">;
6246def _SLASH_MTd : Option<["/", "-"], "MTd", KIND_FLAG>, Group<_SLASH_M_Group>,
6247  Flags<[CLOption, NoXarchOption]>, HelpText<"Use static debug run-time">;
6248def _SLASH_o : CLJoinedOrSeparate<"o">,
6249  HelpText<"Deprecated (set output file name); use /Fe or /Fe">,
6250  MetaVarName<"<file or dir/>">;
6251def _SLASH_P : CLFlag<"P">, HelpText<"Preprocess to file">;
6252def _SLASH_permissive : CLFlag<"permissive">,
6253  HelpText<"Enable some non conforming code to compile">;
6254def _SLASH_permissive_ : CLFlag<"permissive-">,
6255  HelpText<"Disable non conforming code from compiling (default)">;
6256def _SLASH_Tc : CLCompileJoinedOrSeparate<"Tc">,
6257  HelpText<"Treat <file> as C source file">, MetaVarName<"<file>">;
6258def _SLASH_TC : CLCompileFlag<"TC">, HelpText<"Treat all source files as C">;
6259def _SLASH_Tp : CLCompileJoinedOrSeparate<"Tp">,
6260  HelpText<"Treat <file> as C++ source file">, MetaVarName<"<file>">;
6261def _SLASH_TP : CLCompileFlag<"TP">, HelpText<"Treat all source files as C++">;
6262def _SLASH_diasdkdir : CLJoinedOrSeparate<"diasdkdir">,
6263  HelpText<"Path to the DIA SDK">, MetaVarName<"<dir>">;
6264def _SLASH_vctoolsdir : CLJoinedOrSeparate<"vctoolsdir">,
6265  HelpText<"Path to the VCToolChain">, MetaVarName<"<dir>">;
6266def _SLASH_vctoolsversion : CLJoinedOrSeparate<"vctoolsversion">,
6267  HelpText<"For use with /winsysroot, defaults to newest found">;
6268def _SLASH_winsdkdir : CLJoinedOrSeparate<"winsdkdir">,
6269  HelpText<"Path to the Windows SDK">, MetaVarName<"<dir>">;
6270def _SLASH_winsdkversion : CLJoinedOrSeparate<"winsdkversion">,
6271  HelpText<"Full version of the Windows SDK, defaults to newest found">;
6272def _SLASH_winsysroot : CLJoinedOrSeparate<"winsysroot">,
6273  HelpText<"Same as \"/diasdkdir <dir>/DIA SDK\" /vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsversion> \"/winsdkdir <dir>/Windows Kits/10\"">,
6274  MetaVarName<"<dir>">;
6275def _SLASH_volatile_iso : Option<["/", "-"], "volatile:iso", KIND_FLAG>,
6276  Group<_SLASH_volatile_Group>, Flags<[CLOption, NoXarchOption]>,
6277  HelpText<"Volatile loads and stores have standard semantics">;
6278def _SLASH_vmb : CLFlag<"vmb">,
6279  HelpText<"Use a best-case representation method for member pointers">;
6280def _SLASH_vmg : CLFlag<"vmg">,
6281  HelpText<"Use a most-general representation for member pointers">;
6282def _SLASH_vms : CLFlag<"vms">,
6283  HelpText<"Set the default most-general representation to single inheritance">;
6284def _SLASH_vmm : CLFlag<"vmm">,
6285  HelpText<"Set the default most-general representation to "
6286           "multiple inheritance">;
6287def _SLASH_vmv : CLFlag<"vmv">,
6288  HelpText<"Set the default most-general representation to "
6289           "virtual inheritance">;
6290def _SLASH_volatile_ms  : Option<["/", "-"], "volatile:ms", KIND_FLAG>,
6291  Group<_SLASH_volatile_Group>, Flags<[CLOption, NoXarchOption]>,
6292  HelpText<"Volatile loads and stores have acquire and release semantics">;
6293def _SLASH_clang : CLJoined<"clang:">,
6294  HelpText<"Pass <arg> to the clang driver">, MetaVarName<"<arg>">;
6295def _SLASH_Zl : CLFlag<"Zl">,
6296  HelpText<"Do not let object file auto-link default libraries">;
6297
6298def _SLASH_Yc : CLJoined<"Yc">,
6299  HelpText<"Generate a pch file for all code up to and including <filename>">,
6300  MetaVarName<"<filename>">;
6301def _SLASH_Yu : CLJoined<"Yu">,
6302  HelpText<"Load a pch file and use it instead of all code up to "
6303           "and including <filename>">,
6304  MetaVarName<"<filename>">;
6305def _SLASH_Y_ : CLFlag<"Y-">,
6306  HelpText<"Disable precompiled headers, overrides /Yc and /Yu">;
6307def _SLASH_Zc_dllexportInlines : CLFlag<"Zc:dllexportInlines">,
6308  HelpText<"dllexport/dllimport inline member functions of dllexport/import classes (default)">;
6309def _SLASH_Zc_dllexportInlines_ : CLFlag<"Zc:dllexportInlines-">,
6310  HelpText<"Do not dllexport/dllimport inline member functions of dllexport/import classes">;
6311def _SLASH_Fp : CLJoined<"Fp">,
6312  HelpText<"Set pch file name (with /Yc and /Yu)">, MetaVarName<"<file>">;
6313
6314def _SLASH_Gd : CLFlag<"Gd">,
6315  HelpText<"Set __cdecl as a default calling convention">;
6316def _SLASH_Gr : CLFlag<"Gr">,
6317  HelpText<"Set __fastcall as a default calling convention">;
6318def _SLASH_Gz : CLFlag<"Gz">,
6319  HelpText<"Set __stdcall as a default calling convention">;
6320def _SLASH_Gv : CLFlag<"Gv">,
6321  HelpText<"Set __vectorcall as a default calling convention">;
6322def _SLASH_Gregcall : CLFlag<"Gregcall">,
6323  HelpText<"Set __regcall as a default calling convention">;
6324
6325// Ignored:
6326
6327def _SLASH_analyze_ : CLIgnoredFlag<"analyze-">;
6328def _SLASH_bigobj : CLIgnoredFlag<"bigobj">;
6329def _SLASH_cgthreads : CLIgnoredJoined<"cgthreads">;
6330def _SLASH_d2FastFail : CLIgnoredFlag<"d2FastFail">;
6331def _SLASH_d2Zi_PLUS : CLIgnoredFlag<"d2Zi+">;
6332def _SLASH_errorReport : CLIgnoredJoined<"errorReport">;
6333def _SLASH_FC : CLIgnoredFlag<"FC">;
6334def _SLASH_Fd : CLIgnoredJoined<"Fd">;
6335def _SLASH_FS : CLIgnoredFlag<"FS">;
6336def _SLASH_JMC : CLIgnoredFlag<"JMC">;
6337def _SLASH_kernel_ : CLIgnoredFlag<"kernel-">;
6338def _SLASH_nologo : CLIgnoredFlag<"nologo">;
6339def _SLASH_RTC : CLIgnoredJoined<"RTC">;
6340def _SLASH_sdl : CLIgnoredFlag<"sdl">;
6341def _SLASH_sdl_ : CLIgnoredFlag<"sdl-">;
6342def _SLASH_utf8 : CLIgnoredFlag<"utf-8">,
6343  HelpText<"Set source and runtime encoding to UTF-8 (default)">;
6344def _SLASH_w : CLIgnoredJoined<"w">;
6345def _SLASH_Zc___cplusplus : CLIgnoredFlag<"Zc:__cplusplus">;
6346def _SLASH_Zc_auto : CLIgnoredFlag<"Zc:auto">;
6347def _SLASH_Zc_forScope : CLIgnoredFlag<"Zc:forScope">;
6348def _SLASH_Zc_inline : CLIgnoredFlag<"Zc:inline">;
6349def _SLASH_Zc_rvalueCast : CLIgnoredFlag<"Zc:rvalueCast">;
6350def _SLASH_Zc_ternary : CLIgnoredFlag<"Zc:ternary">;
6351def _SLASH_Zc_wchar_t : CLIgnoredFlag<"Zc:wchar_t">;
6352def _SLASH_ZH_MD5 : CLIgnoredFlag<"ZH:MD5">;
6353def _SLASH_ZH_SHA1 : CLIgnoredFlag<"ZH:SHA1">;
6354def _SLASH_ZH_SHA_256 : CLIgnoredFlag<"ZH:SHA_256">;
6355def _SLASH_Zm : CLIgnoredJoined<"Zm">;
6356def _SLASH_Zo : CLIgnoredFlag<"Zo">;
6357def _SLASH_Zo_ : CLIgnoredFlag<"Zo-">;
6358
6359
6360// Unsupported:
6361
6362def _SLASH_await : CLFlag<"await">;
6363def _SLASH_await_COLON : CLJoined<"await:">;
6364def _SLASH_constexpr : CLJoined<"constexpr:">;
6365def _SLASH_AI : CLJoinedOrSeparate<"AI">;
6366def _SLASH_Bt : CLFlag<"Bt">;
6367def _SLASH_Bt_plus : CLFlag<"Bt+">;
6368def _SLASH_clr : CLJoined<"clr">;
6369def _SLASH_d2 : CLJoined<"d2">;
6370def _SLASH_doc : CLJoined<"doc">;
6371def _SLASH_experimental : CLJoined<"experimental:">;
6372def _SLASH_exportHeader : CLFlag<"exportHeader">;
6373def _SLASH_external : CLJoined<"external:">;
6374def _SLASH_FA_joined : CLJoined<"FA">;
6375def _SLASH_favor : CLJoined<"favor">;
6376def _SLASH_fsanitize_address_use_after_return : CLJoined<"fsanitize-address-use-after-return">;
6377def _SLASH_fno_sanitize_address_vcasan_lib : CLJoined<"fno-sanitize-address-vcasan-lib">;
6378def _SLASH_F : CLJoinedOrSeparate<"F">;
6379def _SLASH_Fm : CLJoined<"Fm">;
6380def _SLASH_Fr : CLJoined<"Fr">;
6381def _SLASH_FR : CLJoined<"FR">;
6382def _SLASH_FU : CLJoinedOrSeparate<"FU">;
6383def _SLASH_Fx : CLFlag<"Fx">;
6384def _SLASH_G1 : CLFlag<"G1">;
6385def _SLASH_G2 : CLFlag<"G2">;
6386def _SLASH_Ge : CLFlag<"Ge">;
6387def _SLASH_Gh : CLFlag<"Gh">;
6388def _SLASH_GH : CLFlag<"GH">;
6389def _SLASH_GL : CLFlag<"GL">;
6390def _SLASH_GL_ : CLFlag<"GL-">;
6391def _SLASH_Gm : CLFlag<"Gm">;
6392def _SLASH_Gm_ : CLFlag<"Gm-">;
6393def _SLASH_GT : CLFlag<"GT">;
6394def _SLASH_GZ : CLFlag<"GZ">;
6395def _SLASH_H : CLFlag<"H">;
6396def _SLASH_headername : CLJoined<"headerName:">;
6397def _SLASH_headerUnit : CLJoinedOrSeparate<"headerUnit">;
6398def _SLASH_headerUnitAngle : CLJoinedOrSeparate<"headerUnit:angle">;
6399def _SLASH_headerUnitQuote : CLJoinedOrSeparate<"headerUnit:quote">;
6400def _SLASH_homeparams : CLFlag<"homeparams">;
6401def _SLASH_hotpatch : CLFlag<"hotpatch">;
6402def _SLASH_kernel : CLFlag<"kernel">;
6403def _SLASH_LN : CLFlag<"LN">;
6404def _SLASH_MP : CLJoined<"MP">;
6405def _SLASH_Qfast_transcendentals : CLFlag<"Qfast_transcendentals">;
6406def _SLASH_QIfist : CLFlag<"QIfist">;
6407def _SLASH_Qimprecise_fwaits : CLFlag<"Qimprecise_fwaits">;
6408def _SLASH_Qpar : CLFlag<"Qpar">;
6409def _SLASH_Qpar_report : CLJoined<"Qpar-report">;
6410def _SLASH_Qsafe_fp_loads : CLFlag<"Qsafe_fp_loads">;
6411def _SLASH_Qspectre : CLFlag<"Qspectre">;
6412def _SLASH_Qspectre_load : CLFlag<"Qspectre-load">;
6413def _SLASH_Qspectre_load_cf : CLFlag<"Qspectre-load-cf">;
6414def _SLASH_Qvec_report : CLJoined<"Qvec-report">;
6415def _SLASH_reference : CLJoinedOrSeparate<"reference">;
6416def _SLASH_sourceDependencies : CLJoinedOrSeparate<"sourceDependencies">;
6417def _SLASH_sourceDependenciesDirectives : CLJoinedOrSeparate<"sourceDependencies:directives">;
6418def _SLASH_translateInclude : CLFlag<"translateInclude">;
6419def _SLASH_u : CLFlag<"u">;
6420def _SLASH_V : CLFlag<"V">;
6421def _SLASH_WL : CLFlag<"WL">;
6422def _SLASH_Wp64 : CLFlag<"Wp64">;
6423def _SLASH_Yd : CLFlag<"Yd">;
6424def _SLASH_Yl : CLJoined<"Yl">;
6425def _SLASH_Za : CLFlag<"Za">;
6426def _SLASH_Zc : CLJoined<"Zc:">;
6427def _SLASH_Ze : CLFlag<"Ze">;
6428def _SLASH_Zg : CLFlag<"Zg">;
6429def _SLASH_ZI : CLFlag<"ZI">;
6430def _SLASH_ZW : CLJoined<"ZW">;
6431