[clang] 9478f66 - [Driver] Refactor to use llvm Option's new Visibility flags
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 15 14:27:29 PDT 2023
Author: Justin Bogner
Date: 2023-08-15T14:26:40-07:00
New Revision: 9478f661c26fbc22491218477917df5d8d73c51c
URL: https://github.com/llvm/llvm-project/commit/9478f661c26fbc22491218477917df5d8d73c51c
DIFF: https://github.com/llvm/llvm-project/commit/9478f661c26fbc22491218477917df5d8d73c51c.diff
LOG: [Driver] Refactor to use llvm Option's new Visibility flags
This is a big refactor of the clang driver's option handling to use
the Visibility flags introduced in https://reviews.llvm.org/D157149.
There are a few distinct parts, but they can't really be split into
separate commits and still be made to compile.
1. We split out some of the flags in ClangFlags to ClangVisibility.
Note that this does not include any subtractive flags.
2. We update the Flag definitions and OptIn/OptOut constructs in
Options.td by hand.
3. We introduce and use a script, update_options_td_flags, to ease
migration of flag definitions in Options.td, and we run that on
Options.td. I intend to remove this later, but I'm committing it so
that downstream forks can use the script to simplify merging.
4. We update calls to OptTable in the clang driver, cc1as, flang, and
clangd to use the visibility APIs instead of Include/Exclude flags.
5. We deprecate the Include/Exclude APIs and add a release note.
*if you are running into conflicts with this change:*
Note that https://reviews.llvm.org/D157150 may also be the culprit and
if so it should be handled first.
The script in `clang/utils/update_options_td_flags.py` can help. Take
the downstream side of all conflicts and then run the following:
```
% cd clang/include/clang/Driver
% ../../../utils/update_options_td_flags.py Options.td > Options.td.new
% mv Options.td.new Options.td
```
This will hopefully be sufficient, please take a look at the diff.
Differential Revision: https://reviews.llvm.org/D157151
Added:
clang/utils/update_options_td_flags.py
Modified:
clang-tools-extra/clangd/CompileCommands.cpp
clang-tools-extra/modularize/Modularize.cpp
clang/docs/InternalsManual.rst
clang/include/clang/Driver/ClangOptionDocs.td
clang/include/clang/Driver/Driver.h
clang/include/clang/Driver/Options.h
clang/include/clang/Driver/Options.td
clang/lib/Driver/Driver.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
clang/tools/driver/cc1as_main.cpp
clang/utils/TableGen/ClangOptionDocEmitter.cpp
flang/docs/FlangDriver.md
flang/docs/FlangOptionsDocs.td
flang/lib/Frontend/CompilerInvocation.cpp
flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
flang/tools/flang-driver/driver.cpp
llvm/docs/ReleaseNotes.rst
llvm/include/llvm/Option/OptTable.h
llvm/lib/Option/OptTable.cpp
llvm/unittests/Option/OptionParsingTest.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/CompileCommands.cpp b/clang-tools-extra/clangd/CompileCommands.cpp
index 3fce1b8bcb490c..ef5d5db0577b0d 100644
--- a/clang-tools-extra/clangd/CompileCommands.cpp
+++ b/clang-tools-extra/clangd/CompileCommands.cpp
@@ -237,14 +237,8 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
llvm::opt::InputArgList ArgList;
ArgList = OptTable.ParseArgs(
llvm::ArrayRef(OriginalArgs).drop_front(), IgnoredCount, IgnoredCount,
- /*FlagsToInclude=*/
- IsCLMode ? (driver::options::CLOption | driver::options::CoreOption |
- driver::options::CLDXCOption)
- : /*everything*/ 0,
- /*FlagsToExclude=*/driver::options::NoDriverOption |
- (IsCLMode
- ? 0
- : (driver::options::CLOption | driver::options::CLDXCOption)));
+ llvm::opt::Visibility(IsCLMode ? driver::options::CLOption
+ : driver::options::ClangOption));
llvm::SmallVector<unsigned, 1> IndicesToDrop;
// Having multiple architecture options (e.g. when building fat binaries)
@@ -441,23 +435,13 @@ DriverMode getDriverMode(const std::vector<std::string> &Args) {
// Returns the set of DriverModes where an option may be used.
unsigned char getModes(const llvm::opt::Option &Opt) {
- // Why is this so complicated?!
- // Reference is clang::driver::Driver::getIncludeExcludeOptionFlagMasks()
unsigned char Result = DM_None;
- if (Opt.hasFlag(driver::options::CC1Option))
+ if (Opt.hasVisibilityFlag(driver::options::ClangOption))
+ Result |= DM_GCC;
+ if (Opt.hasVisibilityFlag(driver::options::CC1Option))
Result |= DM_CC1;
- if (!Opt.hasFlag(driver::options::NoDriverOption)) {
- if (Opt.hasFlag(driver::options::CLOption)) {
- Result |= DM_CL;
- } else if (Opt.hasFlag(driver::options::CLDXCOption)) {
- Result |= DM_CL;
- } else {
- Result |= DM_GCC;
- if (Opt.hasFlag(driver::options::CoreOption)) {
- Result |= DM_CL;
- }
- }
- }
+ if (Opt.hasVisibilityFlag(driver::options::CLOption))
+ Result |= DM_CL;
return Result;
}
diff --git a/clang-tools-extra/modularize/Modularize.cpp b/clang-tools-extra/modularize/Modularize.cpp
index b90ccccf30cd34..d6f1520cc40e7e 100644
--- a/clang-tools-extra/modularize/Modularize.cpp
+++ b/clang-tools-extra/modularize/Modularize.cpp
@@ -336,13 +336,13 @@ std::string CommandLine;
// Helper function for finding the input file in an arguments list.
static std::string findInputFile(const CommandLineArguments &CLArgs) {
- const unsigned IncludedFlagsBitmask = options::CC1Option;
+ llvm::opt::Visibility VisibilityMask(options::CC1Option);
unsigned MissingArgIndex, MissingArgCount;
SmallVector<const char *, 256> Argv;
for (auto I = CLArgs.begin(), E = CLArgs.end(); I != E; ++I)
Argv.push_back(I->c_str());
InputArgList Args = getDriverOptTable().ParseArgs(
- Argv, MissingArgIndex, MissingArgCount, IncludedFlagsBitmask);
+ Argv, MissingArgIndex, MissingArgCount, VisibilityMask);
std::vector<std::string> Inputs = Args.getAllArgValues(OPT_INPUT);
return ModularizeUtilities::getCanonicalPath(Inputs.back());
}
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst
index f6fdf57dcf06c8..b7d88d3d67d0a0 100644
--- a/clang/docs/InternalsManual.rst
+++ b/clang/docs/InternalsManual.rst
@@ -663,9 +663,11 @@ Then, specify additional attributes via mix-ins:
* ``HelpText`` holds the text that will be printed besides the option name when
the user requests help (e.g. via ``clang --help``).
* ``Group`` specifies the "category" of options this option belongs to. This is
- used by various tools to filter certain options of interest.
-* ``Flags`` may contain a number of "tags" associated with the option. This
- enables more granular filtering than the ``Group`` attribute.
+ used by various tools to categorize and sometimes filter options.
+* ``Flags`` may contain "tags" associated with the option. These may affect how
+ the option is rendered, or if it's hidden in some contexts.
+* ``Visibility`` should be used to specify the drivers in which a particular
+ option would be available. This attribute will impact tool --help
* ``Alias`` denotes that the option is an alias of another option. This may be
combined with ``AliasArgs`` that holds the implied value.
@@ -674,12 +676,14 @@ Then, specify additional attributes via mix-ins:
// Options.td
def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">,
- + Group<f_Group>, Flags<[CC1Option]>,
+ + Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Load pass plugin from a dynamic shared object file.">;
-New options are recognized by the Clang driver unless marked with the
-``NoDriverOption`` flag. On the other hand, options intended for the ``-cc1``
-frontend must be explicitly marked with the ``CC1Option`` flag.
+New options are recognized by the ``clang`` driver mode if ``Visibility`` is
+not specified or contains ``ClangOption``. Options intended for ``clang -cc1``
+must be explicitly marked with the ``CC1Option`` flag. Flags that specify
+``CC1Option`` but not ``ClangOption`` will only be accessible via ``-cc1``.
+This is similar for other driver modes, such as ``clang-cl`` or ``flang``.
Next, parse (or manufacture) the command line arguments in the Clang driver and
use them to construct the ``-cc1`` job:
@@ -874,7 +878,8 @@ present on command line.
.. code-block:: text
- def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Flags<[CC1Option]>,
+ def fignore_exceptions : Flag<["-"], "fignore-exceptions">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"IgnoreExceptions">>;
**Negative Flag**
@@ -884,7 +889,8 @@ present on command line.
.. code-block:: text
- def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Flags<[CC1Option]>,
+ def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoNegativeFlag<CodeGenOpts<"AsmVerbose">>;
**Negative and Positive Flag**
@@ -898,9 +904,9 @@ line.
defm legacy_pass_manager : BoolOption<"f", "legacy-pass-manager",
CodeGenOpts<"LegacyPassManager">, DefaultFalse,
- PosFlag<SetTrue, [], "Use the legacy pass manager in LLVM">,
- NegFlag<SetFalse, [], "Use the new pass manager in LLVM">,
- BothFlags<[CC1Option]>>;
+ PosFlag<SetTrue, [], [], "Use the legacy pass manager in LLVM">,
+ NegFlag<SetFalse, [], [], "Use the new pass manager in LLVM">,
+ BothFlags<[], [ClangOption, CC1Option]>>;
With most such pair of flags, the ``-cc1`` frontend accepts only the flag that
changes the default key path value. The Clang driver is responsible for
@@ -912,10 +918,11 @@ full names of both flags. The positive flag would then be named
``flegacy-pass-manager`` and the negative ``fno-legacy-pass-manager``.
``BoolOption`` also implies the ``-`` prefix for both flags. It's also possible
to use ``BoolFOption`` that implies the ``"f"`` prefix and ``Group<f_Group>``.
-The ``PosFlag`` and ``NegFlag`` classes hold the associated boolean value, an
-array of elements passed to the ``Flag`` class and the help text. The optional
-``BothFlags`` class holds an array of ``Flag`` elements that are common for both
-the positive and negative flag and their common help text suffix.
+The ``PosFlag`` and ``NegFlag`` classes hold the associated boolean value,
+arrays of elements passed to the ``Flag`` and ``Visibility`` classes and the
+help text. The optional ``BothFlags`` class holds arrays of ``Flag`` and
+``Visibility`` elements that are common for both the positive and negative flag
+and their common help text suffix.
**String**
@@ -924,7 +931,8 @@ the option appears on the command line, the argument value is simply copied.
.. code-block:: text
- def isysroot : JoinedOrSeparate<["-"], "isysroot">, Flags<[CC1Option]>,
+ def isysroot : JoinedOrSeparate<["-"], "isysroot">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoString<HeaderSearchOpts<"Sysroot">, [{"/"}]>;
**List of Strings**
@@ -935,7 +943,8 @@ vector.
.. code-block:: text
- def frewrite_map_file : Separate<["-"], "frewrite-map-file">, Flags<[CC1Option]>,
+ def frewrite_map_file : Separate<["-"], "frewrite-map-file">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoStringVector<CodeGenOpts<"RewriteMapFiles">>;
**Integer**
@@ -946,7 +955,8 @@ and the result is assigned to the key path on success.
.. code-block:: text
- def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Flags<[CC1Option]>,
+ def mstack_probe_size : Joined<["-"], "mstack-probe-size=">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoInt<CodeGenOpts<"StackProbeSize">, "4096">;
**Enumeration**
@@ -963,7 +973,8 @@ comma-separated string values and elements of the array within
.. code-block:: text
- def mthread_model : Separate<["-"], "mthread-model">, Flags<[CC1Option]>,
+ def mthread_model : Separate<["-"], "mthread-model">,
+ Visibility<[ClangOption, CC1Option]>,
Values<"posix,single">, NormalizedValues<["POSIX", "Single"]>,
NormalizedValuesScope<"LangOptions::ThreadModelKind">,
MarshallingInfoEnum<LangOpts<"ThreadModel">, "POSIX">;
@@ -983,7 +994,8 @@ Finally, the command line is parsed according to the primary annotation.
.. code-block:: text
- def fms_extensions : Flag<["-"], "fms-extensions">, Flags<[CC1Option]>,
+ def fms_extensions : Flag<["-"], "fms-extensions">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"MicrosoftExt">>,
ImpliedByAnyOf<[fms_compatibility.KeyPath], "true">;
@@ -994,7 +1006,8 @@ true.
.. code-block:: text
- def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">, Flags<[CC1Option]>,
+ def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"OpenMPIRBuilder">>,
ShouldParseIf<fopenmp.KeyPath>;
diff --git a/clang/include/clang/Driver/ClangOptionDocs.td b/clang/include/clang/Driver/ClangOptionDocs.td
index 3f914afea735ae..a5ee577c5f45db 100644
--- a/clang/include/clang/Driver/ClangOptionDocs.td
+++ b/clang/include/clang/Driver/ClangOptionDocs.td
@@ -28,8 +28,10 @@ GCC-compatible ``clang`` and ``clang++`` drivers.
}];
string Program = "clang";
- list<string> ExcludedFlags = ["HelpHidden", "NoDriverOption",
- "CLOption", "Unsupported", "Ignored", "FlangOnlyOption"];
+ // Note: We *must* use DefaultVis and not ClangOption, since that's
+ // the name of the actual TableGen record. The alias will not work.
+ list<string> VisibilityMask = ["DefaultVis"];
+ list<string> IgnoreFlags = ["HelpHidden", "Unsupported", "Ignored"];
}
include "Options.td"
diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h
index e3e98bad991270..3ee1bcf2a69c9b 100644
--- a/clang/include/clang/Driver/Driver.h
+++ b/clang/include/clang/Driver/Driver.h
@@ -455,7 +455,7 @@ class Driver {
/// ParseArgStrings - Parse the given list of strings into an
/// ArgList.
llvm::opt::InputArgList ParseArgStrings(ArrayRef<const char *> Args,
- bool IsClCompatMode,
+ bool UseDriverMode,
bool &ContainsError);
/// BuildInputs - Construct the list of inputs and their types from
@@ -759,7 +759,8 @@ class Driver {
/// Get bitmasks for which option flags to include and exclude based on
/// the driver mode.
- std::pair<unsigned, unsigned> getIncludeExcludeOptionFlagMasks(bool IsClCompatMode) const;
+ llvm::opt::Visibility
+ getOptionVisibilityMask(bool UseDriverMode = true) const;
/// Helper used in BuildJobsForAction. Doesn't use the cache when building
/// jobs specifically for the given action, but will use the cache when
diff --git a/clang/include/clang/Driver/Options.h b/clang/include/clang/Driver/Options.h
index 50366d2829ab88..0797410e9940e2 100644
--- a/clang/include/clang/Driver/Options.h
+++ b/clang/include/clang/Driver/Options.h
@@ -23,19 +23,9 @@ enum ClangFlags {
LinkerInput = (1 << 5),
NoArgumentUnused = (1 << 6),
Unsupported = (1 << 7),
- CoreOption = (1 << 8),
- CLOption = (1 << 9),
- CC1Option = (1 << 10),
- CC1AsOption = (1 << 11),
- NoDriverOption = (1 << 12),
- LinkOption = (1 << 13),
- FlangOption = (1 << 14),
- FC1Option = (1 << 15),
- FlangOnlyOption = (1 << 16),
- DXCOption = (1 << 17),
- CLDXCOption = (1 << 18),
- Ignored = (1 << 19),
- TargetSpecific = (1 << 20),
+ LinkOption = (1 << 8),
+ Ignored = (1 << 9),
+ TargetSpecific = (1 << 10),
};
// Flags specifically for clang option visibility. We alias DefaultVis to
@@ -43,6 +33,12 @@ enum ClangFlags {
// for multiple drivers (clang, cl, flang, etc).
enum ClangVisibility {
ClangOption = llvm::opt::DefaultVis,
+ CLOption = (1 << 1),
+ CC1Option = (1 << 2),
+ CC1AsOption = (1 << 3),
+ FlangOption = (1 << 4),
+ FC1Option = (1 << 5),
+ DXCOption = (1 << 6),
};
enum ID {
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 2e0ac65bb2c2e8..57f06d31ce4177 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -35,46 +35,10 @@ def Unsupported : OptionFlag;
// Ignored - The option is unsupported, and the driver will silently ignore it.
def Ignored : OptionFlag;
-// CoreOption - This is considered a "core" Clang option, available in both
-// clang and clang-cl modes.
-def CoreOption : OptionFlag;
-
-// CLOption - This is a cl.exe compatibility option. Options with this flag
-// are made available when the driver is running in CL compatibility mode.
-def CLOption : OptionFlag;
-
-// CC1Option - This option should be accepted by clang -cc1.
-def CC1Option : OptionFlag;
-
-// CC1AsOption - This option should be accepted by clang -cc1as.
-def CC1AsOption : OptionFlag;
-
-// DXCOption - This is a dxc.exe compatibility option. Options with this flag
-// are made available when the driver is running in DXC compatibility mode.
-def DXCOption : OptionFlag;
-
-// CLDXCOption - This is a cl.exe/dxc.exe compatibility option. Options with this flag
-// are made available when the driver is running in CL/DXC compatibility mode.
-def CLDXCOption : OptionFlag;
-
-// NoDriverOption - This option should not be accepted by the driver.
-def NoDriverOption : OptionFlag;
-
// If an option affects linking, but has a primary group (so Link_Group cannot
// be used), add this flag.
def LinkOption : OptionFlag;
-// FlangOption - This is considered a "core" Flang option, available in
-// flang mode.
-def FlangOption : OptionFlag;
-
-// FlangOnlyOption - This option should only be used by Flang (i.e. it is not
-// available for Clang)
-def FlangOnlyOption : OptionFlag;
-
-// FC1Option - This option should be accepted by flang -fc1.
-def FC1Option : OptionFlag;
-
// This is a target-specific option for compilation. Using it on an unsupported
// target will lead to an err_drv_unsupported_opt_for_target error.
def TargetSpecific : OptionFlag;
@@ -93,6 +57,27 @@ class TargetSpecific : Flags<[TargetSpecific]> {}
// opposed to clang -cc1, the CL driver, or the flang driver).
defvar ClangOption = DefaultVis;
+// CLOption - This is a cl.exe compatibility option. Options with this flag
+// are made available when the driver is running in CL compatibility mode.
+def CLOption : OptionVisibility;
+
+// CC1Option - This option should be accepted by clang -cc1.
+def CC1Option : OptionVisibility;
+
+// CC1AsOption - This option should be accepted by clang -cc1as.
+def CC1AsOption : OptionVisibility;
+
+// FlangOption - This is considered a "core" Flang option, available in
+// flang mode.
+def FlangOption : OptionVisibility;
+
+// FC1Option - This option should be accepted by flang -fc1.
+def FC1Option : OptionVisibility;
+
+// DXCOption - This is a dxc.exe compatibility option. Options with this flag
+// are made available when the driver is running in DXC compatibility mode.
+def DXCOption : OptionVisibility;
+
/////////
// Docs
@@ -210,7 +195,9 @@ def m_wasm_Features_Group : OptionGroup<"<wasm features group>">,
def m_wasm_Features_Driver_Group : OptionGroup<"<wasm driver features group>">,
Group<m_Group>, DocName<"WebAssembly Driver">;
def m_x86_Features_Group : OptionGroup<"<x86 features group>">,
- Group<m_Group>, Flags<[CoreOption]>, DocName<"X86">;
+ Group<m_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
+ DocName<"X86">;
def m_riscv_Features_Group : OptionGroup<"<riscv features group>">,
Group<m_Group>, DocName<"RISC-V">;
@@ -264,7 +251,7 @@ def clang_ignored_m_Group : OptionGroup<"<clang ignored m group>">,
// Unsupported flang groups
def flang_ignored_w_Group : OptionGroup<"<flang ignored W group>">,
- Group<W_Group>, Flags<[FlangOnlyOption, Ignored]>;
+ Group<W_Group>, Flags<[Ignored]>, Visibility<[FlangOption]>;
// Group for clang options in the process of deprecation.
// Please include the version that deprecated the flag as comment to allow
@@ -287,7 +274,8 @@ def mno_mpx : Flag<["-"], "mno-mpx">, Group<clang_ignored_legacy_options_Group>;
// Retired with clang-16.0, to provide a deprecation period; it should
// be removed in Clang 18 or later.
def enable_trivial_var_init_zero : Flag<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
- Flags<[CC1Option, CoreOption, NoArgumentUnused]>,
+ Flags<[NoArgumentUnused]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
Group<clang_ignored_legacy_options_Group>;
// Group that ignores all gcc optimizations that won't be implemented
@@ -324,10 +312,11 @@ class MigratorOpts<string base>
// This is useful if the option is usually disabled.
// Use this only when the option cannot be declared via BoolFOption.
multiclass OptInCC1FFlag<string name, string pos_prefix, string neg_prefix="",
- string help="", list<OptionFlag> flags=[]> {
- def f#NAME : Flag<["-"], "f"#name>, Flags<[CC1Option] # flags>,
+ string help="",
+ list<OptionVisibility> vis=[ClangOption]> {
+ def f#NAME : Flag<["-"], "f"#name>, Visibility<[CC1Option] # vis>,
Group<f_Group>, HelpText<pos_prefix # help>;
- def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<flags>,
+ def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<vis>,
Group<f_Group>, HelpText<neg_prefix # help>;
}
@@ -335,10 +324,11 @@ multiclass OptInCC1FFlag<string name, string pos_prefix, string neg_prefix="",
// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
// Use this only when the option cannot be declared via BoolFOption.
multiclass OptOutCC1FFlag<string name, string pos_prefix, string neg_prefix,
- string help="", list<OptionFlag> flags=[]> {
- def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
+ string help="",
+ list<OptionVisibility> vis=[ClangOption]> {
+ def f#NAME : Flag<["-"], "f"#name>, Visibility<vis>,
Group<f_Group>, HelpText<pos_prefix # help>;
- def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[CC1Option] # flags>,
+ def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<[CC1Option] # vis>,
Group<f_Group>, HelpText<neg_prefix # help>;
}
@@ -346,20 +336,22 @@ multiclass OptOutCC1FFlag<string name, string pos_prefix, string neg_prefix,
// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
// This is useful if the option is usually disabled.
multiclass OptInFC1FFlag<string name, string pos_prefix, string neg_prefix="",
- string help="", list<OptionFlag> flags=[]> {
- def f#NAME : Flag<["-"], "f"#name>, Flags<[FC1Option] # flags>,
+ string help="",
+ list<OptionVisibility> vis=[ClangOption]> {
+ def f#NAME : Flag<["-"], "f"#name>, Visibility<[FC1Option] # vis>,
Group<f_Group>, HelpText<pos_prefix # help>;
- def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<flags>,
+ def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<vis>,
Group<f_Group>, HelpText<neg_prefix # help>;
}
// A boolean option which is opt-out in FC1. The negative option exists in FC1 and
// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
multiclass OptOutFC1FFlag<string name, string pos_prefix, string neg_prefix,
- string help="", list<OptionFlag> flags=[]> {
- def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
+ string help="",
+ list<OptionVisibility> vis=[ClangOption]> {
+ def f#NAME : Flag<["-"], "f"#name>, Visibility<vis>,
Group<f_Group>, HelpText<pos_prefix # help>;
- def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[FC1Option] # flags>,
+ def fno_#NAME : Flag<["-"], "fno-"#name>, Visibility<[FC1Option] # vis>,
Group<f_Group>, HelpText<neg_prefix # help>;
}
@@ -613,7 +605,8 @@ defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPat
// Developer Driver Options
-def internal_Group : OptionGroup<"<clang internal options>">, Flags<[HelpHidden]>;
+def internal_Group : OptionGroup<"<clang internal options>">,
+ Flags<[HelpHidden]>;
def internal_driver_Group : OptionGroup<"<clang driver internal options>">,
Group<internal_Group>, HelpText<"DRIVER OPTIONS">;
def internal_debug_Group :
@@ -623,17 +616,20 @@ def internal_debug_Group :
class InternalDriverOpt : Group<internal_driver_Group>,
Flags<[NoXarchOption, HelpHidden]>;
def driver_mode : Joined<["--"], "driver-mode=">, Group<internal_driver_Group>,
- Flags<[CoreOption, NoXarchOption, HelpHidden]>,
+ Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Set the driver mode to either 'gcc', 'g++', 'cpp', or 'cl'">;
def rsp_quoting : Joined<["--"], "rsp-quoting=">, Group<internal_driver_Group>,
- Flags<[CoreOption, NoXarchOption, HelpHidden]>,
+ Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Set the rsp quoting to either 'posix', or 'windows'">;
def ccc_gcc_name : Separate<["-"], "ccc-gcc-name">, InternalDriverOpt,
HelpText<"Name for native GCC compiler">,
MetaVarName<"<gcc-path>">;
class InternalDebugOpt : Group<internal_debug_Group>,
- Flags<[NoXarchOption, HelpHidden, CoreOption]>;
+ Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def ccc_install_dir : Separate<["-"], "ccc-install-dir">, InternalDebugOpt,
HelpText<"Simulate installation in the given directory">;
def ccc_print_phases : Flag<["-"], "ccc-print-phases">, InternalDebugOpt,
@@ -648,12 +644,15 @@ def ccc_arcmt_modify : Flag<["-"], "ccc-arcmt-modify">, InternalDriverOpt,
def ccc_arcmt_migrate : Separate<["-"], "ccc-arcmt-migrate">, InternalDriverOpt,
HelpText<"Apply modifications and produces temporary files that conform to ARC">;
def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output">,
- HelpText<"Output path for the plist report">, Flags<[CC1Option]>,
+ HelpText<"Output path for the plist report">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoString<FrontendOpts<"ARCMTMigrateReportOut">>;
def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">,
- HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>,
+ HelpText<"Emit ARC errors even if the migrator can fix them">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<FrontendOpts<"ARCMTMigrateEmitARCErrors">>;
-def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">, Flags<[NoArgumentUnused, CoreOption]>,
+def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Emit reproducer on (option: off, crash (default), error, always)">;
def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt,
Alias<gen_reproducer_eq>, AliasArgs<["always"]>,
@@ -661,9 +660,10 @@ def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt,
def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt,
HelpText<"Emit a compilation database fragment to the specified directory">;
-def round_trip_args : Flag<["-"], "round-trip-args">, Flags<[CC1Option, NoDriverOption]>,
+def round_trip_args : Flag<["-"], "round-trip-args">, Visibility<[CC1Option]>,
HelpText<"Enable command line arguments round-trip.">;
-def no_round_trip_args : Flag<["-"], "no-round-trip-args">, Flags<[CC1Option, NoDriverOption]>,
+def no_round_trip_args : Flag<["-"], "no-round-trip-args">,
+ Visibility<[CC1Option]>,
HelpText<"Disable command line arguments round-trip.">;
def _migrate : Flag<["--"], "migrate">, Flags<[NoXarchOption]>,
@@ -673,60 +673,78 @@ def ccc_objcmt_migrate : Separate<["-"], "ccc-objcmt-migrate">,
HelpText<"Apply modifications and produces temporary files to migrate to "
"modern ObjC syntax">;
-def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">, Flags<[CC1Option]>,
+def objcmt_migrate_literals : Flag<["-"], "objcmt-migrate-literals">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to modern ObjC literals">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Literals">;
-def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">, Flags<[CC1Option]>,
+def objcmt_migrate_subscripting : Flag<["-"], "objcmt-migrate-subscripting">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to modern ObjC subscripting">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Subscripting">;
-def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">, Flags<[CC1Option]>,
+def objcmt_migrate_property : Flag<["-"], "objcmt-migrate-property">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to modern ObjC property">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Property">;
-def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">, Flags<[CC1Option]>,
+def objcmt_migrate_all : Flag<["-"], "objcmt-migrate-all">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to modern ObjC">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_MigrateDecls">;
-def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">, Flags<[CC1Option]>,
+def objcmt_migrate_readonly_property : Flag<["-"], "objcmt-migrate-readonly-property">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to modern ObjC readonly property">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadonlyProperty">;
-def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">, Flags<[CC1Option]>,
+def objcmt_migrate_readwrite_property : Flag<["-"], "objcmt-migrate-readwrite-property">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to modern ObjC readwrite property">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReadwriteProperty">;
-def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">, Flags<[CC1Option]>,
+def objcmt_migrate_property_dot_syntax : Flag<["-"], "objcmt-migrate-property-dot-syntax">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration of setter/getter messages to property-dot syntax">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_PropertyDotSyntax">;
-def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">, Flags<[CC1Option]>,
+def objcmt_migrate_annotation : Flag<["-"], "objcmt-migrate-annotation">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to property and method annotations">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Annotation">;
-def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">, Flags<[CC1Option]>,
+def objcmt_migrate_instancetype : Flag<["-"], "objcmt-migrate-instancetype">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to infer instancetype for method result type">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_Instancetype">;
-def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">, Flags<[CC1Option]>,
+def objcmt_migrate_nsmacros : Flag<["-"], "objcmt-migrate-ns-macros">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to NS_ENUM/NS_OPTIONS macros">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsMacros">;
-def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">, Flags<[CC1Option]>,
+def objcmt_migrate_protocol_conformance : Flag<["-"], "objcmt-migrate-protocol-conformance">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to add protocol conformance on classes">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ProtocolConformance">;
-def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">, Flags<[CC1Option]>,
+def objcmt_atomic_property : Flag<["-"], "objcmt-atomic-property">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Make migration to 'atomic' properties">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_AtomicProperty">;
-def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">, Flags<[CC1Option]>,
+def objcmt_returns_innerpointer_property : Flag<["-"], "objcmt-returns-innerpointer-property">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to annotate property with NS_RETURNS_INNER_POINTER">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_ReturnsInnerPointerProperty">;
-def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">, Flags<[CC1Option]>,
+def objcmt_ns_nonatomic_iosonly: Flag<["-"], "objcmt-ns-nonatomic-iosonly">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to use NS_NONATOMIC_IOSONLY macro for setting property's 'atomic' attribute">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_NsAtomicIOSOnlyProperty">;
-def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">, Flags<[CC1Option]>,
+def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_DesignatedInitializer">;
-def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">, Flags<[CC1Option]>,
+def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Only modify files with a filename contained in the provided directory path">,
MarshallingInfoString<FrontendOpts<"ObjCMTAllowListPath">>;
-def : Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>,
+def : Joined<["-"], "objcmt-whitelist-dir-path=">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Alias for -objcmt-allowlist-dir-path">,
Alias<objcmt_allowlist_dir_path>;
// The misspelt "white-list" [sic] alias is due for removal.
-def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>,
+def : Joined<["-"], "objcmt-white-list-dir-path=">,
+ Visibility<[ClangOption, CC1Option]>,
Alias<objcmt_allowlist_dir_path>;
// Make sure all other -ccc- options are rejected.
@@ -734,11 +752,13 @@ def ccc_ : Joined<["-"], "ccc-">, Group<internal_Group>, Flags<[Unsupported]>;
// Standard Options
-def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption, CoreOption, FlangOption]>,
+def _HASH_HASH_HASH : Flag<["-"], "###">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
HelpText<"Print (but do not run) the commands to run for this compilation">;
def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>,
- Flags<[NoXarchOption, CoreOption]>;
-def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group<gfortran_Group>;
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
+def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>,
+ Group<gfortran_Group>;
def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"<prefix>">,
HelpText<"Search $prefix$file for executables, libraries, and data files. "
"If $prefix is a directory, search $prefix/$file">;
@@ -748,28 +768,38 @@ def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">,
def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>,
HelpText<"Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
"Clang will use the GCC installation with the largest version">;
-def CC : Flag<["-"], "CC">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
+def CC : Flag<["-"], "CC">, Visibility<[ClangOption, CC1Option]>,
+ Group<Preprocessor_Group>,
HelpText<"Include comments from within macros in preprocessed output">,
MarshallingInfoFlag<PreprocessorOutputOpts<"ShowMacroComments">>;
-def C : Flag<["-"], "C">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
+def C : Flag<["-"], "C">, Visibility<[ClangOption, CC1Option]>,
+ Group<Preprocessor_Group>,
HelpText<"Include comments in preprocessed output">,
MarshallingInfoFlag<PreprocessorOutputOpts<"ShowComments">>;
def D : JoinedOrSeparate<["-"], "D">, Group<Preprocessor_Group>,
- Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"<macro>=<value>">,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ MetaVarName<"<macro>=<value>">,
HelpText<"Define <macro> to <value> (or 1 if <value> omitted)">;
-def E : Flag<["-"], "E">, Flags<[NoXarchOption,CC1Option, FlangOption, FC1Option]>, Group<Action_Group>,
+def E : Flag<["-"], "E">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ Group<Action_Group>,
HelpText<"Only run the preprocessor">;
-def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined,CC1Option]>,
+def F : JoinedOrSeparate<["-"], "F">, Flags<[RenderJoined]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Add directory to framework include search path">;
-def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption,TargetSpecific]>, Group<m_Group>,
+def G : JoinedOrSeparate<["-"], "G">, Flags<[NoXarchOption, TargetSpecific]>,
+ Group<m_Group>,
MetaVarName<"<size>">, HelpText<"Put objects of at most <size> bytes "
"into small data section (MIPS / Hexagon)">;
-def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>, Group<m_Group>, Alias<G>;
-def H : Flag<["-"], "H">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
+def G_EQ : Joined<["-"], "G=">, Flags<[NoXarchOption]>,
+ Group<m_Group>, Alias<G>;
+def H : Flag<["-"], "H">, Visibility<[ClangOption, CC1Option]>,
+ Group<Preprocessor_Group>,
HelpText<"Show header includes and nesting depth">,
MarshallingInfoFlag<DependencyOutputOpts<"ShowHeaderIncludes">>;
def fshow_skipped_includes : Flag<["-"], "fshow-skipped-includes">,
- Flags<[CC1Option]>, HelpText<"Show skipped includes in -H output.">,
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Show skipped includes in -H output.">,
DocBrief<[{#include files may be "skipped" due to include guard optimization
or #pragma once. This flag makes -H show also such includes.}]>,
MarshallingInfoFlag<DependencyOutputOpts<"ShowSkippedHeaderIncludes">>;
@@ -778,7 +808,8 @@ def I_ : Flag<["-"], "I-">, Group<I_Group>,
HelpText<"Restrict all prior -I flags to double-quoted inclusion and "
"remove current directory from include path">;
def I : JoinedOrSeparate<["-"], "I">, Group<I_Group>,
- Flags<[CC1Option,CC1AsOption,FlangOption,FC1Option]>, MetaVarName<"<dir>">,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, FlangOption, FC1Option]>,
+ MetaVarName<"<dir>">,
HelpText<"Add directory to the end of the list of include search paths">,
DocBrief<[{Add directory to include search path. For C++ inputs, if
there are multiple -I options, these directories are searched
@@ -799,86 +830,111 @@ def MM : Flag<["-"], "MM">, Group<M_Group>,
def MF : JoinedOrSeparate<["-"], "MF">, Group<M_Group>,
HelpText<"Write depfile output from -MMD, -MD, -MM, or -M to <file>">,
MetaVarName<"<file>">;
-def MG : Flag<["-"], "MG">, Group<M_Group>, Flags<[CC1Option]>,
+def MG : Flag<["-"], "MG">, Group<M_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Add missing headers to depfile">,
MarshallingInfoFlag<DependencyOutputOpts<"AddMissingHeaderDeps">>;
def MJ : JoinedOrSeparate<["-"], "MJ">, Group<M_Group>,
HelpText<"Write a compilation database entry per input">;
-def MP : Flag<["-"], "MP">, Group<M_Group>, Flags<[CC1Option]>,
+def MP : Flag<["-"], "MP">, Group<M_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Create phony target for each dependency (other than main file)">,
MarshallingInfoFlag<DependencyOutputOpts<"UsePhonyTargets">>;
-def MQ : JoinedOrSeparate<["-"], "MQ">, Group<M_Group>, Flags<[CC1Option]>,
+def MQ : JoinedOrSeparate<["-"], "MQ">, Group<M_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify name of main file output to quote in depfile">;
-def MT : JoinedOrSeparate<["-"], "MT">, Group<M_Group>, Flags<[CC1Option]>,
+def MT : JoinedOrSeparate<["-"], "MT">, Group<M_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify name of main file output in depfile">,
MarshallingInfoStringVector<DependencyOutputOpts<"Targets">>;
-def MV : Flag<["-"], "MV">, Group<M_Group>, Flags<[CC1Option]>,
+def MV : Flag<["-"], "MV">, Group<M_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Use NMake/Jom format for the depfile">,
MarshallingInfoFlag<DependencyOutputOpts<"OutputFormat">, "DependencyOutputFormat::Make">,
Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">;
def Mach : Flag<["-"], "Mach">, Group<Link_Group>;
-def O0 : Flag<["-"], "O0">, Group<O_Group>, Flags<[CC1Option, FC1Option, HelpHidden]>;
-def O4 : Flag<["-"], "O4">, Group<O_Group>, Flags<[CC1Option, FC1Option, HelpHidden]>;
+def O0 : Flag<["-"], "O0">, Group<O_Group>, Flags<[HelpHidden]>,
+ Visibility<[ClangOption, CC1Option, FC1Option]>;
+def O4 : Flag<["-"], "O4">, Group<O_Group>, Flags<[HelpHidden]>,
+ Visibility<[ClangOption, CC1Option, FC1Option]>;
def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>,
HelpText<"Treat source input files as Objective-C++ inputs">;
def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>,
HelpText<"Treat source input files as Objective-C inputs">;
-def O : Joined<["-"], "O">, Group<O_Group>, Flags<[CC1Option,FC1Option]>;
-def O_flag : Flag<["-"], "O">, Flags<[CC1Option,FC1Option]>, Alias<O>, AliasArgs<["1"]>;
-def Ofast : Joined<["-"], "Ofast">, Group<O_Group>, Flags<[CC1Option, FlangOption]>;
-def P : Flag<["-"], "P">, Flags<[CC1Option,FlangOption,FC1Option]>, Group<Preprocessor_Group>,
+def O : Joined<["-"], "O">, Group<O_Group>,
+ Visibility<[ClangOption, CC1Option, FC1Option]>;
+def O_flag : Flag<["-"], "O">, Visibility<[ClangOption, CC1Option, FC1Option]>,
+ Alias<O>, AliasArgs<["1"]>;
+def Ofast : Joined<["-"], "Ofast">, Group<O_Group>,
+ Visibility<[ClangOption, CC1Option, FlangOption]>;
+def P : Flag<["-"], "P">,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ Group<Preprocessor_Group>,
HelpText<"Disable linemarker output in -E mode">,
MarshallingInfoNegativeFlag<PreprocessorOutputOpts<"ShowLineMarkers">>;
-def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>,
+def Qy : Flag<["-"], "Qy">, Visibility<[ClangOption, CC1Option]>,
HelpText<"Emit metadata containing compiler name and version">;
-def Qn : Flag<["-"], "Qn">, Flags<[CC1Option]>,
+def Qn : Flag<["-"], "Qn">, Visibility<[ClangOption, CC1Option]>,
HelpText<"Do not emit metadata containing compiler name and version">;
def : Flag<["-"], "fident">, Group<f_Group>, Alias<Qy>,
- Flags<[CoreOption, CC1Option]>;
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>;
def : Flag<["-"], "fno-ident">, Group<f_Group>, Alias<Qn>,
- Flags<[CoreOption, CC1Option]>;
-def Qunused_arguments : Flag<["-"], "Qunused-arguments">, Flags<[NoXarchOption, CoreOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>;
+def Qunused_arguments : Flag<["-"], "Qunused-arguments">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Don't emit warning for unused driver arguments">;
def Q : Flag<["-"], "Q">, IgnoredGCCCompat;
-def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option,FlangOption,FC1Option]>, Group<Action_Group>,
+def S : Flag<["-"], "S">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ Group<Action_Group>,
HelpText<"Only run preprocess and compilation steps">;
def T : JoinedOrSeparate<["-"], "T">, Group<T_Group>,
MetaVarName<"<script>">, HelpText<"Specify <script> as linker script">;
def U : JoinedOrSeparate<["-"], "U">, Group<Preprocessor_Group>,
- Flags<[CC1Option, FlangOption, FC1Option]>, MetaVarName<"<macro>">, HelpText<"Undefine macro <macro>">;
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ MetaVarName<"<macro>">, HelpText<"Undefine macro <macro>">;
def V : JoinedOrSeparate<["-"], "V">, Flags<[NoXarchOption, Unsupported]>;
def Wa_COMMA : CommaJoined<["-"], "Wa,">,
HelpText<"Pass the comma separated arguments in <arg> to the assembler">,
MetaVarName<"<arg>">;
-def Wall : Flag<["-"], "Wall">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
-def WCL4 : Flag<["-"], "WCL4">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
-def Wsystem_headers : Flag<["-"], "Wsystem-headers">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
-def Wno_system_headers : Flag<["-"], "Wno-system-headers">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
+def Wall : Flag<["-"], "Wall">, Group<W_Group>, Flags<[HelpHidden]>,
+ Visibility<[ClangOption, CC1Option]>;
+def WCL4 : Flag<["-"], "WCL4">, Group<W_Group>, Flags<[HelpHidden]>,
+ Visibility<[ClangOption, CC1Option]>;
+def Wsystem_headers : Flag<["-"], "Wsystem-headers">, Group<W_Group>,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
+def Wno_system_headers : Flag<["-"], "Wno-system-headers">, Group<W_Group>,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
def Wsystem_headers_in_module_EQ : Joined<["-"], "Wsystem-headers-in-module=">,
- Flags<[CC1Option, HelpHidden]>, MetaVarName<"<module>">,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<module>">,
HelpText<"Enable -Wsystem-headers when building <module>">,
MarshallingInfoStringVector<DiagnosticOpts<"SystemHeaderWarningsModules">>;
-def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<W_Group>, Flags<[CC1Option]>,
+def Wdeprecated : Flag<["-"], "Wdeprecated">, Group<W_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable warnings for deprecated constructs and define __DEPRECATED">;
-def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>, Flags<[CC1Option]>;
+def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group<W_Group>,
+ Visibility<[ClangOption, CC1Option]>;
def Wl_COMMA : CommaJoined<["-"], "Wl,">, Flags<[LinkerInput, RenderAsInput]>,
HelpText<"Pass the comma separated arguments in <arg> to the linker">,
MetaVarName<"<arg>">, Group<Link_Group>;
// FIXME: This is broken; these should not be Joined arguments.
def Wno_nonportable_cfstrings : Joined<["-"], "Wno-nonportable-cfstrings">, Group<W_Group>,
- Flags<[CC1Option]>;
+ Visibility<[ClangOption, CC1Option]>;
def Wnonportable_cfstrings : Joined<["-"], "Wnonportable-cfstrings">, Group<W_Group>,
- Flags<[CC1Option]>;
+ Visibility<[ClangOption, CC1Option]>;
def Wp_COMMA : CommaJoined<["-"], "Wp,">,
HelpText<"Pass the comma separated arguments in <arg> to the preprocessor">,
MetaVarName<"<arg>">, Group<Preprocessor_Group>;
def Wundef_prefix_EQ : CommaJoined<["-"], "Wundef-prefix=">, Group<W_value_Group>,
- Flags<[CC1Option, CoreOption, HelpHidden]>, MetaVarName<"<arg>">,
+ Flags<[HelpHidden]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ MetaVarName<"<arg>">,
HelpText<"Enable warnings for undefined macros with a prefix in the comma separated list <arg>">,
MarshallingInfoStringVector<DiagnosticOpts<"UndefPrefixes">>;
-def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
-def Wno_write_strings : Flag<["-"], "Wno-write-strings">, Group<W_Group>, Flags<[CC1Option, HelpHidden]>;
-def W_Joined : Joined<["-"], "W">, Group<W_Group>, Flags<[CC1Option, CoreOption, FC1Option, FlangOption]>,
+def Wwrite_strings : Flag<["-"], "Wwrite-strings">, Group<W_Group>,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
+def Wno_write_strings : Flag<["-"], "Wno-write-strings">, Group<W_Group>,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
+def W_Joined : Joined<["-"], "W">, Group<W_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FC1Option, FlangOption]>,
MetaVarName<"<warning>">, HelpText<"Enable the specified warning">;
def Xanalyzer : Separate<["-"], "Xanalyzer">,
HelpText<"Pass <arg> to the static analyzer">, MetaVarName<"<arg>">,
@@ -893,8 +949,11 @@ def Xassembler : Separate<["-"], "Xassembler">,
Group<CompileOnly_Group>;
def Xclang : Separate<["-"], "Xclang">,
HelpText<"Pass <arg> to clang -cc1">, MetaVarName<"<arg>">,
- Flags<[NoXarchOption, CoreOption]>, Group<CompileOnly_Group>;
-def : Joined<["-"], "Xclang=">, Group<CompileOnly_Group>, Flags<[NoXarchOption, CoreOption]>, Alias<Xclang>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ Group<CompileOnly_Group>;
+def : Joined<["-"], "Xclang=">, Group<CompileOnly_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ Alias<Xclang>,
HelpText<"Alias for -Xclang">, MetaVarName<"<arg>">;
def Xcuda_fatbinary : Separate<["-"], "Xcuda-fatbinary">,
HelpText<"Pass <arg> to fatbinary invocation">, MetaVarName<"<arg>">;
@@ -940,50 +999,63 @@ def b : JoinedOrSeparate<["-"], "b">, Flags<[LinkerInput]>,
defm offload_uniform_block : BoolFOption<"offload-uniform-block",
LangOpts<"OffloadUniformBlock">, Default<"LangOpts->CUDA">,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Assume">,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Don't assume">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Assume">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option], "Don't assume">,
BothFlags<[], [ClangOption], " that kernels are launched with uniform block sizes (default true for CUDA/HIP and false otherwise)">>;
// OpenCL-only Options
-def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. This option disables all optimizations. By default optimizations are enabled.">;
-def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. This option is added for compatibility with OpenCL 1.0.">;
-def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_single_precision_constant : Flag<["-"], "cl-single-precision-constant">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Treat double precision floating-point constant as single precision constant.">,
MarshallingInfoFlag<LangOpts<"SinglePrecisionConstants">>;
-def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_finite_math_only : Flag<["-"], "cl-finite-math-only">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Allow floating-point optimizations that assume arguments and results are not NaNs or +-Inf.">,
MarshallingInfoFlag<LangOpts<"CLFiniteMathOnly">>;
-def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_kernel_arg_info : Flag<["-"], "cl-kernel-arg-info">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Generate kernel argument metadata.">,
MarshallingInfoFlag<CodeGenOpts<"EmitOpenCLArgMetadata">>;
-def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_unsafe_math_optimizations : Flag<["-"], "cl-unsafe-math-optimizations">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Allow unsafe floating-point optimizations. Also implies -cl-no-signed-zeros and -cl-mad-enable.">,
MarshallingInfoFlag<LangOpts<"CLUnsafeMath">>;
-def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_fast_relaxed_math : Flag<["-"], "cl-fast-relaxed-math">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__.">,
MarshallingInfoFlag<LangOpts<"FastRelaxedMath">>;
-def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Allow use of less precise MAD computations in the generated binary.">,
MarshallingInfoFlag<CodeGenOpts<"LessPreciseFPMAD">>,
ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, cl_fast_relaxed_math.KeyPath]>;
-def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">,
MarshallingInfoFlag<LangOpts<"CLNoSignedZero">>;
-def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL language standard to compile for.">,
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">;
def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>,
HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
-def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Specify that single precision floating-point divide and sqrt used in the program source are correctly rounded.">,
MarshallingInfoFlag<CodeGenOpts<"OpenCLCorrectlyRoundedDivSqrt">>;
-def cl_uniform_work_group_size : Flag<["-"], "cl-uniform-work-group-size">, Group<opencl_Group>, Flags<[CC1Option]>, Alias<foffload_uniform_block>,
+def cl_uniform_work_group_size : Flag<["-"], "cl-uniform-work-group-size">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>, Alias<foffload_uniform_block>,
HelpText<"OpenCL only. Defines that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel">;
def cl_no_stdinc : Flag<["-"], "cl-no-stdinc">, Group<opencl_Group>,
HelpText<"OpenCL only. Disables all standard includes containing non-native compiler types and functions.">;
-def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">, Group<opencl_Group>, Flags<[CC1Option]>,
+def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">, Group<opencl_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"OpenCL only. Enable or disable OpenCL extensions/optional features. The argument is a comma-separated "
"sequence of one or more extension names, each prefixed by '+' or '-'.">,
MarshallingInfoStringVector<TargetOpts<"OpenCLExtensionsAsWritten">>;
@@ -991,27 +1063,36 @@ def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">, Group<opencl_Group>, Flags<[CC1Op
def client__name : JoinedOrSeparate<["-"], "client_name">;
def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>;
def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">;
-def config : Joined<["--"], "config=">, Flags<[NoXarchOption, CoreOption]>, MetaVarName<"<file>">,
+def config : Joined<["--"], "config=">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>, MetaVarName<"<file>">,
HelpText<"Specify configuration file">;
def : Separate<["--"], "config">, Alias<config>;
-def no_default_config : Flag<["--"], "no-default-config">, Flags<[NoXarchOption, CoreOption]>,
+def no_default_config : Flag<["--"], "no-default-config">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable loading default configuration files">;
-def config_system_dir_EQ : Joined<["--"], "config-system-dir=">, Flags<[NoXarchOption, CoreOption, HelpHidden]>,
+def config_system_dir_EQ : Joined<["--"], "config-system-dir=">,
+ Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"System directory for configuration files">;
-def config_user_dir_EQ : Joined<["--"], "config-user-dir=">, Flags<[NoXarchOption, CoreOption, HelpHidden]>,
+def config_user_dir_EQ : Joined<["--"], "config-user-dir=">,
+ Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"User directory for configuration files">;
-def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>, Flags<[CoreOption]>;
+def coverage : Flag<["-", "--"], "coverage">, Group<Link_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def cpp_precomp : Flag<["-"], "cpp-precomp">, Group<clang_ignored_f_Group>;
def current__version : JoinedOrSeparate<["-"], "current_version">;
def cxx_isystem : JoinedOrSeparate<["-"], "cxx-isystem">, Group<clang_i_Group>,
- HelpText<"Add directory to the C++ SYSTEM include search path">, Flags<[CC1Option]>,
+ HelpText<"Add directory to the C++ SYSTEM include search path">,
+ Visibility<[ClangOption, CC1Option]>,
MetaVarName<"<directory>">;
-def c : Flag<["-"], "c">, Flags<[NoXarchOption, FlangOption]>, Group<Action_Group>,
+def c : Flag<["-"], "c">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, FlangOption]>, Group<Action_Group>,
HelpText<"Only run preprocess, compile, and assemble steps">;
defm convergent_functions : BoolFOption<"convergent-functions",
LangOpts<"ConvergentFunctions">, DefaultFalse,
NegFlag<SetFalse, [], [ClangOption], "Assume all functions may be convergent.">,
- PosFlag<SetTrue, [CC1Option], [ClangOption]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option]>>;
// Common offloading options
let Group = offload_Group in {
@@ -1020,20 +1101,26 @@ def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>,
"If 'native' is used the compiler will detect locally installed architectures. "
"For HIP offloading, the device architecture can be followed by target ID features "
"delimited by a colon (e.g. gfx908:xnack+:sramecc-). May be specified more than once.">;
-def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">, Flags<[NoXarchOption]>,
+def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">,
+ Flags<[NoXarchOption]>,
HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. "
"'all' resets the list to its default value.">;
-def offload_new_driver : Flag<["--"], "offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
+def offload_new_driver : Flag<["--"], "offload-new-driver">,
+ Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
MarshallingInfoFlag<LangOpts<"OffloadingNewDriver">>, HelpText<"Use the new driver for offloading compilation.">;
-def no_offload_new_driver : Flag<["--"], "no-offload-new-driver">, Flags<[CC1Option]>, Group<f_Group>,
+def no_offload_new_driver : Flag<["--"], "no-offload-new-driver">,
+ Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
HelpText<"Don't Use the new driver for offloading compilation.">;
-def offload_device_only : Flag<["--"], "offload-device-only">, Flags<[FlangOption]>,
+def offload_device_only : Flag<["--"], "offload-device-only">,
+ Visibility<[ClangOption, FlangOption]>,
HelpText<"Only compile for the offloading device.">;
-def offload_host_only : Flag<["--"], "offload-host-only">, Flags<[FlangOption]>,
+def offload_host_only : Flag<["--"], "offload-host-only">,
+ Visibility<[ClangOption, FlangOption]>,
HelpText<"Only compile for the offloading host.">;
-def offload_host_device : Flag<["--"], "offload-host-device">, Flags<[FlangOption]>,
+def offload_host_device : Flag<["--"], "offload-host-device">,
+ Visibility<[ClangOption, FlangOption]>,
HelpText<"Compile for both the offloading host and device (default).">;
def gpu_use_aux_triple_only : Flag<["--"], "gpu-use-aux-triple-only">,
@@ -1046,12 +1133,13 @@ def nvptx_arch_tool_EQ : Joined<["--"], "nvptx-arch-tool=">,
defm gpu_rdc : BoolFOption<"gpu-rdc",
LangOpts<"GPURelocatableDeviceCode">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Generate relocatable device code, also known as separate compilation mode">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Generate relocatable device code, also known as separate compilation mode">,
NegFlag<SetFalse>>;
def fgpu_default_stream_EQ : Joined<["-"], "fgpu-default-stream=">,
HelpText<"Specify default stream. The default value is 'legacy'. (CUDA/HIP only)">,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
Values<"legacy,per-thread">,
NormalizedValuesScope<"LangOptions::GPUDefaultStreamKind">,
NormalizedValues<["Legacy", "PerThread"]>,
@@ -1063,17 +1151,18 @@ def fno_gpu_flush_denormals_to_zero : Flag<["-"], "fno-gpu-flush-denormals-to-ze
defm gpu_defer_diag : BoolFOption<"gpu-defer-diag",
LangOpts<"GPUDeferDiag">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Defer">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Defer">,
NegFlag<SetFalse, [], [ClangOption], "Don't defer">,
BothFlags<[], [ClangOption], " host/device related diagnostic messages for CUDA/HIP">>;
defm gpu_exclude_wrong_side_overloads : BoolFOption<"gpu-exclude-wrong-side-overloads",
LangOpts<"GPUExcludeWrongSideOverloads">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Always exclude wrong side overloads">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Always exclude wrong side overloads">,
NegFlag<SetFalse, [], [ClangOption], "Exclude wrong side overloads only if there are same side overloads">,
- BothFlags<[HelpHidden], [ClangOption], " in overloading resolution for CUDA/HIP">>;
+ BothFlags<[HelpHidden], [], " in overloading resolution for CUDA/HIP">>;
-def cuid_EQ : Joined<["-"], "cuid=">, Flags<[CC1Option]>,
+def cuid_EQ : Joined<["-"], "cuid=">, Visibility<[ClangOption, CC1Option]>,
HelpText<"An ID for compilation unit, which should be the same for the same "
"compilation unit but
diff erent for
diff erent compilation units. "
"It is used to externalize device-side static variables for single "
@@ -1098,14 +1187,17 @@ def fno_gpu_sanitize : Flag<["-"], "fno-gpu-sanitize">, Group<f_Group>;
// CUDA options
let Group = cuda_Group in {
-def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">, Flags<[NoXarchOption]>,
+def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">,
+ Flags<[NoXarchOption]>,
HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
-def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXarchOption]>,
+def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">,
+ Flags<[NoXarchOption]>,
HelpText<"Do not include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">;
def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">, Flags<[NoXarchOption]>,
Alias<offload_arch_EQ>;
def cuda_feature_EQ : Joined<["--"], "cuda-feature=">, HelpText<"Manually specify the CUDA feature to use">;
-def no_cuda_gpu_arch_EQ : Joined<["--"], "no-cuda-gpu-arch=">, Flags<[NoXarchOption]>,
+def no_cuda_gpu_arch_EQ : Joined<["--"], "no-cuda-gpu-arch=">,
+ Flags<[NoXarchOption]>,
Alias<no_offload_arch_EQ>;
def cuda_device_only : Flag<["--"], "cuda-device-only">, Alias<offload_device_only>,
@@ -1136,7 +1228,8 @@ def : Flag<["-"], "fcuda-rdc">, Alias<fgpu_rdc>;
def : Flag<["-"], "fno-cuda-rdc">, Alias<fno_gpu_rdc>;
defm cuda_short_ptr : BoolFOption<"cuda-short-ptr",
TargetOpts<"NVPTXUseShortPointers">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use 32-bit pointers for accessing const/local/shared address spaces">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use 32-bit pointers for accessing const/local/shared address spaces">,
NegFlag<SetFalse>>;
}
@@ -1149,7 +1242,7 @@ def mprintf_kind_EQ : Joined<["-"], "mprintf-kind=">, Group<m_Group>,
"relies on hostcalls which require system to support pcie atomics) "
"and \"buffered\"(printing happens after all kernel threads exit, "
"this uses a printf buffer and does not rely on pcie atomic support)">,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
Values<"hostcall,buffered">,
NormalizedValuesScope<"TargetOptions::AMDGPUPrintfKind">,
NormalizedValues<["Hostcall", "Buffered"]>,
@@ -1176,19 +1269,19 @@ def fhip_dump_offload_linker_script : Flag<["-"], "fhip-dump-offload-linker-scri
Group<hip_Group>, Flags<[NoArgumentUnused, HelpHidden]>;
defm hip_new_launch_api : BoolFOption<"hip-new-launch-api",
LangOpts<"HIPUseNewLaunchAPI">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
NegFlag<SetFalse, [], [ClangOption], "Don't use">,
BothFlags<[], [ClangOption], " new kernel launching API for HIP">>;
defm hip_fp32_correctly_rounded_divide_sqrt : BoolFOption<"hip-fp32-correctly-rounded-divide-sqrt",
CodeGenOpts<"HIPCorrectlyRoundedDivSqrt">, DefaultTrue,
PosFlag<SetTrue, [], [ClangOption], "Specify">,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Don't specify">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option], "Don't specify">,
BothFlags<[], [ClangOption], " that single precision floating-point divide and sqrt used in "
"the program source are correctly rounded (HIP device compilation only)">>,
ShouldParseIf<hip.KeyPath>;
defm hip_kernel_arg_name : BoolFOption<"hip-kernel-arg-name",
CodeGenOpts<"HIPSaveKernelArgName">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Specify">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Specify">,
NegFlag<SetFalse, [], [ClangOption], "Don't specify">,
BothFlags<[], [ClangOption], " that kernel argument names are preserved (HIP only)">>,
ShouldParseIf<hip.KeyPath>;
@@ -1197,12 +1290,12 @@ def hipspv_pass_plugin_EQ : Joined<["--"], "hipspv-pass-plugin=">,
HelpText<"path to a pass plugin for HIP to SPIR-V passes.">;
defm gpu_allow_device_init : BoolFOption<"gpu-allow-device-init",
LangOpts<"GPUAllowDeviceInit">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Allow">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Allow">,
NegFlag<SetFalse, [], [ClangOption], "Don't allow">,
BothFlags<[], [ClangOption], " device side init function in HIP (experimental)">>,
ShouldParseIf<hip.KeyPath>;
def gpu_max_threads_per_block_EQ : Joined<["--"], "gpu-max-threads-per-block=">,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Default max threads per block for kernel launch bounds for HIP">,
MarshallingInfoInt<LangOpts<"GPUMaxThreadsPerBlock">, "1024">,
ShouldParseIf<hip.KeyPath>;
@@ -1225,28 +1318,31 @@ def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path
HelpText<"Path to libomptarget-amdgcn bitcode library">, Alias<libomptarget_amdgpu_bc_path_EQ>;
def libomptarget_nvptx_bc_path_EQ : Joined<["--"], "libomptarget-nvptx-bc-path=">, Group<i_Group>,
HelpText<"Path to libomptarget-nvptx bitcode library">;
-def dD : Flag<["-"], "dD">, Group<d_Group>, Flags<[CC1Option]>,
+def dD : Flag<["-"], "dD">, Group<d_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Print macro definitions in -E mode in addition to normal output">;
-def dI : Flag<["-"], "dI">, Group<d_Group>, Flags<[CC1Option]>,
+def dI : Flag<["-"], "dI">, Group<d_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Print include directives in -E mode in addition to normal output">,
MarshallingInfoFlag<PreprocessorOutputOpts<"ShowIncludeDirectives">>;
-def dM : Flag<["-"], "dM">, Group<d_Group>, Flags<[CC1Option]>,
+def dM : Flag<["-"], "dM">, Group<d_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Print macro definitions in -E mode instead of normal output">;
def dead__strip : Flag<["-"], "dead_strip">;
-def dependency_file : Separate<["-"], "dependency-file">, Flags<[CC1Option]>,
+def dependency_file : Separate<["-"], "dependency-file">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Filename (or -) to write dependency output to">,
MarshallingInfoString<DependencyOutputOpts<"OutputFile">>;
-def dependency_dot : Separate<["-"], "dependency-dot">, Flags<[CC1Option]>,
+def dependency_dot : Separate<["-"], "dependency-dot">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Filename to write DOT-formatted header dependencies to">,
MarshallingInfoString<DependencyOutputOpts<"DOTOutputFile">>;
def module_dependency_dir : Separate<["-"], "module-dependency-dir">,
- Flags<[CC1Option]>, HelpText<"Directory to dump module dependencies to">,
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Directory to dump module dependencies to">,
MarshallingInfoString<DependencyOutputOpts<"ModuleDependencyOutputDir">>;
def dsym_dir : JoinedOrSeparate<["-"], "dsym-dir">,
Flags<[NoXarchOption, RenderAsInput]>,
HelpText<"Directory to output dSYM's (if any) to">, MetaVarName<"<dir>">;
// GCC style -dumpdir. We intentionally don't implement the less useful -dumpbase{,-ext}.
-def dumpdir : Separate<["-"], "dumpdir">, Flags<[CC1Option]>,
+def dumpdir : Separate<["-"], "dumpdir">, Visibility<[ClangOption, CC1Option]>,
MetaVarName<"<dumppfx>">,
HelpText<"Use <dumpfpx> as a prefix to form auxiliary and dump file names">;
def dumpmachine : Flag<["-"], "dumpmachine">;
@@ -1259,31 +1355,42 @@ def dynamiclib : Flag<["-"], "dynamiclib">;
def dynamic : Flag<["-"], "dynamic">, Flags<[NoArgumentUnused]>;
def d_Flag : Flag<["-"], "d">, Group<d_Group>;
def d_Joined : Joined<["-"], "d">, Group<d_Group>;
-def emit_ast : Flag<["-"], "emit-ast">, Flags<[CoreOption]>,
+def emit_ast : Flag<["-"], "emit-ast">,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Emit Clang AST files for source inputs">;
-def emit_llvm : Flag<["-"], "emit-llvm">, Flags<[CC1Option, FC1Option, FlangOption]>, Group<Action_Group>,
+def emit_llvm : Flag<["-"], "emit-llvm">,
+ Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>,
+ Group<Action_Group>,
HelpText<"Use the LLVM representation for assembler and object files">;
-def emit_interface_stubs : Flag<["-"], "emit-interface-stubs">, Flags<[CC1Option]>, Group<Action_Group>,
+def emit_interface_stubs : Flag<["-"], "emit-interface-stubs">,
+ Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
HelpText<"Generate Interface Stub Files.">;
def emit_merged_ifs : Flag<["-"], "emit-merged-ifs">,
- Flags<[CC1Option]>, Group<Action_Group>,
+ Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
HelpText<"Generate Interface Stub Files, emit merged text not binary.">;
-def end_no_unused_arguments : Flag<["--"], "end-no-unused-arguments">, Flags<[CoreOption]>,
+def end_no_unused_arguments : Flag<["--"], "end-no-unused-arguments">,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Start emitting warnings for unused driver arguments">;
-def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version=">, Flags<[CC1Option]>;
+def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version=">,
+ Visibility<[ClangOption, CC1Option]>;
def exported__symbols__list : Separate<["-"], "exported_symbols_list">;
-def extract_api : Flag<["-"], "extract-api">, Flags<[CC1Option]>, Group<Action_Group>,
+def extract_api : Flag<["-"], "extract-api">,
+ Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
HelpText<"Extract API information">;
-def product_name_EQ: Joined<["--"], "product-name=">, Flags<[CC1Option]>,
+def product_name_EQ: Joined<["--"], "product-name=">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoString<FrontendOpts<"ProductName">>;
-def emit_symbol_graph_EQ: JoinedOrSeparate<["--"], "emit-symbol-graph=">, Flags<[CC1Option]>,
+def emit_symbol_graph_EQ: JoinedOrSeparate<["--"], "emit-symbol-graph=">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Generate Extract API information as a side effect of compilation.">,
MarshallingInfoString<FrontendOpts<"SymbolGraphOutputDir">>;
-def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">, Flags<[CC1Option]>,
+def extract_api_ignores_EQ: CommaJoined<["--"], "extract-api-ignores=">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Comma separated list of files containing a new line separated list of API symbols to ignore when extracting API information.">,
MarshallingInfoStringVector<FrontendOpts<"ExtractAPIIgnoresFileList">>;
def e : JoinedOrSeparate<["-"], "e">, Flags<[LinkerInput]>, Group<Link_Group>;
-def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>, Flags<[CC1Option]>,
+def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
MarshallingInfoInt<LangOpts<"MaxTokens">>;
def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
@@ -1292,37 +1399,43 @@ def fPIE : Flag<["-"], "fPIE">, Group<f_Group>;
def fno_PIE : Flag<["-"], "fno-PIE">, Group<f_Group>;
defm access_control : BoolFOption<"access-control",
LangOpts<"AccessControl">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable C++ access control">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Disable C++ access control">,
PosFlag<SetTrue>>;
def falign_functions : Flag<["-"], "falign-functions">, Group<f_Group>;
def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group<f_Group>;
-def falign_loops_EQ : Joined<["-"], "falign-loops=">, Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<N>">,
+def falign_loops_EQ : Joined<["-"], "falign-loops=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>, MetaVarName<"<N>">,
HelpText<"N must be a power of two. Align loops to the boundary">,
MarshallingInfoInt<CodeGenOpts<"LoopAlignment">>;
def fno_align_functions: Flag<["-"], "fno-align-functions">, Group<f_Group>;
defm allow_editor_placeholders : BoolFOption<"allow-editor-placeholders",
LangOpts<"AllowEditorPlaceholders">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Treat editor placeholders as valid source code">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Treat editor placeholders as valid source code">,
NegFlag<SetFalse>>;
def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group<f_Group>;
-def fapple_kext : Flag<["-"], "fapple-kext">, Group<f_Group>, Flags<[CC1Option]>,
+def fapple_kext : Flag<["-"], "fapple-kext">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use Apple's kernel extensions ABI">,
MarshallingInfoFlag<LangOpts<"AppleKext">>;
def fstrict_flex_arrays_EQ : Joined<["-"], "fstrict-flex-arrays=">, Group<f_Group>,
MetaVarName<"<n>">, Values<"0,1,2,3">,
LangOpts<"StrictFlexArraysLevel">,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
NormalizedValuesScope<"LangOptions::StrictFlexArraysLevelKind">,
NormalizedValues<["Default", "OneZeroOrIncomplete", "ZeroOrIncomplete", "IncompleteOnly"]>,
HelpText<"Enable optimizations based on the strict definition of flexible arrays">,
MarshallingInfoEnum<LangOpts<"StrictFlexArraysLevel">, "Default">;
defm apple_pragma_pack : BoolFOption<"apple-pragma-pack",
LangOpts<"ApplePragmaPack">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable Apple gcc-compatible #pragma pack handling">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable Apple gcc-compatible #pragma pack handling">,
NegFlag<SetFalse>>;
defm xl_pragma_pack : BoolFOption<"xl-pragma-pack",
LangOpts<"XLPragmaPack">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable IBM XL #pragma pack handling">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable IBM XL #pragma pack handling">,
NegFlag<SetFalse>>;
def shared_libsan : Flag<["-"], "shared-libsan">,
HelpText<"Dynamically link the sanitizer runtime">;
@@ -1334,9 +1447,9 @@ def fasm : Flag<["-"], "fasm">, Group<f_Group>;
defm assume_unique_vtables : BoolFOption<"assume-unique-vtables",
CodeGenOpts<"AssumeUniqueVTables">, DefaultTrue,
PosFlag<SetTrue>,
- NegFlag<SetFalse, [CC1Option], [ClangOption],
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
"Disable optimizations based on vtable pointer identity">,
- BothFlags<[CoreOption]>>;
+ BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
def fassume_sane_operator_new : Flag<["-"], "fassume-sane-operator-new">, Group<f_Group>;
def fastcp : Flag<["-"], "fastcp">, Group<f_Group>;
@@ -1350,7 +1463,8 @@ defm double_square_bracket_attributes : BoolFOption<"double-square-bracket-attri
defm autolink : BoolFOption<"autolink",
CodeGenOpts<"Autolink">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable generation of linker directives for automatic library linking">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Disable generation of linker directives for automatic library linking">,
PosFlag<SetTrue>>;
// In the future this option will be supported by other offloading
@@ -1362,17 +1476,20 @@ def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>,
// C++ Coroutines
defm coroutines : BoolFOption<"coroutines",
LangOpts<"Coroutines">, Default<cpp20.KeyPath>,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable support for the C++ Coroutines">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable support for the C++ Coroutines">,
NegFlag<SetFalse>>;
defm coro_aligned_allocation : BoolFOption<"coro-aligned-allocation",
LangOpts<"CoroAlignedAllocation">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Prefer aligned allocation for C++ Coroutines">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Prefer aligned allocation for C++ Coroutines">,
NegFlag<SetFalse>>;
defm experimental_library : BoolFOption<"experimental-library",
LangOpts<"ExperimentalLibrary">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option, CoreOption], [ClangOption], "Control whether unstable and experimental library features are enabled. "
+ PosFlag<SetTrue, [], [ClangOption, CC1Option, CLOption, DXCOption],
+ "Control whether unstable and experimental library features are enabled. "
"This option enables various library features that are either experimental (also known as TSes), or have been "
"but are not stable yet in the selected Standard Library implementation. It is not recommended to use this option "
"in production code, since neither ABI nor API stability are guaranteed. This is intended to provide a preview "
@@ -1380,11 +1497,13 @@ defm experimental_library : BoolFOption<"experimental-library",
NegFlag<SetFalse>>;
def fembed_offload_object_EQ : Joined<["-"], "fembed-offload-object=">,
- Group<f_Group>, Flags<[NoXarchOption, CC1Option, FC1Option]>,
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, FC1Option]>,
HelpText<"Embed Offloading device-side binary into host object file as a section.">,
MarshallingInfoStringVector<CodeGenOpts<"OffloadObjects">>;
def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">,
- Group<f_Group>, Flags<[NoXarchOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption]>, MetaVarName<"<option>">,
HelpText<"Embed LLVM bitcode">,
Values<"off,all,bitcode,marker">, NormalizedValuesScope<"CodeGenOptions">,
NormalizedValues<["Embed_Off", "Embed_All", "Embed_Bitcode", "Embed_Marker"]>,
@@ -1397,19 +1516,22 @@ def fembed_bitcode_marker : Flag<["-"], "fembed-bitcode-marker">,
HelpText<"Embed placeholder LLVM IR data as a marker">;
defm gnu_inline_asm : BoolFOption<"gnu-inline-asm",
LangOpts<"GNUAsm">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable GNU style inline asm">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Disable GNU style inline asm">,
PosFlag<SetTrue>>;
def fprofile_sample_use : Flag<["-"], "fprofile-sample-use">, Group<f_Group>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fno_profile_sample_use : Flag<["-"], "fno-profile-sample-use">, Group<f_Group>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
- Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable sample-based profile guided optimizations">,
MarshallingInfoString<CodeGenOpts<"SampleProfileFile">>;
def fprofile_sample_accurate : Flag<["-"], "fprofile-sample-accurate">,
- Group<f_Group>, Flags<[NoXarchOption, CC1Option]>,
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specifies that the sample profile is accurate">,
DocBrief<[{Specifies that the sample profile is accurate. If the sample
profile is accurate, callsites without profile samples are marked
@@ -1417,7 +1539,8 @@ def fprofile_sample_accurate : Flag<["-"], "fprofile-sample-accurate">,
we have no profile}]>,
MarshallingInfoFlag<CodeGenOpts<"ProfileSampleAccurate">>;
def fsample_profile_use_profi : Flag<["-"], "fsample-profile-use-profi">,
- Flags<[NoXarchOption, CC1Option]>, Group<f_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
+ Group<f_Group>,
HelpText<"Use profi to infer block and edge counts">,
DocBrief<[{Infer block and edge counts. If the profiles have errors or missing
blocks caused by sampling, profile inference (profi) can convert
@@ -1436,68 +1559,79 @@ def fauto_profile_accurate : Flag<["-"], "fauto-profile-accurate">,
def fno_auto_profile_accurate : Flag<["-"], "fno-auto-profile-accurate">,
Group<f_Group>, Alias<fno_profile_sample_accurate>;
def fdebug_compilation_dir_EQ : Joined<["-"], "fdebug-compilation-dir=">,
- Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
+ Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
HelpText<"The compilation directory to embed in the debug info">,
MarshallingInfoString<CodeGenOpts<"DebugCompilationDir">>;
def fdebug_compilation_dir : Separate<["-"], "fdebug-compilation-dir">,
- Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
+ Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
Alias<fdebug_compilation_dir_EQ>;
def fcoverage_compilation_dir_EQ : Joined<["-"], "fcoverage-compilation-dir=">,
- Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>,
+ Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
HelpText<"The compilation directory to embed in the coverage mapping.">,
MarshallingInfoString<CodeGenOpts<"CoverageCompilationDir">>;
def ffile_compilation_dir_EQ : Joined<["-"], "ffile-compilation-dir=">, Group<f_Group>,
- Flags<[CoreOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"The compilation directory to embed in the debug info and coverage mapping.">;
defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling",
CodeGenOpts<"DebugInfoForProfiling">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Emit extra debug info to make sample profile more accurate">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Emit extra debug info to make sample profile more accurate">,
NegFlag<SetFalse>>;
def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
def fprofile_instr_generate_EQ : Joined<["-"], "fprofile-instr-generate=">,
- Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<file>">,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ MetaVarName<"<file>">,
HelpText<"Generate instrumented code to collect execution counts into <file> (overridden by LLVM_PROFILE_FILE env var)">;
def fprofile_instr_use : Flag<["-"], "fprofile-instr-use">, Group<f_Group>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fprofile_instr_use_EQ : Joined<["-"], "fprofile-instr-use=">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Use instrumentation data for profile-guided optimization">;
def fprofile_remapping_file_EQ : Joined<["-"], "fprofile-remapping-file=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>, MetaVarName<"<file>">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ MetaVarName<"<file>">,
HelpText<"Use the remappings described in <file> to match the profile data against names in the program">,
MarshallingInfoString<CodeGenOpts<"ProfileRemappingFile">>;
defm coverage_mapping : BoolFOption<"coverage-mapping",
CodeGenOpts<"CoverageMapping">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Generate coverage mapping to enable code coverage analysis">,
- NegFlag<SetFalse, [], [ClangOption], "Disable code coverage analysis">, BothFlags<[CoreOption]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Generate coverage mapping to enable code coverage analysis">,
+ NegFlag<SetFalse, [], [ClangOption], "Disable code coverage analysis">, BothFlags<
+ [], [ClangOption, CLOption, DXCOption]>>;
def fprofile_generate : Flag<["-"], "fprofile-generate">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Generate instrumented code to collect execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
def fprofile_generate_EQ : Joined<["-"], "fprofile-generate=">,
- Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<directory>">,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ MetaVarName<"<directory>">,
HelpText<"Generate instrumented code to collect execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
def fcs_profile_generate : Flag<["-"], "fcs-profile-generate">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Generate instrumented code to collect context sensitive execution counts into default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
def fcs_profile_generate_EQ : Joined<["-"], "fcs-profile-generate=">,
- Group<f_Group>, Flags<[CoreOption]>, MetaVarName<"<directory>">,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ MetaVarName<"<directory>">,
HelpText<"Generate instrumented code to collect context sensitive execution counts into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
def fprofile_use : Flag<["-"], "fprofile-use">, Group<f_Group>,
- Flags<[CoreOption]>, Alias<fprofile_instr_use>;
+ Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fprofile_instr_use>;
def fprofile_use_EQ : Joined<["-"], "fprofile-use=">,
- Group<f_Group>, Flags<[NoXarchOption, CoreOption]>,
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
MetaVarName<"<pathname>">,
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>.">;
def fno_profile_instr_generate : Flag<["-"], "fno-profile-instr-generate">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable generation of profile instrumentation.">;
def fno_profile_generate : Flag<["-"], "fno-profile-generate">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable generation of profile instrumentation.">;
def fno_profile_instr_use : Flag<["-"], "fno-profile-instr-use">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable using instrumentation data for profile-guided optimization">;
def fno_profile_use : Flag<["-"], "fno-profile-use">,
Alias<fno_profile_instr_use>;
@@ -1508,41 +1642,45 @@ def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group<f_Group>,
HelpText<"Instrument code to produce gcov data files (*.gcda)">;
def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group<f_Group>;
def fprofile_filter_files_EQ : Joined<["-"], "fprofile-filter-files=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Instrument only functions from files where names match any regex separated by a semi-colon">,
MarshallingInfoString<CodeGenOpts<"ProfileFilterFiles">>;
def fprofile_exclude_files_EQ : Joined<["-"], "fprofile-exclude-files=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Instrument only functions from files where names don't match all the regexes separated by a semi-colon">,
MarshallingInfoString<CodeGenOpts<"ProfileExcludeFiles">>;
def fprofile_update_EQ : Joined<["-"], "fprofile-update=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>, Values<"atomic,prefer-atomic,single">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ Values<"atomic,prefer-atomic,single">,
MetaVarName<"<method>">, HelpText<"Set update method of profile counters">,
MarshallingInfoFlag<CodeGenOpts<"AtomicProfileUpdate">>;
defm pseudo_probe_for_profiling : BoolFOption<"pseudo-probe-for-profiling",
CodeGenOpts<"PseudoProbeForProfiling">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Emit">,
NegFlag<SetFalse, [], [ClangOption], "Do not emit">,
- BothFlags<[NoXarchOption, CC1Option], [ClangOption], " pseudo probes for sample profiling">>;
+ BothFlags<[NoXarchOption], [ClangOption, CC1Option],
+ " pseudo probes for sample profiling">>;
def forder_file_instrumentation : Flag<["-"], "forder-file-instrumentation">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Generate instrumented code to collect order file into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Filename defining the list of functions/files to instrument. "
"The file uses the sanitizer special case list format.">,
MarshallingInfoStringVector<LangOpts<"ProfileListFiles">>;
def fprofile_function_groups : Joined<["-"], "fprofile-function-groups=">,
- Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<N>">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>, MetaVarName<"<N>">,
HelpText<"Partition functions into N groups and select only functions in group i to be instrumented using -fprofile-selected-function-group">,
MarshallingInfoInt<CodeGenOpts<"ProfileTotalFunctionGroups">, "1">;
def fprofile_selected_function_group :
Joined<["-"], "fprofile-selected-function-group=">, Group<f_Group>,
- Flags<[CC1Option]>, MetaVarName<"<i>">,
+ Visibility<[ClangOption, CC1Option]>, MetaVarName<"<i>">,
HelpText<"Partition functions into N groups using -fprofile-function-groups and select only functions in group i to be instrumented. The valid range is 0 to N-1 inclusive">,
MarshallingInfoInt<CodeGenOpts<"ProfileSelectedFunctionGroup">>;
def fswift_async_fp_EQ : Joined<["-"], "fswift-async-fp=">,
- Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>, MetaVarName<"<option>">,
+ Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
+ MetaVarName<"<option>">,
HelpText<"Control emission of Swift async extended frame info">,
Values<"auto,always,never">,
NormalizedValuesScope<"CodeGenOptions::SwiftAsyncFramePointerKind">,
@@ -1551,41 +1689,53 @@ def fswift_async_fp_EQ : Joined<["-"], "fswift-async-fp=">,
defm addrsig : BoolFOption<"addrsig",
CodeGenOpts<"Addrsig">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Emit">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Emit">,
NegFlag<SetFalse, [], [ClangOption], "Don't emit">,
- BothFlags<[CoreOption], [ClangOption], " an address-significance table">>;
-defm blocks : OptInCC1FFlag<"blocks", "Enable the 'blocks' language feature", "", "", [CoreOption]>;
+ BothFlags<[], [ClangOption, CLOption, DXCOption],
+ " an address-significance table">>;
+defm blocks : OptInCC1FFlag<"blocks", "Enable the 'blocks' language feature",
+ "", "", [ClangOption, CLOption]>;
def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group<f_Group>;
defm borland_extensions : BoolFOption<"borland-extensions",
LangOpts<"Borland">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Accept non-standard constructs supported by the Borland compiler">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Accept non-standard constructs supported by the Borland compiler">,
NegFlag<SetFalse>>;
-def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>, Flags<[CoreOption]>;
+def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group<f_Group>,
Flags<[NoXarchOption]>, HelpText<"Load the clang builtins module map file.">;
defm caret_diagnostics : BoolFOption<"caret-diagnostics",
DiagnosticOpts<"ShowCarets">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption]>,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
PosFlag<SetTrue>>;
def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group<f_clang_Group>,
- Flags<[CC1Option]>, MetaVarName<"<version>">, Values<"<major>.<minor>,latest">,
+ Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<version>">, Values<"<major>.<minor>,latest">,
HelpText<"Attempt to match the ABI of Clang <version>">;
def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>;
def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group<f_Group>,
- Flags<[CoreOption, CC1Option, FlangOption, FC1Option]>,
+
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Enable colors in diagnostics">;
def fno_color_diagnostics : Flag<["-"], "fno-color-diagnostics">, Group<f_Group>,
- Flags<[CoreOption, FlangOption]>, HelpText<"Disable colors in diagnostics">;
-def : Flag<["-"], "fdiagnostics-color">, Group<f_Group>, Flags<[CoreOption]>, Alias<fcolor_diagnostics>;
-def : Flag<["-"], "fno-diagnostics-color">, Group<f_Group>, Flags<[CoreOption]>, Alias<fno_color_diagnostics>;
+ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
+ HelpText<"Disable colors in diagnostics">;
+def : Flag<["-"], "fdiagnostics-color">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fcolor_diagnostics>;
+def : Flag<["-"], "fno-diagnostics-color">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fno_color_diagnostics>;
def fdiagnostics_color_EQ : Joined<["-"], "fdiagnostics-color=">, Group<f_Group>;
def fansi_escape_codes : Flag<["-"], "fansi-escape-codes">, Group<f_Group>,
- Flags<[CoreOption, CC1Option]>, HelpText<"Use ANSI escape codes for diagnostics">,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
+ HelpText<"Use ANSI escape codes for diagnostics">,
MarshallingInfoFlag<DiagnosticOpts<"UseANSIEscapeCodes">>;
-def fcomment_block_commands : CommaJoined<["-"], "fcomment-block-commands=">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def fcomment_block_commands : CommaJoined<["-"], "fcomment-block-commands=">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Treat each comma separated argument in <arg> as a documentation comment block command">,
MetaVarName<"<arg>">, MarshallingInfoStringVector<LangOpts<"CommentOpts.BlockCommandNames">>;
-def fparse_all_comments : Flag<["-"], "fparse-all-comments">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def fparse_all_comments : Flag<["-"], "fparse-all-comments">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"CommentOpts.ParseAllComments">>;
def frecord_command_line : Flag<["-"], "frecord-command-line">,
DocBrief<[{Generate a section named ".GCC.command.line" containing the clang
@@ -1601,7 +1751,8 @@ def fno_record_command_line : Flag<["-"], "fno-record-command-line">,
def : Flag<["-"], "frecord-gcc-switches">, Alias<frecord_command_line>;
def : Flag<["-"], "fno-record-gcc-switches">, Alias<fno_record_command_line>;
def fcommon : Flag<["-"], "fcommon">, Group<f_Group>,
- Flags<[CoreOption, CC1Option]>, HelpText<"Place uninitialized global variables in a common block">,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
+ HelpText<"Place uninitialized global variables in a common block">,
MarshallingInfoNegativeFlag<CodeGenOpts<"NoCommon">>,
DocBrief<[{Place definitions of variables with no storage class and no initializer
(tentative definitions) in a common block, instead of generating individual
@@ -1609,101 +1760,118 @@ zero-initialized definitions (default -fno-common).}]>;
def fcompile_resource_EQ : Joined<["-"], "fcompile-resource=">, Group<f_Group>;
defm complete_member_pointers : BoolOption<"f", "complete-member-pointers",
LangOpts<"CompleteMemberPointers">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Require">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Require">,
NegFlag<SetFalse, [], [ClangOption], "Do not require">,
- BothFlags<[CoreOption], [ClangOption], " member pointer base types to be complete if they"
+ BothFlags<[], [ClangOption, CLOption, DXCOption],
+ " member pointer base types to be complete if they"
" would be significant under the Microsoft ABI">>,
Group<f_clang_Group>;
def fcf_runtime_abi_EQ : Joined<["-"], "fcf-runtime-abi=">, Group<f_Group>,
- Flags<[CC1Option]>, Values<"unspecified,standalone,objc,swift,swift-5.0,swift-4.2,swift-4.1">,
+ Visibility<[ClangOption, CC1Option]>,
+ Values<"unspecified,standalone,objc,swift,swift-5.0,swift-4.2,swift-4.1">,
NormalizedValuesScope<"LangOptions::CoreFoundationABI">,
NormalizedValues<["ObjectiveC", "ObjectiveC", "ObjectiveC", "Swift5_0", "Swift5_0", "Swift4_2", "Swift4_1"]>,
MarshallingInfoEnum<LangOpts<"CFRuntime">, "ObjectiveC">;
defm constant_cfstrings : BoolFOption<"constant-cfstrings",
LangOpts<"NoConstantCFStrings">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption], "Disable creation of CodeFoundation-type constant strings">,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Disable creation of CodeFoundation-type constant strings">,
PosFlag<SetFalse>>;
def fconstant_string_class_EQ : Joined<["-"], "fconstant-string-class=">, Group<f_Group>;
-def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group<f_Group>, Flags<[CC1Option]>,
+def fconstexpr_depth_EQ : Joined<["-"], "fconstexpr-depth=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the maximum depth of recursive constexpr function calls">,
MarshallingInfoInt<LangOpts<"ConstexprCallDepth">, "512">;
-def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group<f_Group>, Flags<[CC1Option]>,
+def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the maximum number of steps in constexpr function evaluation">,
MarshallingInfoInt<LangOpts<"ConstexprStepLimit">, "1048576">;
def fexperimental_new_constant_interpreter : Flag<["-"], "fexperimental-new-constant-interpreter">, Group<f_Group>,
- HelpText<"Enable the experimental new constant interpreter">, Flags<[CC1Option]>,
+ HelpText<"Enable the experimental new constant interpreter">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"EnableNewConstInterp">>;
-def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">, Group<f_Group>, Flags<[CC1Option]>,
+def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit)">,
MarshallingInfoInt<DiagnosticOpts<"ConstexprBacktraceLimit">, "DiagnosticOptions::DefaultConstexprBacktraceLimit">;
-def fcrash_diagnostics_EQ : Joined<["-"], "fcrash-diagnostics=">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
+def fcrash_diagnostics_EQ : Joined<["-"], "fcrash-diagnostics=">, Group<f_clang_Group>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Set level of crash diagnostic reporting, (option: off, compiler, all)">;
-def fcrash_diagnostics : Flag<["-"], "fcrash-diagnostics">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
+def fcrash_diagnostics : Flag<["-"], "fcrash-diagnostics">, Group<f_clang_Group>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Enable crash diagnostic reporting (default)">, Alias<fcrash_diagnostics_EQ>, AliasArgs<["compiler"]>;
-def fno_crash_diagnostics : Flag<["-"], "fno-crash-diagnostics">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
+def fno_crash_diagnostics : Flag<["-"], "fno-crash-diagnostics">, Group<f_clang_Group>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
Alias<gen_reproducer_eq>, AliasArgs<["off"]>,
HelpText<"Disable auto-generation of preprocessed source files and a script for reproduction during a clang crash">;
def fcrash_diagnostics_dir : Joined<["-"], "fcrash-diagnostics-dir=">,
- Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
+ Group<f_clang_Group>, Flags<[NoArgumentUnused]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Put crash-report files in <dir>">, MetaVarName<"<dir>">;
def fcreate_profile : Flag<["-"], "fcreate-profile">, Group<f_Group>;
defm cxx_exceptions: BoolFOption<"cxx-exceptions",
LangOpts<"CXXExceptions">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable C++ exceptions">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable C++ exceptions">,
NegFlag<SetFalse>>;
defm async_exceptions: BoolFOption<"async-exceptions",
LangOpts<"EHAsynch">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable EH Asynchronous exceptions">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable EH Asynchronous exceptions">,
NegFlag<SetFalse>>;
defm cxx_modules : BoolFOption<"cxx-modules",
LangOpts<"CPlusPlusModules">, Default<cpp20.KeyPath>,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option], "Disable">,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
- BothFlags<[NoXarchOption], [ClangOption], " modules for C++">>,
+ BothFlags<[NoXarchOption], [], " modules for C++">>,
ShouldParseIf<cplusplus.KeyPath>;
def fdebug_pass_arguments : Flag<["-"], "fdebug-pass-arguments">, Group<f_Group>;
def fdebug_pass_structure : Flag<["-"], "fdebug-pass-structure">, Group<f_Group>;
def fdepfile_entry : Joined<["-"], "fdepfile-entry=">,
- Group<f_clang_Group>, Flags<[CC1Option]>;
+ Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>;
def fdiagnostics_fixit_info : Flag<["-"], "fdiagnostics-fixit-info">, Group<f_clang_Group>;
def fno_diagnostics_fixit_info : Flag<["-"], "fno-diagnostics-fixit-info">, Group<f_Group>,
- Flags<[CC1Option]>, HelpText<"Do not include fixit information in diagnostics">,
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Do not include fixit information in diagnostics">,
MarshallingInfoNegativeFlag<DiagnosticOpts<"ShowFixits">>;
def fdiagnostics_parseable_fixits : Flag<["-"], "fdiagnostics-parseable-fixits">, Group<f_clang_Group>,
- Flags<[CoreOption, CC1Option]>, HelpText<"Print fix-its in machine parseable form">,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
+ HelpText<"Print fix-its in machine parseable form">,
MarshallingInfoFlag<DiagnosticOpts<"ShowParseableFixits">>;
def fdiagnostics_print_source_range_info : Flag<["-"], "fdiagnostics-print-source-range-info">,
- Group<f_clang_Group>, Flags<[CC1Option]>,
+ Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Print source range spans in numeric form">,
MarshallingInfoFlag<DiagnosticOpts<"ShowSourceRanges">>;
defm diagnostics_show_hotness : BoolFOption<"diagnostics-show-hotness",
CodeGenOpts<"DiagnosticsWithHotness">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable profile hotness information in diagnostic line">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable profile hotness information in diagnostic line">,
NegFlag<SetFalse>>;
def fdiagnostics_hotness_threshold_EQ : Joined<["-"], "fdiagnostics-hotness-threshold=">,
- Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<value>">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<value>">,
HelpText<"Prevent optimization remarks from being output if they do not have at least this profile count. "
"Use 'auto' to apply the threshold from profile summary">;
def fdiagnostics_misexpect_tolerance_EQ : Joined<["-"], "fdiagnostics-misexpect-tolerance=">,
- Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<value>">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<value>">,
HelpText<"Prevent misexpect diagnostics from being output if the profile counts are within N% of the expected. ">;
defm diagnostics_show_option : BoolFOption<"diagnostics-show-option",
DiagnosticOpts<"ShowOptionNames">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption]>,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
PosFlag<SetTrue, [], [ClangOption], "Print option name with mappable diagnostics">>;
defm diagnostics_show_note_include_stack : BoolFOption<"diagnostics-show-note-include-stack",
DiagnosticOpts<"ShowNoteIncludeStack">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Display include stacks for diagnostic notes">,
- NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
def fdiagnostics_format_EQ : Joined<["-"], "fdiagnostics-format=">, Group<f_clang_Group>;
def fdiagnostics_show_category_EQ : Joined<["-"], "fdiagnostics-show-category=">, Group<f_clang_Group>;
def fdiagnostics_show_template_tree : Flag<["-"], "fdiagnostics-show-template-tree">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Print a template comparison tree for
diff ering templates">,
MarshallingInfoFlag<DiagnosticOpts<"ShowTemplateTree">>;
defm safe_buffer_usage_suggestions : BoolFOption<"safe-buffer-usage-suggestions",
DiagnosticOpts<"ShowSafeBufferUsageSuggestions">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption],
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
"Display suggestions to update code associated with -Wunsafe-buffer-usage warnings">,
NegFlag<SetFalse>>;
def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">, Group<f_clang_Group>,
@@ -1714,36 +1882,40 @@ defm dollars_in_identifiers : BoolFOption<"dollars-in-identifiers",
LangOpts<"DollarIdents">, Default<!strconcat("!", asm_preprocessor.KeyPath)>,
PosFlag<SetTrue, [], [ClangOption], "Allow">,
NegFlag<SetFalse, [], [ClangOption], "Disallow">,
- BothFlags<[CC1Option], [ClangOption], " '$' in identifiers">>;
+ BothFlags<[], [ClangOption, CC1Option], " '$' in identifiers">>;
def fdwarf2_cfi_asm : Flag<["-"], "fdwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
def fno_dwarf2_cfi_asm : Flag<["-"], "fno-dwarf2-cfi-asm">, Group<clang_ignored_f_Group>;
defm dwarf_directory_asm : BoolFOption<"dwarf-directory-asm",
CodeGenOpts<"NoDwarfDirectoryAsm">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption]>,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option]>,
PosFlag<SetFalse>>;
defm elide_constructors : BoolFOption<"elide-constructors",
LangOpts<"ElideConstructors">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable C++ copy constructor elision">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Disable C++ copy constructor elision">,
PosFlag<SetTrue>>;
def fno_elide_type : Flag<["-"], "fno-elide-type">, Group<f_Group>,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Do not elide types when printing diagnostics">,
MarshallingInfoNegativeFlag<DiagnosticOpts<"ElideType">>;
def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group<f_Group>;
defm eliminate_unused_debug_types : OptOutCC1FFlag<"eliminate-unused-debug-types",
"Do not emit ", "Emit ", " debug info for defined but unused types">;
-def femit_all_decls : Flag<["-"], "femit-all-decls">, Group<f_Group>, Flags<[CC1Option]>,
+def femit_all_decls : Flag<["-"], "femit-all-decls">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Emit all declarations, even if unused">,
MarshallingInfoFlag<LangOpts<"EmitAllDecls">>;
defm emulated_tls : BoolFOption<"emulated-tls",
CodeGenOpts<"EmulatedTLS">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use emutls functions to access thread_local variables">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use emutls functions to access thread_local variables">,
NegFlag<SetFalse>>;
def fencoding_EQ : Joined<["-"], "fencoding=">, Group<f_Group>;
-def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<f_Group>, Flags<[CoreOption]>;
+def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
defm exceptions : BoolFOption<"exceptions",
LangOpts<"Exceptions">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption], " support for exception handling">>;
def fdwarf_exceptions : Flag<["-"], "fdwarf-exceptions">, Group<f_Group>,
@@ -1755,18 +1927,19 @@ def fseh_exceptions : Flag<["-"], "fseh-exceptions">, Group<f_Group>,
def fwasm_exceptions : Flag<["-"], "fwasm-exceptions">, Group<f_Group>,
HelpText<"Use WebAssembly style exceptions">;
def exception_model : Separate<["-"], "exception-model">,
- Flags<[CC1Option, NoDriverOption]>, HelpText<"The exception model">,
+ Visibility<[CC1Option]>, HelpText<"The exception model">,
Values<"dwarf,sjlj,seh,wasm">,
NormalizedValuesScope<"LangOptions::ExceptionHandlingKind">,
NormalizedValues<["DwarfCFI", "SjLj", "WinEH", "Wasm"]>,
MarshallingInfoEnum<LangOpts<"ExceptionHandling">, "None">;
def exception_model_EQ : Joined<["-"], "exception-model=">,
- Flags<[CC1Option, NoDriverOption]>, Alias<exception_model>;
-def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group<f_Group>, Flags<[CC1Option]>,
+ Visibility<[CC1Option]>, Alias<exception_model>;
+def fignore_exceptions : Flag<["-"], "fignore-exceptions">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable support for ignoring exception handling constructs">,
MarshallingInfoFlag<LangOpts<"IgnoreExceptions">>;
def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
- Flags<[CoreOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Allows control over excess precision on targets where native "
"support for the precision types is not available. By default, excess "
"precision is used to calculate intermediate results following the "
@@ -1774,7 +1947,7 @@ def fexcess_precision_EQ : Joined<["-"], "fexcess-precision=">, Group<f_Group>,
Values<"standard,fast,none">, NormalizedValuesScope<"LangOptions">,
NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>;
def ffloat16_excess_precision_EQ : Joined<["-"], "ffloat16-excess-precision=">,
- Group<f_Group>, Flags<[CC1Option, NoDriverOption]>,
+ Group<f_Group>, Visibility<[CC1Option]>,
HelpText<"Allows control over excess precision on targets where native "
"support for Float16 precision types is not available. By default, excess "
"precision is used to calculate intermediate results following the "
@@ -1783,7 +1956,7 @@ def ffloat16_excess_precision_EQ : Joined<["-"], "ffloat16-excess-precision=">,
NormalizedValues<["FPP_Standard", "FPP_Fast", "FPP_None"]>,
MarshallingInfoEnum<LangOpts<"Float16ExcessPrecision">, "FPP_Standard">;
def fbfloat16_excess_precision_EQ : Joined<["-"], "fbfloat16-excess-precision=">,
- Group<f_Group>, Flags<[CC1Option, NoDriverOption]>,
+ Group<f_Group>, Visibility<[CC1Option]>,
HelpText<"Allows control over excess precision on targets where native "
"support for BFloat16 precision types is not available. By default, excess "
"precision is used to calculate intermediate results following the "
@@ -1797,101 +1970,115 @@ def fextdirs_EQ : Joined<["-"], "fextdirs=">, Group<f_Group>;
def : Flag<["-"], "fdefer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
def : Flag<["-"], "fno-defer-pop">, Group<clang_ignored_gcc_optimization_f_Group>;
def : Flag<["-"], "fextended-identifiers">, Group<clang_ignored_f_Group>;
-def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>, Flags<[Unsupported]>;
+def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>,
+ Flags<[Unsupported]>;
def fhosted : Flag<["-"], "fhosted">, Group<f_Group>;
-def fdenormal_fp_math_EQ : Joined<["-"], "fdenormal-fp-math=">, Group<f_Group>, Flags<[CC1Option]>;
+def fdenormal_fp_math_EQ : Joined<["-"], "fdenormal-fp-math=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>;
def ffile_reproducible : Flag<["-"], "ffile-reproducible">, Group<f_Group>,
- Flags<[CoreOption, CC1Option]>,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
HelpText<"Use the target's platform-specific path separator character when "
"expanding the __FILE__ macro">;
def fno_file_reproducible : Flag<["-"], "fno-file-reproducible">,
- Group<f_Group>, Flags<[CoreOption, CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
HelpText<"Use the host's platform-specific path separator character when "
"expanding the __FILE__ macro">;
-def ffp_eval_method_EQ : Joined<["-"], "ffp-eval-method=">, Group<f_Group>, Flags<[CC1Option]>,
+def ffp_eval_method_EQ : Joined<["-"], "ffp-eval-method=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specifies the evaluation method to use for floating-point arithmetic.">,
Values<"source,double,extended">, NormalizedValuesScope<"LangOptions">,
NormalizedValues<["FEM_Source", "FEM_Double", "FEM_Extended"]>,
MarshallingInfoEnum<LangOpts<"FPEvalMethod">, "FEM_UnsetOnCommandLine">;
-def ffp_model_EQ : Joined<["-"], "ffp-model=">, Group<f_Group>, Flags<[NoXarchOption]>,
+def ffp_model_EQ : Joined<["-"], "ffp-model=">, Group<f_Group>,
+ Flags<[NoXarchOption]>,
HelpText<"Controls the semantics of floating-point calculations.">;
-def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<f_Group>, Flags<[CC1Option]>,
+def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specifies the exception behavior of floating-point operations.">,
Values<"ignore,maytrap,strict">, NormalizedValuesScope<"LangOptions">,
NormalizedValues<["FPE_Ignore", "FPE_MayTrap", "FPE_Strict"]>,
MarshallingInfoEnum<LangOpts<"FPExceptionMode">, "FPE_Default">;
defm fast_math : BoolFOption<"fast-math",
LangOpts<"FastMath">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option, FC1Option, FlangOption], [ClangOption], "Allow aggressive, lossy floating-point optimizations",
+ PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
+ "Allow aggressive, lossy floating-point optimizations",
[cl_fast_relaxed_math.KeyPath]>,
NegFlag<SetFalse>>;
defm math_errno : BoolFOption<"math-errno",
LangOpts<"MathErrno">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Require math functions to indicate errors by setting errno">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Require math functions to indicate errors by setting errno">,
NegFlag<SetFalse>>,
ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
def fextend_args_EQ : Joined<["-"], "fextend-arguments=">, Group<f_Group>,
- Flags<[CC1Option, NoArgumentUnused]>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Controls how scalar integer arguments are extended in calls "
"to unprototyped and varargs functions">,
Values<"32,64">,
NormalizedValues<["ExtendTo32", "ExtendTo64"]>,
NormalizedValuesScope<"LangOptions::ExtendArgsKind">,
MarshallingInfoEnum<LangOpts<"ExtendIntArgs">,"ExtendTo32">;
-def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group<f_Group>, Flags<[CoreOption]>;
+def fbracket_depth_EQ : Joined<["-"], "fbracket-depth=">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fsignaling_math : Flag<["-"], "fsignaling-math">, Group<f_Group>;
def fno_signaling_math : Flag<["-"], "fno-signaling-math">, Group<f_Group>;
defm jump_tables : BoolFOption<"jump-tables",
CodeGenOpts<"NoUseJumpTables">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption], "Do not use">,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option], "Do not use">,
PosFlag<SetFalse, [], [ClangOption], "Use">,
BothFlags<[], [ClangOption], " jump tables for lowering switches">>;
defm force_enable_int128 : BoolFOption<"force-enable-int128",
TargetOpts<"ForceEnableInt128">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption], " support for int128_t type">>;
defm keep_static_consts : BoolFOption<"keep-static-consts",
CodeGenOpts<"KeepStaticConsts">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Keep">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Keep">,
NegFlag<SetFalse, [], [ClangOption], "Don't keep">,
- BothFlags<[NoXarchOption], [ClangOption], " static const variables even if unused">>;
+ BothFlags<[NoXarchOption], [], " static const variables even if unused">>;
defm keep_persistent_storage_variables : BoolFOption<"keep-persistent-storage-variables",
CodeGenOpts<"KeepPersistentStorageVariables">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
- BothFlags<[NoXarchOption], [ClangOption], " keeping all variables that have a persistent storage duration, including global, static and thread-local variables, to guarantee that they can be directly addressed">>;
+ BothFlags<[NoXarchOption], [],
+ " keeping all variables that have a persistent storage duration, including global, static and thread-local variables, to guarantee that they can be directly addressed">>;
defm fixed_point : BoolFOption<"fixed-point",
LangOpts<"FixedPoint">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption], " fixed point types">>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
defm cxx_static_destructors : BoolFOption<"c++-static-destructors",
LangOpts<"RegisterStaticDestructors">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable C++ static destructor registration">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Disable C++ static destructor registration">,
PosFlag<SetTrue>>;
def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group<f_Group>,
- Flags<[CC1Option]>, MarshallingInfoString<CodeGenOpts<"SymbolPartition">>;
+ Visibility<[ClangOption, CC1Option]>,
+ MarshallingInfoString<CodeGenOpts<"SymbolPartition">>;
defm memory_profile : OptInCC1FFlag<"memory-profile", "Enable", "Disable", " heap memory profiling">;
def fmemory_profile_EQ : Joined<["-"], "fmemory-profile=">,
- Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<directory>">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<directory>">,
HelpText<"Enable heap memory profiling and dump results into <directory>">;
def fmemory_profile_use_EQ : Joined<["-"], "fmemory-profile-use=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>, MetaVarName<"<pathname>">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ MetaVarName<"<pathname>">,
HelpText<"Use memory profile for profile-guided memory optimization">,
MarshallingInfoString<CodeGenOpts<"MemoryProfileUsePath">>;
// Begin sanitizer flags. These should all be core options exposed in all driver
// modes.
-let Flags = [CC1Option, CoreOption] in {
+let Visibility = [ClangOption, CC1Option, CLOption, DXCOption] in {
def fsanitize_EQ : CommaJoined<["-"], "fsanitize=">, Group<f_clang_Group>,
MetaVarName<"<check>">,
HelpText<"Turn on runtime checks for various forms of undefined "
"or suspicious behavior. See user manual for available checks">;
def fno_sanitize_EQ : CommaJoined<["-"], "fno-sanitize=">, Group<f_clang_Group>,
- Flags<[CoreOption, NoXarchOption]>;
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fsanitize_ignorelist_EQ : Joined<["-"], "fsanitize-ignorelist=">,
Group<f_clang_Group>, HelpText<"Path to ignorelist file for sanitizers">;
@@ -1900,7 +2087,8 @@ def : Joined<["-"], "fsanitize-blacklist=">,
HelpText<"Alias for -fsanitize-ignorelist=">;
def fsanitize_system_ignorelist_EQ : Joined<["-"], "fsanitize-system-ignorelist=">,
- HelpText<"Path to system ignorelist file for sanitizers">, Flags<[CC1Option]>;
+ HelpText<"Path to system ignorelist file for sanitizers">,
+ Visibility<[ClangOption, CC1Option]>;
def fno_sanitize_ignorelist : Flag<["-"], "fno-sanitize-ignorelist">,
Group<f_clang_Group>, HelpText<"Don't use ignorelist file for sanitizers">;
@@ -1911,17 +2099,20 @@ def fsanitize_coverage : CommaJoined<["-"], "fsanitize-coverage=">,
Group<f_clang_Group>,
HelpText<"Specify the type of coverage instrumentation for Sanitizers">;
def fno_sanitize_coverage : CommaJoined<["-"], "fno-sanitize-coverage=">,
- Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
+ Group<f_clang_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable features of coverage instrumentation for Sanitizers">,
Values<"func,bb,edge,indirect-calls,trace-bb,trace-cmp,trace-div,trace-gep,"
"8bit-counters,trace-pc,trace-pc-guard,no-prune,inline-8bit-counters,"
"inline-bool-flag">;
def fsanitize_coverage_allowlist : Joined<["-"], "fsanitize-coverage-allowlist=">,
- Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
+ Group<f_clang_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Restrict sanitizer coverage instrumentation exclusively to modules and functions that match the provided special case list, except the blocked ones">,
MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageAllowlistFiles">>;
def fsanitize_coverage_ignorelist : Joined<["-"], "fsanitize-coverage-ignorelist=">,
- Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
+ Group<f_clang_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable sanitizer coverage instrumentation for modules and functions "
"that match the provided special case list, even the allowed ones">,
MarshallingInfoStringVector<CodeGenOpts<"SanitizeCoverageIgnorelistFiles">>;
@@ -1929,10 +2120,10 @@ def fexperimental_sanitize_metadata_EQ : CommaJoined<["-"], "fexperimental-sanit
Group<f_Group>,
HelpText<"Specify the type of metadata to emit for binary analysis sanitizers">;
def fno_experimental_sanitize_metadata_EQ : CommaJoined<["-"], "fno-experimental-sanitize-metadata=">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable emitting metadata for binary analysis sanitizers">;
def fexperimental_sanitize_metadata_ignorelist_EQ : Joined<["-"], "fexperimental-sanitize-metadata-ignorelist=">,
- Group<f_Group>, Flags<[CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable sanitizer metadata for modules and functions that match the provided special case list">,
MarshallingInfoStringVector<CodeGenOpts<"SanitizeMetadataIgnorelistFiles">>;
def fsanitize_memory_track_origins_EQ : Joined<["-"], "fsanitize-memory-track-origins=">,
@@ -1945,7 +2136,8 @@ def fsanitize_memory_track_origins : Flag<["-"], "fsanitize-memory-track-origins
HelpText<"Enable origins tracking in MemorySanitizer">;
def fno_sanitize_memory_track_origins : Flag<["-"], "fno-sanitize-memory-track-origins">,
Group<f_clang_Group>,
- Flags<[CoreOption, NoXarchOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable origins tracking in MemorySanitizer">;
def fsanitize_address_outline_instrumentation : Flag<["-"], "fsanitize-address-outline-instrumentation">,
Group<f_clang_Group>,
@@ -1966,11 +2158,12 @@ def fsanitize_hwaddress_experimental_aliasing
HelpText<"Enable aliasing mode in HWAddressSanitizer">;
def fno_sanitize_hwaddress_experimental_aliasing
: Flag<["-"], "fno-sanitize-hwaddress-experimental-aliasing">,
- Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
+ Group<f_clang_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable aliasing mode in HWAddressSanitizer">;
defm sanitize_memory_use_after_dtor : BoolOption<"f", "sanitize-memory-use-after-dtor",
CodeGenOpts<"SanitizeMemoryUseAfterDtor">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption], " use-after-destroy detection in MemorySanitizer">>,
Group<f_clang_Group>;
@@ -1981,13 +2174,14 @@ def fsanitize_address_field_padding : Joined<["-"], "fsanitize-address-field-pad
defm sanitize_address_use_after_scope : BoolOption<"f", "sanitize-address-use-after-scope",
CodeGenOpts<"SanitizeAddressUseAfterScope">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
- NegFlag<SetFalse, [CoreOption, NoXarchOption], [ClangOption], "Disable">,
+ NegFlag<SetFalse, [NoXarchOption], [ClangOption, CLOption, DXCOption],
+ "Disable">,
BothFlags<[], [ClangOption], " use-after-scope detection in AddressSanitizer">>,
Group<f_clang_Group>;
def sanitize_address_use_after_return_EQ
: Joined<["-"], "fsanitize-address-use-after-return=">,
MetaVarName<"<mode>">,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Select the mode of detecting stack use-after-return in AddressSanitizer">,
Group<f_clang_Group>,
Values<"never,runtime,always">,
@@ -2024,7 +2218,7 @@ defm sanitize_address_use_odr_indicator : BoolOption<"f", "sanitize-address-use-
Group<f_clang_Group>;
def sanitize_address_destructor_EQ
: Joined<["-"], "fsanitize-address-destructor=">,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the kind of module destructors emitted by "
"AddressSanitizer instrumentation. These destructors are "
"emitted to unregister instrumented global variables when "
@@ -2038,7 +2232,7 @@ defm sanitize_memory_param_retval
: BoolFOption<"sanitize-memory-param-retval",
CodeGenOpts<"SanitizeMemoryParamRetval">,
DefaultTrue,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption], " detection of uninitialized parameters and return values">>;
//// Note: This flag was introduced when it was necessary to distinguish between
@@ -2055,24 +2249,29 @@ def fsanitize_recover_EQ : CommaJoined<["-"], "fsanitize-recover=">,
Group<f_clang_Group>,
HelpText<"Enable recovery for specified sanitizers">;
def fno_sanitize_recover_EQ : CommaJoined<["-"], "fno-sanitize-recover=">,
- Group<f_clang_Group>, Flags<[CoreOption, NoXarchOption]>,
+ Group<f_clang_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable recovery for specified sanitizers">;
def fsanitize_recover : Flag<["-"], "fsanitize-recover">, Group<f_clang_Group>,
Alias<fsanitize_recover_EQ>, AliasArgs<["all"]>;
def fno_sanitize_recover : Flag<["-"], "fno-sanitize-recover">,
- Flags<[CoreOption, NoXarchOption]>, Group<f_clang_Group>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
+ Group<f_clang_Group>,
Alias<fno_sanitize_recover_EQ>, AliasArgs<["all"]>;
def fsanitize_trap_EQ : CommaJoined<["-"], "fsanitize-trap=">, Group<f_clang_Group>,
HelpText<"Enable trapping for specified sanitizers">;
def fno_sanitize_trap_EQ : CommaJoined<["-"], "fno-sanitize-trap=">, Group<f_clang_Group>,
- Flags<[CoreOption, NoXarchOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable trapping for specified sanitizers">;
def fsanitize_trap : Flag<["-"], "fsanitize-trap">, Group<f_clang_Group>,
Alias<fsanitize_trap_EQ>, AliasArgs<["all"]>,
HelpText<"Enable trapping for all sanitizers">;
def fno_sanitize_trap : Flag<["-"], "fno-sanitize-trap">, Group<f_clang_Group>,
Alias<fno_sanitize_trap_EQ>, AliasArgs<["all"]>,
- Flags<[CoreOption, NoXarchOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable trapping for all sanitizers">;
def fsanitize_undefined_trap_on_error
: Flag<["-"], "fsanitize-undefined-trap-on-error">, Group<f_clang_Group>,
@@ -2096,7 +2295,8 @@ def fno_sanitize_link_cxx_runtime : Flag<["-"], "fno-sanitize-link-c++-runtime">
defm sanitize_cfi_cross_dso : BoolOption<"f", "sanitize-cfi-cross-dso",
CodeGenOpts<"SanitizeCfiCrossDso">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
- NegFlag<SetFalse, [CoreOption, NoXarchOption], [ClangOption], "Disable">,
+ NegFlag<SetFalse, [NoXarchOption], [ClangOption, CLOption, DXCOption],
+ "Disable">,
BothFlags<[], [ClangOption], " control flow integrity (CFI) checks for cross-DSO calls.">>,
Group<f_clang_Group>;
def fsanitize_cfi_icall_generalize_pointers : Flag<["-"], "fsanitize-cfi-icall-generalize-pointers">,
@@ -2110,13 +2310,15 @@ def fsanitize_cfi_icall_normalize_integers : Flag<["-"], "fsanitize-cfi-icall-ex
defm sanitize_cfi_canonical_jump_tables : BoolOption<"f", "sanitize-cfi-canonical-jump-tables",
CodeGenOpts<"SanitizeCfiCanonicalJumpTables">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Make">,
- NegFlag<SetFalse, [CoreOption, NoXarchOption], [ClangOption], "Do not make">,
+ NegFlag<SetFalse, [NoXarchOption], [ClangOption, CLOption, DXCOption],
+ "Do not make">,
BothFlags<[], [ClangOption], " the jump table addresses canonical in the symbol table">>,
Group<f_clang_Group>;
defm sanitize_stats : BoolOption<"f", "sanitize-stats",
CodeGenOpts<"SanitizeStats">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
- NegFlag<SetFalse, [CoreOption, NoXarchOption], [ClangOption], "Disable">,
+ NegFlag<SetFalse, [NoXarchOption], [ClangOption, CLOption, DXCOption],
+ "Disable">,
BothFlags<[], [ClangOption], " sanitizer statistics gathering.">>,
Group<f_clang_Group>;
def fsanitize_thread_memory_access : Flag<["-"], "fsanitize-thread-memory-access">,
@@ -2124,21 +2326,24 @@ def fsanitize_thread_memory_access : Flag<["-"], "fsanitize-thread-memory-access
HelpText<"Enable memory access instrumentation in ThreadSanitizer (default)">;
def fno_sanitize_thread_memory_access : Flag<["-"], "fno-sanitize-thread-memory-access">,
Group<f_clang_Group>,
- Flags<[CoreOption, NoXarchOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable memory access instrumentation in ThreadSanitizer">;
def fsanitize_thread_func_entry_exit : Flag<["-"], "fsanitize-thread-func-entry-exit">,
Group<f_clang_Group>,
HelpText<"Enable function entry/exit instrumentation in ThreadSanitizer (default)">;
def fno_sanitize_thread_func_entry_exit : Flag<["-"], "fno-sanitize-thread-func-entry-exit">,
Group<f_clang_Group>,
- Flags<[CoreOption, NoXarchOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable function entry/exit instrumentation in ThreadSanitizer">;
def fsanitize_thread_atomics : Flag<["-"], "fsanitize-thread-atomics">,
Group<f_clang_Group>,
HelpText<"Enable atomic operations instrumentation in ThreadSanitizer (default)">;
def fno_sanitize_thread_atomics : Flag<["-"], "fno-sanitize-thread-atomics">,
Group<f_clang_Group>,
- Flags<[CoreOption, NoXarchOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable atomic operations instrumentation in ThreadSanitizer">;
def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-undefined-strip-path-components=">,
Group<f_clang_Group>, MetaVarName<"<number>">,
@@ -2149,7 +2354,7 @@ def fsanitize_undefined_strip_path_components_EQ : Joined<["-"], "fsanitize-unde
} // end -f[no-]sanitize* flags
def funsafe_math_optimizations : Flag<["-"], "funsafe-math-optimizations">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Allow unsafe floating-point math optimizations which may decrease precision">,
MarshallingInfoFlag<LangOpts<"UnsafeFPMath">>,
ImpliedByAnyOf<[cl_unsafe_math_optimizations.KeyPath, ffast_math.KeyPath]>;
@@ -2159,24 +2364,28 @@ def fassociative_math : Flag<["-"], "fassociative-math">, Group<f_Group>;
def fno_associative_math : Flag<["-"], "fno-associative-math">, Group<f_Group>;
defm reciprocal_math : BoolFOption<"reciprocal-math",
LangOpts<"AllowRecip">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option, FC1Option, FlangOption], [ClangOption], "Allow division operations to be reassociated",
+ PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
+ "Allow division operations to be reassociated",
[funsafe_math_optimizations.KeyPath]>,
NegFlag<SetFalse>>;
defm approx_func : BoolFOption<"approx-func", LangOpts<"ApproxFunc">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option, FC1Option, FlangOption], [ClangOption], "Allow certain math function calls to be replaced "
+ PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
+ "Allow certain math function calls to be replaced "
"with an approximately equivalent calculation",
[funsafe_math_optimizations.KeyPath]>,
NegFlag<SetFalse>>;
defm finite_math_only : BoolFOption<"finite-math-only",
LangOpts<"FiniteMathOnly">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Allow floating-point optimizations that "
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Allow floating-point optimizations that "
"assume arguments and results are not NaNs or +-inf. This defines "
"the \\_\\_FINITE\\_MATH\\_ONLY\\_\\_ preprocessor macro.",
[cl_finite_math_only.KeyPath, ffast_math.KeyPath]>,
NegFlag<SetFalse>>;
defm signed_zeros : BoolFOption<"signed-zeros",
LangOpts<"NoSignedZero">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option, FC1Option, FlangOption], [ClangOption], "Allow optimizations that ignore the sign of floating point zeros",
+ NegFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
+ "Allow optimizations that ignore the sign of floating point zeros",
[cl_no_signed_zeros.KeyPath, funsafe_math_optimizations.KeyPath]>,
PosFlag<SetFalse>>;
def fhonor_nans : Flag<["-"], "fhonor-nans">, Group<f_Group>,
@@ -2191,14 +2400,16 @@ def fno_honor_infinities : Flag<["-"], "fno-honor-infinities">, Group<f_Group>;
// This option was originally misspelt "infinites" [sic].
def : Flag<["-"], "fhonor-infinites">, Alias<fhonor_infinities>;
def : Flag<["-"], "fno-honor-infinites">, Alias<fno_honor_infinities>;
-def frounding_math : Flag<["-"], "frounding-math">, Group<f_Group>, Flags<[CC1Option]>,
+def frounding_math : Flag<["-"], "frounding-math">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"RoundingMath">>,
Normalizer<"makeFlagToValueNormalizer(llvm::RoundingMode::Dynamic)">;
-def fno_rounding_math : Flag<["-"], "fno-rounding-math">, Group<f_Group>, Flags<[CC1Option]>;
+def fno_rounding_math : Flag<["-"], "fno-rounding-math">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>;
def ftrapping_math : Flag<["-"], "ftrapping-math">, Group<f_Group>;
def fno_trapping_math : Flag<["-"], "fno-trapping-math">, Group<f_Group>;
def ffp_contract : Joined<["-"], "ffp-contract=">, Group<f_Group>,
- Flags<[CC1Option, FC1Option, FlangOption]>,
+ Visibility<[ClangOption, CC1Option, FC1Option, FlangOption]>,
DocBrief<"Form fused FP ops (e.g. FMAs):"
" fast (fuses across statements disregarding pragmas)"
" | on (only fuses in the same statement unless dictated by pragmas)"
@@ -2210,13 +2421,14 @@ def ffp_contract : Joined<["-"], "ffp-contract=">, Group<f_Group>,
defm strict_float_cast_overflow : BoolFOption<"strict-float-cast-overflow",
CodeGenOpts<"StrictFloatCastOverflow">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Relax language rules and try to match the behavior"
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Relax language rules and try to match the behavior"
" of the target's native float-to-int conversion instructions">,
PosFlag<SetTrue, [], [ClangOption], "Assume that overflowing float-to-int casts are undefined (default)">>;
defm protect_parens : BoolFOption<"protect-parens",
LangOpts<"ProtectParens">, DefaultFalse,
- PosFlag<SetTrue, [CoreOption, CC1Option], [ClangOption],
+ PosFlag<SetTrue, [], [ClangOption, CLOption, DXCOption, CC1Option],
"Determines whether the optimizer honors parentheses when "
"floating-point expressions are evaluated">,
NegFlag<SetFalse>>;
@@ -2226,20 +2438,21 @@ def fno_for_scope : Flag<["-"], "fno-for-scope">, Group<f_Group>;
defm rewrite_imports : BoolFOption<"rewrite-imports",
PreprocessorOutputOpts<"RewriteImports">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption]>,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
NegFlag<SetFalse>>;
defm rewrite_includes : BoolFOption<"rewrite-includes",
PreprocessorOutputOpts<"RewriteIncludes">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption]>,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
NegFlag<SetFalse>>;
defm directives_only : OptInCC1FFlag<"directives-only", "">;
defm delete_null_pointer_checks : BoolFOption<"delete-null-pointer-checks",
CodeGenOpts<"NullPointerIsValid">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption], "Do not treat usage of null pointers as undefined behavior">,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Do not treat usage of null pointers as undefined behavior">,
PosFlag<SetFalse, [], [ClangOption], "Treat usage of null pointers as undefined behavior (default)">,
- BothFlags<[CoreOption]>>,
+ BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
DocBrief<[{When enabled, treat null pointer dereference, creation of a reference to null,
or passing a null pointer to a function parameter annotated with the "nonnull"
attribute as undefined behavior. (And, thus the optimizer may assume that any
@@ -2248,11 +2461,13 @@ branches accordingly.) On by default.}]>;
defm use_line_directives : BoolFOption<"use-line-directives",
PreprocessorOutputOpts<"UseLineDirectives">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use #line in preprocessed output">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use #line in preprocessed output">,
NegFlag<SetFalse>>;
defm minimize_whitespace : BoolFOption<"minimize-whitespace",
PreprocessorOutputOpts<"MinimizeWhitespace">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Ignore the whitespace from the input file "
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Ignore the whitespace from the input file "
"when emitting preprocessor output. It will only contain whitespace "
"when necessary, e.g. to keep two minus signs from merging into to "
"an increment operator. Useful with the -P option to normalize "
@@ -2260,12 +2475,13 @@ defm minimize_whitespace : BoolFOption<"minimize-whitespace",
"equal.\n\nOnly valid with -E on C-like inputs and incompatible "
"with -traditional-cpp.">, NegFlag<SetFalse>>;
-def ffreestanding : Flag<["-"], "ffreestanding">, Group<f_Group>, Flags<[CC1Option]>,
+def ffreestanding : Flag<["-"], "ffreestanding">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Assert that the compilation takes place in a freestanding environment">,
MarshallingInfoFlag<LangOpts<"Freestanding">>;
def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group<f_Group>,
HelpText<"Sets various macros to claim compatibility with the given GCC version (default is 4.2.1)">,
- Flags<[CC1Option, CoreOption]>;
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>;
// We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension
// keywords. This behavior is provided by GCC's poorly named '-fasm' flag,
// while a subset (the non-C++ GNU keywords) is provided by GCC's
@@ -2274,122 +2490,138 @@ def fgnuc_version_EQ : Joined<["-"], "fgnuc-version=">, Group<f_Group>,
defm gnu_keywords : BoolFOption<"gnu-keywords",
LangOpts<"GNUKeywords">, Default<gnu_mode.KeyPath>,
PosFlag<SetTrue, [], [ClangOption], "Allow GNU-extension keywords regardless of language standard">,
- NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
defm gnu89_inline : BoolFOption<"gnu89-inline",
LangOpts<"GNUInline">, Default<!strconcat("!", c99.KeyPath, " && !", cplusplus.KeyPath)>,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use the gnu89 inline semantics">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use the gnu89 inline semantics">,
NegFlag<SetFalse>>, ShouldParseIf<!strconcat("!", cplusplus.KeyPath)>;
def fgnu_runtime : Flag<["-"], "fgnu-runtime">, Group<f_Group>,
HelpText<"Generate output compatible with the standard GNU Objective-C runtime">;
-def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">, Flags<[CC1Option]>,
+def fheinous_gnu_extensions : Flag<["-"], "fheinous-gnu-extensions">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"HeinousExtensions">>;
def filelist : Separate<["-"], "filelist">, Flags<[LinkerInput]>,
Group<Link_Group>;
def : Flag<["-"], "findirect-virtual-calls">, Alias<fapple_kext>;
-def finline_functions : Flag<["-"], "finline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def finline_functions : Flag<["-"], "finline-functions">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Inline suitable functions">;
-def finline_hint_functions: Flag<["-"], "finline-hint-functions">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def finline_hint_functions: Flag<["-"], "finline-hint-functions">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Inline functions which are (explicitly or implicitly) marked inline">;
def finline : Flag<["-"], "finline">, Group<clang_ignored_f_Group>;
def finline_max_stacksize_EQ
: Joined<["-"], "finline-max-stacksize=">,
- Group<f_Group>, Flags<[CoreOption, CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
HelpText<"Suppress inlining of functions whose stack size exceeds the given value">,
MarshallingInfoInt<CodeGenOpts<"InlineMaxStackSize">, "UINT_MAX">;
defm jmc : BoolFOption<"jmc",
CodeGenOpts<"JMCInstrument">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable just-my-code debugging">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable just-my-code debugging">,
NegFlag<SetFalse>>;
def fglobal_isel : Flag<["-"], "fglobal-isel">, Group<f_clang_Group>,
HelpText<"Enables the global instruction selector">;
def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group<f_clang_Group>,
Alias<fglobal_isel>;
def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">,
- Group<f_clang_Group>, Flags<[CC1Option]>,
+ Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Enables the use of non-default rounding modes and non-default exception handling on targets that are not currently ready.">,
MarshallingInfoFlag<LangOpts<"ExpStrictFP">>;
-def finput_charset_EQ : Joined<["-"], "finput-charset=">, Flags<[FlangOption, FC1Option]>, Group<f_Group>,
+def finput_charset_EQ : Joined<["-"], "finput-charset=">,
+ Visibility<[ClangOption, FlangOption, FC1Option]>, Group<f_Group>,
HelpText<"Specify the default character set for source files">;
def fexec_charset_EQ : Joined<["-"], "fexec-charset=">, Group<f_Group>;
-def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>, Flags<[CC1Option]>,
+def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Generate calls to instrument function entry and exit">,
MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctions">>;
-def finstrument_functions_after_inlining : Flag<["-"], "finstrument-functions-after-inlining">, Group<f_Group>, Flags<[CC1Option]>,
+def finstrument_functions_after_inlining : Flag<["-"], "finstrument-functions-after-inlining">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Like -finstrument-functions, but insert the calls after inlining">,
MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionsAfterInlining">>;
-def finstrument_function_entry_bare : Flag<["-"], "finstrument-function-entry-bare">, Group<f_Group>, Flags<[CC1Option]>,
+def finstrument_function_entry_bare : Flag<["-"], "finstrument-function-entry-bare">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Instrument function entry only, after inlining, without arguments to the instrumentation call">,
MarshallingInfoFlag<CodeGenOpts<"InstrumentFunctionEntryBare">>;
-def fcf_protection_EQ : Joined<["-"], "fcf-protection=">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
+def fcf_protection_EQ : Joined<["-"], "fcf-protection=">,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>, Group<f_Group>,
HelpText<"Instrument control-flow architecture protection">, Values<"return,branch,full,none">;
-def fcf_protection : Flag<["-"], "fcf-protection">, Group<f_Group>, Flags<[CoreOption, CC1Option]>,
+def fcf_protection : Flag<["-"], "fcf-protection">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
Alias<fcf_protection_EQ>, AliasArgs<["full"]>,
HelpText<"Enable cf-protection in 'full' mode">;
def mfunction_return_EQ : Joined<["-"], "mfunction-return=">,
- Group<m_Group>, Flags<[CoreOption, CC1Option]>,
+ Group<m_Group>, Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
HelpText<"Replace returns with jumps to ``__x86_return_thunk`` (x86 only, error otherwise)">,
Values<"keep,thunk-extern">,
NormalizedValues<["Keep", "Extern"]>,
NormalizedValuesScope<"llvm::FunctionReturnThunksKind">,
MarshallingInfoEnum<CodeGenOpts<"FunctionReturnThunks">, "Keep">;
def mindirect_branch_cs_prefix : Flag<["-"], "mindirect-branch-cs-prefix">,
- Group<m_Group>, Flags<[CoreOption, CC1Option]>,
+ Group<m_Group>, Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>,
HelpText<"Add cs prefix to call and jmp to indirect thunk">,
MarshallingInfoFlag<CodeGenOpts<"IndirectBranchCSPrefix">>;
defm xray_instrument : BoolFOption<"xray-instrument",
LangOpts<"XRayInstrument">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Generate XRay instrumentation sleds on function entry and exit">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Generate XRay instrumentation sleds on function entry and exit">,
NegFlag<SetFalse>>;
def fxray_instruction_threshold_EQ :
Joined<["-"], "fxray-instruction-threshold=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Sets the minimum function size to instrument with XRay">,
MarshallingInfoInt<CodeGenOpts<"XRayInstructionThreshold">, "200">;
def fxray_always_instrument :
Joined<["-"], "fxray-always-instrument=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'always instrument' XRay attribute.">,
MarshallingInfoStringVector<LangOpts<"XRayAlwaysInstrumentFiles">>;
def fxray_never_instrument :
Joined<["-"], "fxray-never-instrument=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"DEPRECATED: Filename defining the whitelist for imbuing the 'never instrument' XRay attribute.">,
MarshallingInfoStringVector<LangOpts<"XRayNeverInstrumentFiles">>;
def fxray_attr_list :
Joined<["-"], "fxray-attr-list=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Filename defining the list of functions/types for imbuing XRay attributes.">,
MarshallingInfoStringVector<LangOpts<"XRayAttrListFiles">>;
def fxray_modes :
Joined<["-"], "fxray-modes=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"List of modes to link in by default into XRay instrumented binaries.">;
defm xray_always_emit_customevents : BoolFOption<"xray-always-emit-customevents",
LangOpts<"XRayAlwaysEmitCustomEvents">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Always emit __xray_customevent(...) calls"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Always emit __xray_customevent(...) calls"
" even if the containing function is not always instrumented">,
NegFlag<SetFalse>>;
defm xray_always_emit_typedevents : BoolFOption<"xray-always-emit-typedevents",
LangOpts<"XRayAlwaysEmitTypedEvents">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Always emit __xray_typedevent(...) calls"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Always emit __xray_typedevent(...) calls"
" even if the containing function is not always instrumented">,
NegFlag<SetFalse>>;
defm xray_ignore_loops : BoolFOption<"xray-ignore-loops",
CodeGenOpts<"XRayIgnoreLoops">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Don't instrument functions with loops"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Don't instrument functions with loops"
" unless they also meet the minimum function size">,
NegFlag<SetFalse>>;
defm xray_function_index : BoolFOption<"xray-function-index",
CodeGenOpts<"XRayFunctionIndex">, DefaultTrue,
PosFlag<SetTrue, [], [ClangOption]>,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Omit function index section at the"
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Omit function index section at the"
" expense of single-function patching performance">>;
def fxray_link_deps : Flag<["-"], "fxray-link-deps">, Group<f_Group>,
@@ -2398,18 +2630,18 @@ def fno_xray_link_deps : Flag<["-"], "fno-xray-link-deps">, Group<f_Group>;
def fxray_instrumentation_bundle :
Joined<["-"], "fxray-instrumentation-bundle=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
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'.">;
def fxray_function_groups :
Joined<["-"], "fxray-function-groups=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Only instrument 1 of N groups">,
MarshallingInfoInt<CodeGenOpts<"XRayTotalFunctionGroups">, "1">;
def fxray_selected_function_group :
Joined<["-"], "fxray-selected-function-group=">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"When using -fxray-function-groups, select which group of functions to instrument. Valid range is 0 to fxray-function-groups - 1">,
MarshallingInfoInt<CodeGenOpts<"XRaySelectedFunctionGroup">, "0">;
@@ -2418,25 +2650,26 @@ defm fine_grained_bitfield_accesses : BoolOption<"f", "fine-grained-bitfield-acc
CodeGenOpts<"FineGrainedBitfieldAccesses">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Use separate accesses for consecutive bitfield runs with legal widths and alignments.">,
NegFlag<SetFalse, [], [ClangOption], "Use large-integer access for consecutive bitfield runs.">,
- BothFlags<[CC1Option]>>,
+ BothFlags<[], [ClangOption, CC1Option]>>,
Group<f_clang_Group>;
def fexperimental_relative_cxx_abi_vtables :
Flag<["-"], "fexperimental-relative-c++-abi-vtables">,
- Group<f_clang_Group>, Flags<[CC1Option]>,
+ Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Use the experimental C++ class ABI for classes with virtual tables">;
def fno_experimental_relative_cxx_abi_vtables :
Flag<["-"], "fno-experimental-relative-c++-abi-vtables">,
- Group<f_clang_Group>, Flags<[CC1Option]>,
+ Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Do not use the experimental C++ class ABI for classes with virtual tables">;
def fcxx_abi_EQ : Joined<["-"], "fc++-abi=">,
- Group<f_clang_Group>, Flags<[CC1Option]>,
+ Group<f_clang_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"C++ ABI to use. This will override the target C++ ABI.">;
def flat__namespace : Flag<["-"], "flat_namespace">;
def flax_vector_conversions_EQ : Joined<["-"], "flax-vector-conversions=">, Group<f_Group>,
- HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">, Flags<[CC1Option]>,
+ HelpText<"Enable implicit vector bit-casts">, Values<"none,integer,all">,
+ Visibility<[ClangOption, CC1Option]>,
NormalizedValues<["LangOptions::LaxVectorConversionKind::None",
"LangOptions::LaxVectorConversionKind::Integer",
"LangOptions::LaxVectorConversionKind::All"]>,
@@ -2449,90 +2682,107 @@ def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Gr
def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group<f_Group>,
HelpText<"Force linking the clang builtins runtime library">;
-def flto_EQ : Joined<["-"], "flto=">, Flags<[CoreOption, CC1Option, FC1Option, FlangOption]>, Group<f_Group>,
+def flto_EQ : Joined<["-"], "flto=">,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FC1Option, FlangOption]>,
+ Group<f_Group>,
HelpText<"Set LTO mode">, Values<"thin,full">;
def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Group<f_Group>,
Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
def flto_EQ_auto : Flag<["-"], "flto=auto">, Group<f_Group>,
Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
-def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option, FC1Option, FlangOption]>, Group<f_Group>,
+def flto : Flag<["-"], "flto">,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FC1Option, FlangOption]>,
+ Group<f_Group>,
Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
defm unified_lto : BoolFOption<"unified-lto",
CodeGenOpts<"UnifiedLTO">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Use the unified LTO pipeline">,
NegFlag<SetFalse, [], [ClangOption], "Use distinct LTO pipelines">,
- BothFlags<[CC1Option], [ClangOption], "">>;
-def fno_lto : Flag<["-"], "fno-lto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
+ BothFlags<[], [ClangOption, CC1Option], "">>;
+def fno_lto : Flag<["-"], "fno-lto">,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>, Group<f_Group>,
HelpText<"Disable LTO mode (default)">;
-def foffload_lto_EQ : Joined<["-"], "foffload-lto=">, Flags<[CoreOption]>, Group<f_Group>,
+def foffload_lto_EQ : Joined<["-"], "foffload-lto=">,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Group<f_Group>,
HelpText<"Set LTO mode for offload compilation">, Values<"thin,full">;
-def foffload_lto : Flag<["-"], "foffload-lto">, Flags<[CoreOption]>, Group<f_Group>,
+def foffload_lto : Flag<["-"], "foffload-lto">,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Group<f_Group>,
Alias<foffload_lto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode for offload compilation">;
-def fno_offload_lto : Flag<["-"], "fno-offload-lto">, Flags<[CoreOption]>, Group<f_Group>,
+def fno_offload_lto : Flag<["-"], "fno-offload-lto">,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Group<f_Group>,
HelpText<"Disable LTO mode (default) for offload compilation">;
def flto_jobs_EQ : Joined<["-"], "flto-jobs=">,
- Flags<[CC1Option]>, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
HelpText<"Controls the backend parallelism of -flto=thin (default "
"of 0 means the number of threads will be derived from "
"the number of CPUs detected)">;
def fthinlto_index_EQ : Joined<["-"], "fthinlto-index=">,
- Flags<[CoreOption, CC1Option]>, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>, Group<f_Group>,
HelpText<"Perform ThinLTO importing using provided function summary index">;
def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
- Flags<[CoreOption, CC1Option]>, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option]>, Group<f_Group>,
HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">,
MarshallingInfoString<CodeGenOpts<"ThinLinkBitcodeFile">>;
defm fat_lto_objects : BoolFOption<"fat-lto-objects",
CodeGenOpts<"FatLTO">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable">,
- BothFlags<[CC1Option], [ClangOption], " fat LTO object support">>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option], "Disable">,
+ BothFlags<[], [ClangOption, CC1Option], " fat LTO object support">>;
def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
- Group<f_Group>, Flags<[NoXarchOption, CC1Option, CoreOption]>,
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit)">,
MarshallingInfoInt<DiagnosticOpts<"MacroBacktraceLimit">, "DiagnosticOptions::DefaultMacroBacktraceLimit">;
def fcaret_diagnostics_max_lines_EQ :
Joined<["-"], "fcaret-diagnostics-max-lines=">,
- Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Set the maximum number of source lines to show in a caret diagnostic (0 = no limit).">,
MarshallingInfoInt<DiagnosticOpts<"SnippetLineLimit">, "DiagnosticOptions::DefaultSnippetLineLimit">;
defm merge_all_constants : BoolFOption<"merge-all-constants",
CodeGenOpts<"MergeAllConstants">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option, CoreOption], [ClangOption], "Allow">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option, CLOption, DXCOption], "Allow">,
NegFlag<SetFalse, [], [ClangOption], "Disallow">,
BothFlags<[], [ClangOption], " merging of constants">>;
-def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>, Flags<[CC1Option]>,
+def fmessage_length_EQ : Joined<["-"], "fmessage-length=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Format message diagnostics so that they fit within N columns">,
MarshallingInfoInt<DiagnosticOpts<"MessageLength">>;
def frandomize_layout_seed_EQ : Joined<["-"], "frandomize-layout-seed=">,
- MetaVarName<"<seed>">, Group<f_clang_Group>, Flags<[CC1Option]>,
+ MetaVarName<"<seed>">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"The seed used by the randomize structure layout feature">;
def frandomize_layout_seed_file_EQ : Joined<["-"], "frandomize-layout-seed-file=">,
- MetaVarName<"<file>">, Group<f_clang_Group>, Flags<[CC1Option]>,
+ MetaVarName<"<file>">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"File holding the seed used by the randomize structure layout feature">;
-def fms_compatibility : Flag<["-"], "fms-compatibility">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+def fms_compatibility : Flag<["-"], "fms-compatibility">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Enable full Microsoft Visual C++ compatibility">,
MarshallingInfoFlag<LangOpts<"MSVCCompat">>;
-def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+def fms_extensions : Flag<["-"], "fms-extensions">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Accept some non-standard constructs supported by the Microsoft compiler">,
MarshallingInfoFlag<LangOpts<"MicrosoftExt">>, ImpliedByAnyOf<[fms_compatibility.KeyPath]>;
defm asm_blocks : BoolFOption<"asm-blocks",
LangOpts<"AsmBlocks">, Default<fms_extensions.KeyPath>,
- PosFlag<SetTrue, [CC1Option], [ClangOption]>,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
NegFlag<SetFalse>>;
-def fms_volatile : Flag<["-"], "fms-volatile">, Group<f_Group>, Flags<[CC1Option]>,
+def fms_volatile : Flag<["-"], "fms-volatile">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"MSVolatile">>;
-def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>, Flags<[NoXarchOption, CoreOption]>,
+def fmsc_version : Joined<["-"], "fmsc-version=">, Group<f_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default))">;
def fms_compatibility_version
: Joined<["-"], "fms-compatibility-version=">,
Group<f_Group>,
- Flags<[ CC1Option, CoreOption ]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Dot-separated value representing the Microsoft compiler "
"version number to report in _MSC_VER (0 = don't define it "
"(default))">;
def fms_runtime_lib_EQ : Joined<["-"], "fms-runtime-lib=">, Group<f_Group>,
- Flags<[NoXarchOption, CoreOption]>, Values<"static,static_dbg,dll,dll_dbg">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ Values<"static,static_dbg,dll,dll_dbg">,
HelpText<"Select Windows run-time library">,
DocBrief<[{
Specify Visual Studio C runtime library. "static" and "static_dbg" correspond
@@ -2540,18 +2790,22 @@ to the cl flags /MT and /MTd which use the multithread, static version. "dll"
and "dll_dbg" correspond to the cl flags /MD and /MDd which use the multithread,
dll version.}]>;
def fms_omit_default_lib : Joined<["-"], "fms-omit-default-lib">,
- Group<f_Group>, Flags<[NoXarchOption, CoreOption]>;
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
defm delayed_template_parsing : BoolFOption<"delayed-template-parsing",
LangOpts<"DelayedTemplateParsing">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Parse templated function definitions at the end of the translation unit">,
- NegFlag<SetFalse, [NoXarchOption], [ClangOption], "Disable delayed template parsing">,
- BothFlags<[CoreOption]>>;
-def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group<f_Group>, Flags<[CC1Option]>,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Parse templated function definitions at the end of the translation unit">,
+ NegFlag<SetFalse, [NoXarchOption], [], "Disable delayed template parsing">,
+ BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
+def fms_memptr_rep_EQ : Joined<["-"], "fms-memptr-rep=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
Values<"single,multiple,virtual">, NormalizedValuesScope<"LangOptions">,
NormalizedValues<["PPTMK_FullGeneralitySingleInheritance", "PPTMK_FullGeneralityMultipleInheritance",
"PPTMK_FullGeneralityVirtualInheritance"]>,
MarshallingInfoEnum<LangOpts<"MSPointerToMemberRepresentationMethod">, "PPTMK_BestCase">;
-def fms_kernel : Flag<["-"], "fms-kernel">, Group<f_Group>, Flags<[CC1Option, NoDriverOption]>,
+def fms_kernel : Flag<["-"], "fms-kernel">, Group<f_Group>,
+ Visibility<[CC1Option]>,
MarshallingInfoFlag<LangOpts<"Kernel">>;
// __declspec is enabled by default for the PS4 by the driver, and also
// enabled for Microsoft Extensions or Borland Extensions, here.
@@ -2565,72 +2819,80 @@ defm declspec : BoolOption<"f", "declspec",
LangOpts<"DeclSpecKeyword">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Allow", [fms_extensions.KeyPath, fborland_extensions.KeyPath, cuda.KeyPath]>,
NegFlag<SetFalse, [], [ClangOption], "Disallow">,
- BothFlags<[CC1Option], [ClangOption], " __declspec as a keyword">>, Group<f_clang_Group>;
+ BothFlags<[], [ClangOption, CC1Option],
+ " __declspec as a keyword">>, Group<f_clang_Group>;
def fmodules_cache_path : Joined<["-"], "fmodules-cache-path=">, Group<i_Group>,
- Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<directory>">,
HelpText<"Specify the module cache path">;
def fmodules_user_build_path : Separate<["-"], "fmodules-user-build-path">, Group<i_Group>,
- Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<directory>">,
HelpText<"Specify the module user build path">,
MarshallingInfoString<HeaderSearchOpts<"ModuleUserBuildPath">>;
def fprebuilt_module_path : Joined<["-"], "fprebuilt-module-path=">, Group<i_Group>,
- Flags<[NoXarchOption, CC1Option]>, MetaVarName<"<directory>">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<directory>">,
HelpText<"Specify the prebuilt module path">;
defm prebuilt_implicit_modules : BoolFOption<"prebuilt-implicit-modules",
HeaderSearchOpts<"EnablePrebuiltImplicitModules">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Look up implicit modules in the prebuilt module path">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option]>>;
+ NegFlag<SetFalse>, BothFlags<[NoXarchOption], [ClangOption, CC1Option]>>;
-def fmodule_output_EQ : Joined<["-"], "fmodule-output=">, Flags<[NoXarchOption, CC1Option]>,
+def fmodule_output_EQ : Joined<["-"], "fmodule-output=">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
-def fmodule_output : Flag<["-"], "fmodule-output">, Flags<[NoXarchOption, CC1Option]>,
+def fmodule_output : Flag<["-"], "fmodule-output">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>,
- Flags<[CC1Option]>, MetaVarName<"<seconds>">,
+ Visibility<[ClangOption, CC1Option]>, MetaVarName<"<seconds>">,
HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">,
MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneInterval">, "7 * 24 * 60 * 60">;
def fmodules_prune_after : Joined<["-"], "fmodules-prune-after=">, Group<i_Group>,
- Flags<[CC1Option]>, MetaVarName<"<seconds>">,
+ Visibility<[ClangOption, CC1Option]>, MetaVarName<"<seconds>">,
HelpText<"Specify the interval (in seconds) after which a module file will be considered unused">,
MarshallingInfoInt<HeaderSearchOpts<"ModuleCachePruneAfter">, "31 * 24 * 60 * 60">;
def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">,
- Group<i_Group>, Flags<[CC1Option]>, MetaVarName<"<time since Epoch in seconds>">,
+ Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<time since Epoch in seconds>">,
HelpText<"Time when the current build session started">,
MarshallingInfoInt<HeaderSearchOpts<"BuildSessionTimestamp">, "0", "uint64_t">;
def fbuild_session_file : Joined<["-"], "fbuild-session-file=">,
Group<i_Group>, MetaVarName<"<file>">,
HelpText<"Use the last modification time of <file> as the build session timestamp">;
def fmodules_validate_once_per_build_session : Flag<["-"], "fmodules-validate-once-per-build-session">,
- Group<i_Group>, Flags<[CC1Option]>,
+ Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Don't verify input files for the modules if the module has been "
"successfully validated or loaded during this build session">,
MarshallingInfoFlag<HeaderSearchOpts<"ModulesValidateOncePerBuildSession">>;
def fmodules_disable_diagnostic_validation : Flag<["-"], "fmodules-disable-diagnostic-validation">,
- Group<i_Group>, Flags<[CC1Option]>,
+ Group<i_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable validation of the diagnostic options when loading the module">,
MarshallingInfoNegativeFlag<HeaderSearchOpts<"ModulesValidateDiagnosticOptions">>;
defm modules_validate_system_headers : BoolOption<"f", "modules-validate-system-headers",
HeaderSearchOpts<"ModulesValidateSystemHeaders">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Validate the system headers that a module depends on when loading the module">,
- NegFlag<SetFalse, [NoXarchOption], [ClangOption]>>, Group<i_Group>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Validate the system headers that a module depends on when loading the module">,
+ NegFlag<SetFalse, [NoXarchOption], []>>, Group<i_Group>;
def fno_modules_validate_textual_header_includes :
Flag<["-"], "fno-modules-validate-textual-header-includes">,
- Group<f_Group>, Flags<[CC1Option, NoXarchOption]>,
+ Group<f_Group>, Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
MarshallingInfoNegativeFlag<LangOpts<"ModulesValidateTextualHeaderIncludes">>,
HelpText<"Do not enforce -fmodules-decluse and private header restrictions for textual headers. "
"This flag will be removed in a future Clang release.">;
def fincremental_extensions :
Flag<["-"], "fincremental-extensions">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable incremental processing extensions such as processing"
"statements on the global scope.">,
MarshallingInfoFlag<LangOpts<"IncrementalExtensions">>;
def fvalidate_ast_input_files_content:
Flag <["-"], "fvalidate-ast-input-files-content">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Compute and store the hash of input files used to build an AST."
" Files with mismatching mtime's are considered valid"
" if both contents is identical">,
@@ -2652,62 +2914,81 @@ def fno_pch_validate_input_files_content:
defm pch_instantiate_templates : BoolFOption<"pch-instantiate-templates",
LangOpts<"PCHInstantiateTemplates">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Instantiate templates already while building a PCH">,
- NegFlag<SetFalse>, BothFlags<[CC1Option, CoreOption]>>;
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option, CLOption, DXCOption]
+ >>;
defm pch_codegen: OptInCC1FFlag<"pch-codegen", "Generate ", "Do not generate ",
"code for uses of this PCH that assumes an explicit object file will be built for the PCH">;
defm pch_debuginfo: OptInCC1FFlag<"pch-debuginfo", "Generate ", "Do not generate ",
"debug info for types in an object file built from this PCH and do not generate them elsewhere">;
def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
- Flags<[NoXarchOption, CC1Option, CoreOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Implicitly search the file system for module map files.">,
MarshallingInfoFlag<HeaderSearchOpts<"ImplicitModuleMaps">>;
defm modules : BoolFOption<"modules",
LangOpts<"Modules">, Default<fcxx_modules.KeyPath>,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable the 'modules' language feature">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption, CoreOption]>>;
-def fmodule_maps : Flag <["-"], "fmodule-maps">, Flags<[CoreOption]>, Alias<fimplicit_module_maps>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable the 'modules' language feature">,
+ NegFlag<SetFalse>, BothFlags<
+ [NoXarchOption], [ClangOption, CLOption, DXCOption]>>;
+def fmodule_maps : Flag <["-"], "fmodule-maps">,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fimplicit_module_maps>;
def fmodule_name_EQ : Joined<["-"], "fmodule-name=">, Group<f_Group>,
- Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<name>">,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ MetaVarName<"<name>">,
HelpText<"Specify the name of the module to build">,
MarshallingInfoString<LangOpts<"ModuleName">>;
def fmodule_implementation_of : Separate<["-"], "fmodule-implementation-of">,
- Flags<[CC1Option,CoreOption]>, Alias<fmodule_name_EQ>;
-def fsystem_module : Flag<["-"], "fsystem-module">, Flags<[CC1Option,CoreOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ Alias<fmodule_name_EQ>;
+def fsystem_module : Flag<["-"], "fsystem-module">,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Build this module as a system module. Only used with -emit-module">,
MarshallingInfoFlag<FrontendOpts<"IsSystemModule">>;
def fmodule_map_file : Joined<["-"], "fmodule-map-file=">,
- Group<f_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"<file>">,
+ Group<f_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ MetaVarName<"<file>">,
HelpText<"Load this module map file">,
MarshallingInfoStringVector<FrontendOpts<"ModuleMapFiles">>;
def fmodule_file : Joined<["-"], "fmodule-file=">,
- Group<i_Group>, Flags<[NoXarchOption,CC1Option,CoreOption]>, MetaVarName<"[<name>=]<file>">,
+ Group<i_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ MetaVarName<"[<name>=]<file>">,
HelpText<"Specify the mapping of module name to precompiled module file, or load a module file if name is omitted.">;
def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>,
- Flags<[CC1Option,CoreOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Ignore the definition of the given macro when building and loading modules">;
def fmodules_strict_decluse : Flag <["-"], "fmodules-strict-decluse">, Group<f_Group>,
- Flags<[NoXarchOption,CC1Option,CoreOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Like -fmodules-decluse but requires all headers to be in modules">,
MarshallingInfoFlag<LangOpts<"ModulesStrictDeclUse">>;
defm modules_decluse : BoolFOption<"modules-decluse",
LangOpts<"ModulesDeclUse">, Default<fmodules_strict_decluse.KeyPath>,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Require declaration of modules used within a module">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption,CoreOption]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Require declaration of modules used within a module">,
+ NegFlag<SetFalse>, BothFlags<
+ [NoXarchOption], [ClangOption, CLOption, DXCOption]>>;
defm modules_search_all : BoolFOption<"modules-search-all",
LangOpts<"ModulesSearchAll">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Search even non-imported modules to resolve references">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption, CC1Option,CoreOption]>>,
+ NegFlag<SetFalse>, BothFlags<
+ [NoXarchOption], [ClangOption, CC1Option, CLOption, DXCOption]>>,
ShouldParseIf<fmodules.KeyPath>;
defm implicit_modules : BoolFOption<"implicit-modules",
LangOpts<"ImplicitModules">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption]>,
- PosFlag<SetTrue>, BothFlags<[NoXarchOption,CoreOption]>>;
+ NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
+ PosFlag<SetTrue>, BothFlags<
+ [NoXarchOption], [ClangOption, CLOption, DXCOption]>>;
def fno_modules_check_relocated : Joined<["-"], "fno-modules-check-relocated">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Skip checks for relocated modules when loading PCM files">,
MarshallingInfoNegativeFlag<PreprocessorOpts<"ModulesCheckRelocated">>;
-def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group<f_Group>, Flags<[CC1Option]>,
+def fretain_comments_from_system_headers : Flag<["-"], "fretain-comments-from-system-headers">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"RetainCommentsFromSystemHeaders">>;
def fmodule_header : Flag <["-"], "fmodule-header">, Group<f_Group>,
Flags<[NoXarchOption]>, HelpText<"Build a C++20 Header Unit from a header.">;
@@ -2718,7 +2999,7 @@ def fmodule_header_EQ : Joined<["-"], "fmodule-header=">, Group<f_Group>,
def fno_knr_functions : Flag<["-"], "fno-knr-functions">, Group<f_Group>,
MarshallingInfoFlag<LangOpts<"DisableKNRFunctions">>,
HelpText<"Disable support for K&R C function declarations">,
- Flags<[CC1Option, CoreOption]>;
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>;
def fmudflapth : Flag<["-"], "fmudflapth">, Group<f_Group>;
def fmudflap : Flag<["-"], "fmudflap">, Group<f_Group>;
@@ -2728,26 +3009,33 @@ def fno_asm : Flag<["-"], "fno-asm">, Group<f_Group>;
def fno_asynchronous_unwind_tables : Flag<["-"], "fno-asynchronous-unwind-tables">, Group<f_Group>;
def fno_assume_sane_operator_new : Flag<["-"], "fno-assume-sane-operator-new">, Group<f_Group>,
HelpText<"Don't assume that C++'s global operator new can't alias any pointer">,
- Flags<[CC1Option]>, MarshallingInfoNegativeFlag<CodeGenOpts<"AssumeSaneOperatorNew">>;
-def fno_builtin : Flag<["-"], "fno-builtin">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+ Visibility<[ClangOption, CC1Option]>,
+ MarshallingInfoNegativeFlag<CodeGenOpts<"AssumeSaneOperatorNew">>;
+def fno_builtin : Flag<["-"], "fno-builtin">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Disable implicit builtin knowledge of functions">;
-def fno_builtin_ : Joined<["-"], "fno-builtin-">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+def fno_builtin_ : Joined<["-"], "fno-builtin-">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Disable implicit builtin knowledge of a specific function">;
-def fno_common : Flag<["-"], "fno-common">, Group<f_Group>, Flags<[CC1Option]>,
+def fno_common : Flag<["-"], "fno-common">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Compile common globals like normal definitions">;
defm digraphs : BoolFOption<"digraphs",
LangOpts<"Digraphs">, Default<std#".hasDigraphs()">,
PosFlag<SetTrue, [], [ClangOption], "Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)">,
NegFlag<SetFalse, [], [ClangOption], "Disallow alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:'">,
- BothFlags<[CC1Option]>>;
+ BothFlags<[], [ClangOption, CC1Option]>>;
def fno_eliminate_unused_debug_symbols : Flag<["-"], "fno-eliminate-unused-debug-symbols">, Group<f_Group>;
-def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group<f_clang_Group>, Flags<[CC1Option]>;
-def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>, Flags<[CC1Option]>;
+def fno_inline_functions : Flag<["-"], "fno-inline-functions">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>;
+def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>;
def fno_global_isel : Flag<["-"], "fno-global-isel">, Group<f_clang_Group>,
HelpText<"Disables the global instruction selector">;
def fno_experimental_isel : Flag<["-"], "fno-experimental-isel">, Group<f_clang_Group>,
Alias<fno_global_isel>;
-def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>, Flags<[CC1Option]>,
+def fveclib : Joined<["-"], "fveclib=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use the given vector functions library">,
Values<"Accelerate,libmvec,MASSV,SVML,SLEEF,Darwin_libsystem_m,ArmPL,none">,
NormalizedValuesScope<"CodeGenOptions">,
@@ -2766,84 +3054,97 @@ def fmodule_file_deps : Flag <["-"], "fmodule-file-deps">, Group<f_Group>,
def fno_module_file_deps : Flag <["-"], "fno-module-file-deps">, Group<f_Group>,
Flags<[NoXarchOption]>;
def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group<f_Group>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group<f_Group>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group<f_Group>;
-def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>, Flags<[CC1Option]>;
+def fno_objc_weak : Flag<["-"], "fno-objc-weak">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>;
def fno_omit_frame_pointer : Flag<["-"], "fno-omit-frame-pointer">, Group<f_Group>;
defm operator_names : BoolFOption<"operator-names",
LangOpts<"CXXOperatorNames">, Default<cplusplus.KeyPath>,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Do not treat C++ operator name keywords as synonyms for operators">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Do not treat C++ operator name keywords as synonyms for operators">,
PosFlag<SetTrue>>;
def fdiagnostics_absolute_paths : Flag<["-"], "fdiagnostics-absolute-paths">, Group<f_Group>,
- Flags<[CC1Option, CoreOption]>, HelpText<"Print absolute paths in diagnostics">,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ HelpText<"Print absolute paths in diagnostics">,
MarshallingInfoFlag<DiagnosticOpts<"AbsolutePath">>;
defm diagnostics_show_line_numbers : BoolFOption<"diagnostics-show-line-numbers",
DiagnosticOpts<"ShowLineNumbers">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Show line numbers in diagnostic code snippets">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Show line numbers in diagnostic code snippets">,
PosFlag<SetTrue>>;
def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>,
HelpText<"Disable the use of stack protectors">;
def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>,
- Flags<[NoXarchOption, CoreOption]>;
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>;
def fno_struct_path_tbaa : Flag<["-"], "fno-struct-path-tbaa">, Group<f_Group>;
def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>;
def fno_temp_file : Flag<["-"], "fno-temp-file">, Group<f_Group>,
- Flags<[CC1Option, CoreOption]>, HelpText<
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>, HelpText<
"Directly create compilation output files. This may lead to incorrect incremental builds if the compiler crashes">,
MarshallingInfoNegativeFlag<FrontendOpts<"UseTemporary">>;
defm use_cxa_atexit : BoolFOption<"use-cxa-atexit",
CodeGenOpts<"CXAAtExit">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Don't use __cxa_atexit for calling destructors">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Don't use __cxa_atexit for calling destructors">,
PosFlag<SetTrue>>;
def fno_unwind_tables : Flag<["-"], "fno-unwind-tables">, Group<f_Group>;
-def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>, Flags<[CC1Option]>,
+def fno_verbose_asm : Flag<["-"], "fno-verbose-asm">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoNegativeFlag<CodeGenOpts<"AsmVerbose">>;
def fno_working_directory : Flag<["-"], "fno-working-directory">, Group<f_Group>;
def fno_wrapv : Flag<["-"], "fno-wrapv">, Group<f_Group>;
-def fobjc_arc : Flag<["-"], "fobjc-arc">, Group<f_Group>, Flags<[CC1Option]>,
+def fobjc_arc : Flag<["-"], "fobjc-arc">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Synthesize retain and release calls for Objective-C pointers">;
def fno_objc_arc : Flag<["-"], "fno-objc-arc">, Group<f_Group>;
defm objc_encode_cxx_class_template_spec : BoolFOption<"objc-encode-cxx-class-template-spec",
LangOpts<"EncodeCXXClassTemplateSpec">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Fully encode c++ class template specialization">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Fully encode c++ class template specialization">,
NegFlag<SetFalse>>;
defm objc_convert_messages_to_runtime_calls : BoolFOption<"objc-convert-messages-to-runtime-calls",
CodeGenOpts<"ObjCConvertMessagesToRuntimeCalls">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption]>,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
PosFlag<SetTrue>>;
defm objc_arc_exceptions : BoolFOption<"objc-arc-exceptions",
CodeGenOpts<"ObjCAutoRefCountExceptions">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use EH-safe code when synthesizing retains and releases in -fobjc-arc">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use EH-safe code when synthesizing retains and releases in -fobjc-arc">,
NegFlag<SetFalse>>;
def fobjc_atdefs : Flag<["-"], "fobjc-atdefs">, Group<clang_ignored_f_Group>;
def fobjc_call_cxx_cdtors : Flag<["-"], "fobjc-call-cxx-cdtors">, Group<clang_ignored_f_Group>;
defm objc_exceptions : BoolFOption<"objc-exceptions",
LangOpts<"ObjCExceptions">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable Objective-C exceptions">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable Objective-C exceptions">,
NegFlag<SetFalse>>;
defm application_extension : BoolFOption<"application-extension",
LangOpts<"AppExt">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Restrict code to those available for App Extensions">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Restrict code to those available for App Extensions">,
NegFlag<SetFalse>>;
defm relaxed_template_template_args : BoolFOption<"relaxed-template-template-args",
LangOpts<"RelaxedTemplateTemplateArgs">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable C++17 relaxed template template argument matching">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable C++17 relaxed template template argument matching">,
NegFlag<SetFalse>>;
defm sized_deallocation : BoolFOption<"sized-deallocation",
LangOpts<"SizedDeallocation">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable C++14 sized global deallocation functions">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable C++14 sized global deallocation functions">,
NegFlag<SetFalse>>;
defm aligned_allocation : BoolFOption<"aligned-allocation",
LangOpts<"AlignedAllocation">, Default<cpp17.KeyPath>,
PosFlag<SetTrue, [], [ClangOption], "Enable C++17 aligned allocation functions">,
- NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
def fnew_alignment_EQ : Joined<["-"], "fnew-alignment=">,
HelpText<"Specifies the largest alignment guaranteed by '::operator new(size_t)'">,
- MetaVarName<"<align>">, Group<f_Group>, Flags<[CC1Option]>,
+ MetaVarName<"<align>">, Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
MarshallingInfoInt<LangOpts<"NewAlignOverride">>;
def : Separate<["-"], "fnew-alignment">, Alias<fnew_alignment_EQ>;
def : Flag<["-"], "faligned-new">, Alias<faligned_allocation>;
@@ -2854,14 +3155,17 @@ def fobjc_legacy_dispatch : Flag<["-"], "fobjc-legacy-dispatch">, Group<f_Group>
def fobjc_new_property : Flag<["-"], "fobjc-new-property">, Group<clang_ignored_f_Group>;
defm objc_infer_related_result_type : BoolFOption<"objc-infer-related-result-type",
LangOpts<"ObjCInferRelatedResultType">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "do not infer Objective-C related result type based on method family">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "do not infer Objective-C related result type based on method family">,
PosFlag<SetTrue>>;
def fobjc_link_runtime: Flag<["-"], "fobjc-link-runtime">, Group<f_Group>;
-def fobjc_weak : Flag<["-"], "fobjc-weak">, Group<f_Group>, Flags<[CC1Option]>,
+def fobjc_weak : Flag<["-"], "fobjc-weak">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable ARC-style weak references in Objective-C">;
// Objective-C ABI options.
-def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Specify the target Objective-C runtime kind and version">;
def fobjc_abi_version_EQ : Joined<["-"], "fobjc-abi-version=">, Group<f_Group>;
def fobjc_nonfragile_abi_version_EQ : Joined<["-"], "fobjc-nonfragile-abi-version=">, Group<f_Group>;
@@ -2871,63 +3175,75 @@ def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Gr
def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>;
def fobjc_disable_direct_methods_for_testing :
Flag<["-"], "fobjc-disable-direct-methods-for-testing">,
- Group<f_Group>, Flags<[CC1Option]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Ignore attribute objc_direct so that direct methods can be tested">,
MarshallingInfoFlag<LangOpts<"ObjCDisableDirectMethodsForTesting">>;
defm objc_avoid_heapify_local_blocks : BoolFOption<"objc-avoid-heapify-local-blocks",
CodeGenOpts<"ObjCAvoidHeapifyLocalBlocks">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Try">,
NegFlag<SetFalse, [], [ClangOption], "Don't try">,
- BothFlags<[CC1Option, NoDriverOption], [ClangOption], " to avoid heapifying local blocks">>;
+ BothFlags<[], [CC1Option], " to avoid heapifying local blocks">>;
def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>,
HelpText<"Omit the frame pointer from functions that don't need it. "
"Some stack unwinding cases, such as profilers and sanitizers, may prefer specifying -fno-omit-frame-pointer. "
"On many targets, -O1 and higher omit the frame pointer by default. "
"-m[no-]omit-leaf-frame-pointer takes precedence for leaf functions">;
-def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, FlangOption, FC1Option]>,
+def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>,
+ Flags<[NoArgumentUnused]>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Parse OpenMP pragmas and generate parallel code.">;
-def fno_openmp : Flag<["-"], "fno-openmp">, Group<f_Group>, Flags<[NoArgumentUnused]>;
-def fopenmp_version_EQ : Joined<["-"], "fopenmp-version=">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, FlangOption, FC1Option]>,
+def fno_openmp : Flag<["-"], "fno-openmp">, Group<f_Group>,
+ Flags<[NoArgumentUnused]>;
+def fopenmp_version_EQ : Joined<["-"], "fopenmp-version=">, Group<f_Group>,
+ Flags<[NoArgumentUnused]>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Set OpenMP version (e.g. 45 for OpenMP 4.5, 50 for OpenMP 5.0). Default value is 50 for Clang and 11 for Flang">;
defm openmp_extensions: BoolFOption<"openmp-extensions",
LangOpts<"OpenMPExtensions">, DefaultTrue,
- PosFlag<SetTrue, [CC1Option, NoArgumentUnused], [ClangOption],
+ PosFlag<SetTrue, [NoArgumentUnused], [ClangOption, CC1Option],
"Enable all Clang extensions for OpenMP directives and clauses">,
- NegFlag<SetFalse, [CC1Option, NoArgumentUnused], [ClangOption],
+ NegFlag<SetFalse, [NoArgumentUnused], [ClangOption, CC1Option],
"Disable all Clang extensions for OpenMP directives and clauses">>;
def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group<f_Group>;
def fopenmp_use_tls : Flag<["-"], "fopenmp-use-tls">, Group<f_Group>,
Flags<[NoArgumentUnused, HelpHidden]>;
def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group<f_Group>,
- Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
-def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">, Flags<[NoXarchOption, CC1Option]>,
+ Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
+def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify comma-separated list of triples OpenMP offloading targets to be supported">;
def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">,
- Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
+ Group<f_Group>, Flags<[NoArgumentUnused, HelpHidden]>,
+ Visibility<[ClangOption, CC1Option]>;
def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">,
- Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
-def fopenmp_simd : Flag<["-"], "fopenmp-simd">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>,
+ Group<f_Group>, Flags<[NoArgumentUnused, HelpHidden]>,
+ Visibility<[ClangOption, CC1Option]>;
+def fopenmp_simd : Flag<["-"], "fopenmp-simd">, Group<f_Group>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
-def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
+def fopenmp_enable_irbuilder : Flag<["-"], "fopenmp-enable-irbuilder">, Group<f_Group>,
+ Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Use the experimental OpenMP-IR-Builder codegen path.">;
-def fno_openmp_simd : Flag<["-"], "fno-openmp-simd">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>;
+def fno_openmp_simd : Flag<["-"], "fno-openmp-simd">, Group<f_Group>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>;
def fopenmp_cuda_mode : Flag<["-"], "fopenmp-cuda-mode">, Group<f_Group>,
- Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
+ Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
def fno_openmp_cuda_mode : Flag<["-"], "fno-openmp-cuda-mode">, Group<f_Group>,
Flags<[NoArgumentUnused, HelpHidden]>;
def fopenmp_cuda_number_of_sm_EQ : Joined<["-"], "fopenmp-cuda-number-of-sm=">, Group<f_Group>,
- Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
+ Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
def fopenmp_cuda_blocks_per_sm_EQ : Joined<["-"], "fopenmp-cuda-blocks-per-sm=">, Group<f_Group>,
- Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
+ Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
def fopenmp_cuda_teams_reduction_recs_num_EQ : Joined<["-"], "fopenmp-cuda-teams-reduction-recs-num=">, Group<f_Group>,
- Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
+ Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
//===----------------------------------------------------------------------===//
// Shared cc1 + fc1 OpenMP Target Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, FC1Option, NoArgumentUnused] in {
+let Flags = [NoArgumentUnused] in {
+let Visibility = [ClangOption, CC1Option, FC1Option] in {
let Group = f_Group in {
def fopenmp_target_debug : Flag<["-"], "fopenmp-target-debug">,
@@ -2935,13 +3251,14 @@ def fopenmp_target_debug : Flag<["-"], "fopenmp-target-debug">,
def fno_openmp_target_debug : Flag<["-"], "fno-openmp-target-debug">;
} // let Group = f_Group
-} // let Flags = [CC1Option, FC1Option, NoArgumentUnused]
+} // let Visibility = [ClangOption, CC1Option, FC1Option]
+} // let Flags = [NoArgumentUnused]
//===----------------------------------------------------------------------===//
// Optimisation remark options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, FC1Option, FlangOption] in {
+let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption] in {
def Rpass_EQ : Joined<["-"], "Rpass=">, Group<R_value_Group>,
HelpText<"Report transformations performed by optimization passes whose "
@@ -2952,12 +3269,14 @@ def Rpass_missed_EQ : Joined<["-"], "Rpass-missed=">, Group<R_value_Group>,
def Rpass_analysis_EQ : Joined<["-"], "Rpass-analysis=">, Group<R_value_Group>,
HelpText<"Report transformation analysis from optimization passes whose "
"name matches the given POSIX regular expression">;
-def R_Joined : Joined<["-"], "R">, Group<R_Group>, Flags<[CoreOption]>,
+def R_Joined : Joined<["-"], "R">, Group<R_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
MetaVarName<"<remark>">, HelpText<"Enable the specified remark">;
-} // let Flags = [CC1Option, FC1Option, FlangOption]
+} // let Visibility = [ClangOption, CC1Option, FC1Option, FlangOption]
-let Flags = [CC1Option, FC1Option, NoArgumentUnused, HelpHidden] in {
+let Flags = [NoArgumentUnused, HelpHidden] in {
+let Visibility = [ClangOption, CC1Option, FC1Option] in {
let Group = f_Group in {
def fopenmp_target_debug_EQ : Joined<["-"], "fopenmp-target-debug=">;
@@ -2973,38 +3292,42 @@ def fopenmp_assume_no_nested_parallelism : Flag<["-"], "fopenmp-assume-no-nested
MarshallingInfoFlag<LangOpts<"OpenMPNoNestedParallelism">>;
} // let Group = f_Group
-} // let Flags = [CC1Option, FC1Option, NoArgumentUnused, HelpHidden]
+} // let Visibility = [ClangOption, CC1Option, FC1Option]
+} // let Flags = [NoArgumentUnused, HelpHidden]
def fopenmp_offload_mandatory : Flag<["-"], "fopenmp-offload-mandatory">, Group<f_Group>,
- Flags<[CC1Option, NoArgumentUnused]>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Do not create a host fallback if offloading to the device fails.">,
MarshallingInfoFlag<LangOpts<"OpenMPOffloadMandatory">>;
def fopenmp_target_jit : Flag<["-"], "fopenmp-target-jit">, Group<f_Group>,
- Flags<[CoreOption, NoArgumentUnused]>,
+ Flags<[NoArgumentUnused]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Emit code that can be JIT compiled for OpenMP offloading. Implies -foffload-lto=full">;
def fno_openmp_target_jit : Flag<["-"], "fno-openmp-target-jit">, Group<f_Group>,
- Flags<[CoreOption, NoArgumentUnused, HelpHidden]>;
+ Flags<[NoArgumentUnused, HelpHidden]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def fopenmp_target_new_runtime : Flag<["-"], "fopenmp-target-new-runtime">,
- Group<f_Group>, Flags<[CC1Option, HelpHidden]>;
+ Group<f_Group>, Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
def fno_openmp_target_new_runtime : Flag<["-"], "fno-openmp-target-new-runtime">,
- Group<f_Group>, Flags<[CC1Option, HelpHidden]>;
+ Group<f_Group>, Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>;
defm openmp_optimistic_collapse : BoolFOption<"openmp-optimistic-collapse",
LangOpts<"OpenMPOptimisticCollapse">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption]>,
- NegFlag<SetFalse>, BothFlags<[NoArgumentUnused, HelpHidden]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
+ NegFlag<SetFalse>, BothFlags<[NoArgumentUnused, HelpHidden], []>>;
def static_openmp: Flag<["-"], "static-openmp">,
HelpText<"Use the static host OpenMP runtime while linking.">;
def fopenmp_new_driver : Flag<["-"], "fopenmp-new-driver">, Flags<[HelpHidden]>,
HelpText<"Use the new driver for OpenMP offloading.">;
-def fno_openmp_new_driver : Flag<["-"], "fno-openmp-new-driver">, Flags<[HelpHidden]>,
+def fno_openmp_new_driver : Flag<["-"], "fno-openmp-new-driver">,
+ Flags<[HelpHidden]>,
HelpText<"Don't use the new driver for OpenMP offloading.">;
-def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>, Flags<[CC1Option]>,
+def fno_optimize_sibling_calls : Flag<["-"], "fno-optimize-sibling-calls">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable tail call optimization, keeping the call stack accurate">,
MarshallingInfoFlag<CodeGenOpts<"DisableTailCalls">>;
def foptimize_sibling_calls : Flag<["-"], "foptimize-sibling-calls">, Group<f_Group>;
defm escaping_block_tail_calls : BoolFOption<"escaping-block-tail-calls",
CodeGenOpts<"NoEscapingBlockTailCalls">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption]>,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option]>,
PosFlag<SetFalse>>;
def force__cpusubtype__ALL : Flag<["-"], "force_cpusubtype_ALL">;
def force__flat__namespace : Flag<["-"], "force_flat_namespace">;
@@ -3013,27 +3336,33 @@ def force_addr : Joined<["-"], "fforce-addr">, Group<clang_ignored_f_Group>;
def foutput_class_dir_EQ : Joined<["-"], "foutput-class-dir=">, Group<f_Group>;
def fpack_struct : Flag<["-"], "fpack-struct">, Group<f_Group>;
def fno_pack_struct : Flag<["-"], "fno-pack-struct">, Group<f_Group>;
-def fpack_struct_EQ : Joined<["-"], "fpack-struct=">, Group<f_Group>, Flags<[CC1Option]>,
+def fpack_struct_EQ : Joined<["-"], "fpack-struct=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify the default maximum struct packing alignment">,
MarshallingInfoInt<LangOpts<"PackStruct">>;
-def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group<f_Group>, Flags<[CC1Option]>,
+def fmax_type_align_EQ : Joined<["-"], "fmax-type-align=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify the maximum alignment to enforce on pointers lacking an explicit alignment">,
MarshallingInfoInt<LangOpts<"MaxTypeAlign">>;
def fno_max_type_align : Flag<["-"], "fno-max-type-align">, Group<f_Group>;
defm pascal_strings : BoolFOption<"pascal-strings",
LangOpts<"PascalStrings">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Recognize and construct Pascal-style string literals">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Recognize and construct Pascal-style string literals">,
NegFlag<SetFalse>>;
// Note: This flag has
diff erent semantics in the driver and in -cc1. The driver accepts -fpatchable-function-entry=M,N
// and forwards it to -cc1 as -fpatchable-function-entry=M and -fpatchable-function-entry-offset=N. In -cc1, both flags
// are treated as a single integer.
-def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group<f_Group>, Flags<[CC1Option]>,
+def fpatchable_function_entry_EQ : Joined<["-"], "fpatchable-function-entry=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MetaVarName<"<N,M>">, HelpText<"Generate M NOPs before function entry and N-M NOPs after function entry">,
MarshallingInfoInt<CodeGenOpts<"PatchableFunctionEntryCount">>;
-def fms_hotpatch : Flag<["-"], "fms-hotpatch">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
+def fms_hotpatch : Flag<["-"], "fms-hotpatch">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Ensure that all functions can be hotpatched at runtime">,
MarshallingInfoFlag<CodeGenOpts<"HotPatch">>;
-def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
+def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Override the default ABI to return all structs on the stack">;
def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group<f_Group>;
def fpic : Flag<["-"], "fpic">, Group<f_Group>;
@@ -3042,97 +3371,113 @@ def fpie : Flag<["-"], "fpie">, Group<f_Group>;
def fno_pie : Flag<["-"], "fno-pie">, Group<f_Group>;
defm pic_data_is_text_relative : SimpleMFlag<"pic-data-is-text-relative",
"Assume", "Don't assume", " data segments are relative to text segment">;
-def fdirect_access_external_data : Flag<["-"], "fdirect-access-external-data">, Group<f_Group>, Flags<[CC1Option]>,
+def fdirect_access_external_data : Flag<["-"], "fdirect-access-external-data">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Don't use GOT indirection to reference external data symbols">;
-def fno_direct_access_external_data : Flag<["-"], "fno-direct-access-external-data">, Group<f_Group>, Flags<[CC1Option]>,
+def fno_direct_access_external_data : Flag<["-"], "fno-direct-access-external-data">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use GOT indirection to reference external data symbols">;
defm plt : BoolFOption<"plt",
CodeGenOpts<"NoPLT">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption], "Use GOT indirection instead of PLT to make external function calls (x86 only)">,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use GOT indirection instead of PLT to make external function calls (x86 only)">,
PosFlag<SetFalse>>;
defm ropi : BoolFOption<"ropi",
LangOpts<"ROPI">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Generate read-only position independent code (ARM only)">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Generate read-only position independent code (ARM only)">,
NegFlag<SetFalse>>;
defm rwpi : BoolFOption<"rwpi",
LangOpts<"RWPI">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Generate read-write position independent code (ARM only)">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Generate read-write position independent code (ARM only)">,
NegFlag<SetFalse>>;
-def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>, Flags<[NoXarchOption]>, MetaVarName<"<dsopath>">,
+def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>,
+ Flags<[NoXarchOption]>, MetaVarName<"<dsopath>">,
HelpText<"Load the named plugin (dynamic shared object)">;
def fplugin_arg : Joined<["-"], "fplugin-arg-">,
MetaVarName<"<name>-<arg>">,
HelpText<"Pass <arg> to plugin <name>">;
def fpass_plugin_EQ : Joined<["-"], "fpass-plugin=">,
- Group<f_Group>, Flags<[CC1Option,FlangOption,FC1Option]>, MetaVarName<"<dsopath>">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+ MetaVarName<"<dsopath>">,
HelpText<"Load pass plugin from a dynamic shared object file (only with new pass manager).">,
MarshallingInfoStringVector<CodeGenOpts<"PassPlugins">>;
defm preserve_as_comments : BoolFOption<"preserve-as-comments",
CodeGenOpts<"PreserveAsmComments">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Do not preserve comments in inline assembly">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Do not preserve comments in inline assembly">,
PosFlag<SetTrue>>;
def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
def frandom_seed_EQ : Joined<["-"], "frandom-seed=">, Group<clang_ignored_f_Group>;
-def freg_struct_return : Flag<["-"], "freg-struct-return">, Group<f_Group>, Flags<[CC1Option]>,
+def freg_struct_return : Flag<["-"], "freg-struct-return">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Override the default ABI to return small structs in registers">;
defm rtti : BoolFOption<"rtti",
LangOpts<"RTTI">, Default<cplusplus.KeyPath>,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable generation of rtti information">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Disable generation of rtti information">,
PosFlag<SetTrue>>, ShouldParseIf<cplusplus.KeyPath>;
defm rtti_data : BoolFOption<"rtti-data",
LangOpts<"RTTIData">, Default<frtti.KeyPath>,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable generation of RTTI data">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Disable generation of RTTI data">,
PosFlag<SetTrue>>, ShouldParseIf<frtti.KeyPath>;
def : Flag<["-"], "fsched-interblock">, Group<clang_ignored_f_Group>;
defm short_enums : BoolFOption<"short-enums",
LangOpts<"ShortEnums">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Allocate to an enum type only as many bytes as it"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Allocate to an enum type only as many bytes as it"
" needs for the declared range of possible values">,
NegFlag<SetFalse>>;
defm char8__t : BoolFOption<"char8_t",
LangOpts<"Char8">, Default<cpp20.KeyPath>,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
- BothFlags<[CC1Option], [ClangOption], " C++ builtin type char8_t">>;
+ BothFlags<[], [ClangOption, CC1Option], " C++ builtin type char8_t">>;
def fshort_wchar : Flag<["-"], "fshort-wchar">, Group<f_Group>,
HelpText<"Force wchar_t to be a short unsigned int">;
def fno_short_wchar : Flag<["-"], "fno-short-wchar">, Group<f_Group>,
HelpText<"Force wchar_t to be an unsigned int">;
-def fshow_overloads_EQ : Joined<["-"], "fshow-overloads=">, Group<f_Group>, Flags<[CC1Option]>,
+def fshow_overloads_EQ : Joined<["-"], "fshow-overloads=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Which overload candidates to show when overload resolution fails. Defaults to 'all'">,
Values<"best,all">,
NormalizedValues<["Ovl_Best", "Ovl_All"]>,
MarshallingInfoEnum<DiagnosticOpts<"ShowOverloads">, "Ovl_All">;
defm show_column : BoolFOption<"show-column",
DiagnosticOpts<"ShowColumn">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Do not include column number on diagnostics">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Do not include column number on diagnostics">,
PosFlag<SetTrue>>;
defm show_source_location : BoolFOption<"show-source-location",
DiagnosticOpts<"ShowLocation">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Do not include source location information with diagnostics">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Do not include source location information with diagnostics">,
PosFlag<SetTrue>>;
defm spell_checking : BoolFOption<"spell-checking",
LangOpts<"SpellChecking">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Disable spell-checking">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option], "Disable spell-checking">,
PosFlag<SetTrue>>;
-def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<f_Group>, Flags<[CC1Option]>,
+def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit)">,
MarshallingInfoInt<DiagnosticOpts<"SpellCheckingLimit">, "DiagnosticOptions::DefaultSpellCheckingLimit">;
def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group<f_Group>;
defm signed_char : BoolFOption<"signed-char",
LangOpts<"CharIsSigned">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "char is unsigned">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option], "char is unsigned">,
PosFlag<SetTrue, [], [ClangOption], "char is signed">>,
ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
defm split_stack : BoolFOption<"split-stack",
CodeGenOpts<"EnableSegmentedStacks">, DefaultFalse,
NegFlag<SetFalse, [], [ClangOption], "Wouldn't use segmented stack">,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use segmented stack">>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use segmented stack">>;
def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
HelpText<"Enable stack protectors for all functions">;
defm stack_clash_protection : BoolFOption<"stack-clash-protection",
CodeGenOpts<"StackClashProtector">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption], " stack clash protection">>,
DocBrief<"Instrument stack allocation to prevent stack clash attacks">;
@@ -3153,65 +3498,86 @@ def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>,
"overwrite the guard value before overwriting the function's return "
"address. The reference stack guard value is stored in a global variable.">;
def ftrivial_auto_var_init : Joined<["-"], "ftrivial-auto-var-init=">, Group<f_Group>,
- Flags<[CC1Option, CoreOption]>, HelpText<"Initialize trivial automatic stack variables. Defaults to 'uninitialized'">,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ HelpText<"Initialize trivial automatic stack variables. Defaults to 'uninitialized'">,
Values<"uninitialized,zero,pattern">,
NormalizedValuesScope<"LangOptions::TrivialAutoVarInitKind">,
NormalizedValues<["Uninitialized", "Zero", "Pattern"]>,
MarshallingInfoEnum<LangOpts<"TrivialAutoVarInit">, "Uninitialized">;
def ftrivial_auto_var_init_stop_after : Joined<["-"], "ftrivial-auto-var-init-stop-after=">, Group<f_Group>,
- Flags<[CC1Option, CoreOption]>, HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
MarshallingInfoInt<LangOpts<"TrivialAutoVarInitStopAfter">>;
-def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
+def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Emit full debug info for all types used by the program">;
-def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CoreOption]>,
+def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Limit debug information produced to reduce size of debug binary">;
-def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Flags<[CoreOption]>, Alias<fno_standalone_debug>;
-def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Flags<[CoreOption]>, Alias<fstandalone_debug>;
-def fdebug_macro : Flag<["-"], "fdebug-macro">, Group<f_Group>, Flags<[CoreOption]>,
+def flimit_debug_info : Flag<["-"], "flimit-debug-info">,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fno_standalone_debug>;
+def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Alias<fstandalone_debug>;
+def fdebug_macro : Flag<["-"], "fdebug-macro">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Emit macro debug information">;
-def fno_debug_macro : Flag<["-"], "fno-debug-macro">, Group<f_Group>, Flags<[CoreOption]>,
+def fno_debug_macro : Flag<["-"], "fno-debug-macro">, Group<f_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Do not emit macro debug information">;
def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group<f_Group>,
- Flags<[NoXarchOption, CoreOption]>;
-def fstrict_enums : Flag<["-"], "fstrict-enums">, Group<f_Group>, Flags<[CC1Option]>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
+def fstrict_enums : Flag<["-"], "fstrict-enums">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable optimizations based on the strict definition of an enum's "
"value range">,
MarshallingInfoFlag<CodeGenOpts<"StrictEnums">>;
defm strict_vtable_pointers : BoolFOption<"strict-vtable-pointers",
CodeGenOpts<"StrictVTablePointers">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable optimizations based on the strict rules for"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable optimizations based on the strict rules for"
" overwriting polymorphic C++ objects">,
NegFlag<SetFalse>>;
def fstrict_overflow : Flag<["-"], "fstrict-overflow">, Group<f_Group>;
-def fdriver_only : Flag<["-"], "fdriver-only">, Flags<[NoXarchOption, CoreOption]>,
+def fdriver_only : Flag<["-"], "fdriver-only">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
Group<Action_Group>, HelpText<"Only run the driver.">;
def fsyntax_only : Flag<["-"], "fsyntax-only">,
- Flags<[NoXarchOption,CoreOption,CC1Option,FC1Option,FlangOption]>, Group<Action_Group>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FC1Option, FlangOption]>,
+ Group<Action_Group>,
HelpText<"Run the preprocessor, parser and semantic analysis stages">;
def ftabstop_EQ : Joined<["-"], "ftabstop=">, Group<f_Group>;
-def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group<f_Group>, Flags<[CC1Option]>,
+def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the maximum depth of recursive template instantiation">,
MarshallingInfoInt<LangOpts<"InstantiationDepth">, "1024">;
def : Joined<["-"], "ftemplate-depth-">, Group<f_Group>, Alias<ftemplate_depth_EQ>;
-def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">, Group<f_Group>, Flags<[CC1Option]>,
+def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit)">,
MarshallingInfoInt<DiagnosticOpts<"TemplateBacktraceLimit">, "DiagnosticOptions::DefaultTemplateBacktraceLimit">;
-def foperator_arrow_depth_EQ : Joined<["-"], "foperator-arrow-depth=">, Group<f_Group>, Flags<[CC1Option]>,
+def foperator_arrow_depth_EQ : Joined<["-"], "foperator-arrow-depth=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Maximum number of 'operator->'s to call for a member access">,
MarshallingInfoInt<LangOpts<"ArrowDepth">, "256">;
-def fsave_optimization_record : Flag<["-"], "fsave-optimization-record">, Flags<[FlangOption]>,
+def fsave_optimization_record : Flag<["-"], "fsave-optimization-record">,
+ Visibility<[ClangOption, FlangOption]>,
Group<f_Group>, HelpText<"Generate a YAML optimization record file">;
-def fsave_optimization_record_EQ : Joined<["-"], "fsave-optimization-record=">, Flags<[FlangOption]>,
+def fsave_optimization_record_EQ : Joined<["-"], "fsave-optimization-record=">,
+ Visibility<[ClangOption, FlangOption]>,
Group<f_Group>, HelpText<"Generate an optimization record file in a specific format">,
MetaVarName<"<format>">;
def fno_save_optimization_record : Flag<["-"], "fno-save-optimization-record">,
- Group<f_Group>, Flags<[FlangOption, NoArgumentUnused]>;
-def foptimization_record_file_EQ : Joined<["-"], "foptimization-record-file=">, Flags<[FlangOption]>,
+ Group<f_Group>, Flags<[NoArgumentUnused]>,
+ Visibility<[ClangOption, FlangOption]>;
+def foptimization_record_file_EQ : Joined<["-"], "foptimization-record-file=">,
+ Visibility<[ClangOption, FlangOption]>,
Group<f_Group>,
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.">,
MetaVarName<"<file>">;
-def foptimization_record_passes_EQ : Joined<["-"], "foptimization-record-passes=">, Flags<[FlangOption]>,
+def foptimization_record_passes_EQ : Joined<["-"], "foptimization-record-passes=">,
+ Visibility<[ClangOption, FlangOption]>,
Group<f_Group>,
HelpText<"Only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)">,
MetaVarName<"<regex>">;
@@ -3229,7 +3595,8 @@ def : Flag<["-"], "fno-tree-slp-vectorize">, Alias<fno_slp_vectorize>;
def Wlarge_by_value_copy_def : Flag<["-"], "Wlarge-by-value-copy">,
HelpText<"Warn if a function definition returns or accepts an object larger "
"in bytes than a given value">, Flags<[HelpHidden]>;
-def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">, Flags<[CC1Option]>,
+def Wlarge_by_value_copy_EQ : Joined<["-"], "Wlarge-by-value-copy=">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoInt<LangOpts<"NumLargeByValueCopy">>;
// These "special" warning flags are effectively processed as f_Group flags by the driver:
@@ -3240,18 +3607,21 @@ def Wlarger_than_ : Joined<["-"], "Wlarger-than-">, Alias<Wlarger_than_EQ>;
// This is converted to -fwarn-stack-size=N and also passed through by the driver.
// FIXME: The driver should strip out the =<value> when passing W_value_Group through.
def Wframe_larger_than_EQ : Joined<["-"], "Wframe-larger-than=">, Group<W_value_Group>,
- Flags<[NoXarchOption, CC1Option]>;
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>;
def Wframe_larger_than : Flag<["-"], "Wframe-larger-than">, Alias<Wframe_larger_than_EQ>;
def : Flag<["-"], "fterminated-vtables">, Alias<fapple_kext>;
defm threadsafe_statics : BoolFOption<"threadsafe-statics",
LangOpts<"ThreadsafeStatics">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Do not emit code to make initialization of local statics thread safe">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Do not emit code to make initialization of local statics thread safe">,
PosFlag<SetTrue>>;
-def ftime_report : Flag<["-"], "ftime-report">, Group<f_Group>, Flags<[CC1Option]>,
+def ftime_report : Flag<["-"], "ftime-report">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<CodeGenOpts<"TimePasses">>;
def ftime_report_EQ: Joined<["-"], "ftime-report=">, Group<f_Group>,
- Flags<[CC1Option]>, Values<"per-pass,per-pass-run">,
+ Visibility<[ClangOption, CC1Option]>, Values<"per-pass,per-pass-run">,
MarshallingInfoFlag<CodeGenOpts<"TimePassesPerRun">>,
HelpText<"(For new pass manager) 'per-pass': one report for each pass; "
"'per-pass-run': one report for each pass invocation">;
@@ -3261,62 +3631,69 @@ def ftime_trace : Flag<["-"], "ftime-trace">, Group<f_Group>,
Turn on time profiler. Generates JSON file based on output filename. Results
can be analyzed with chrome://tracing or `Speedscope App
<https://www.speedscope.app>`_ for flamegraph visualization.}]>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def ftime_trace_granularity_EQ : Joined<["-"], "ftime-trace-granularity=">, Group<f_Group>,
HelpText<"Minimum time granularity (in microseconds) traced by time profiler">,
- Flags<[CC1Option, CoreOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
MarshallingInfoInt<FrontendOpts<"TimeTraceGranularity">, "500u">;
def ftime_trace_EQ : Joined<["-"], "ftime-trace=">, Group<f_Group>,
HelpText<"Similar to -ftime-trace. Specify the JSON file or a directory which will contain the JSON file">,
- Flags<[CC1Option, CoreOption]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
MarshallingInfoString<FrontendOpts<"TimeTracePath">>;
def fproc_stat_report : Joined<["-"], "fproc-stat-report">, Group<f_Group>,
HelpText<"Print subprocess statistics">;
def fproc_stat_report_EQ : Joined<["-"], "fproc-stat-report=">, Group<f_Group>,
HelpText<"Save subprocess statistics to the given file">;
-def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group<f_Group>, Flags<[CC1Option]>,
+def ftlsmodel_EQ : Joined<["-"], "ftls-model=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
Values<"global-dynamic,local-dynamic,initial-exec,local-exec">,
NormalizedValuesScope<"CodeGenOptions">,
NormalizedValues<["GeneralDynamicTLSModel", "LocalDynamicTLSModel", "InitialExecTLSModel", "LocalExecTLSModel"]>,
MarshallingInfoEnum<CodeGenOpts<"DefaultTLSModel">, "GeneralDynamicTLSModel">;
-def ftrapv : Flag<["-"], "ftrapv">, Group<f_Group>, Flags<[CC1Option]>,
+def ftrapv : Flag<["-"], "ftrapv">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Trap on integer overflow">;
def ftrapv_handler_EQ : Joined<["-"], "ftrapv-handler=">, Group<f_Group>,
MetaVarName<"<function name>">,
HelpText<"Specify the function to be called on overflow">;
-def ftrapv_handler : Separate<["-"], "ftrapv-handler">, Group<f_Group>, Flags<[CC1Option]>;
-def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>, Flags<[CC1Option]>,
+def ftrapv_handler : Separate<["-"], "ftrapv-handler">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>;
+def ftrap_function_EQ : Joined<["-"], "ftrap-function=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Issue call to specified function rather than a trap instruction">,
MarshallingInfoString<CodeGenOpts<"TrapFuncName">>;
def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
- HelpText<"Turn on loop unroller">, Flags<[CC1Option]>;
+ HelpText<"Turn on loop unroller">, Visibility<[ClangOption, CC1Option]>;
def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<f_Group>,
- HelpText<"Turn off loop unroller">, Flags<[CC1Option]>;
+ HelpText<"Turn off loop unroller">, Visibility<[ClangOption, CC1Option]>;
defm reroll_loops : BoolFOption<"reroll-loops",
CodeGenOpts<"RerollLoops">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Turn on loop reroller">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Turn on loop reroller">,
NegFlag<SetFalse>>;
def ffinite_loops: Flag<["-"], "ffinite-loops">, Group<f_Group>,
- HelpText<"Assume all loops are finite.">, Flags<[CC1Option]>;
+ HelpText<"Assume all loops are finite.">, Visibility<[ClangOption, CC1Option]>;
def fno_finite_loops: Flag<["-"], "fno-finite-loops">, Group<f_Group>,
- HelpText<"Do not assume that any loop is finite.">, Flags<[CC1Option]>;
+ HelpText<"Do not assume that any loop is finite.">,
+ Visibility<[ClangOption, CC1Option]>;
def ftrigraphs : Flag<["-"], "ftrigraphs">, Group<f_Group>,
- HelpText<"Process trigraph sequences">, Flags<[CC1Option]>;
+ HelpText<"Process trigraph sequences">, Visibility<[ClangOption, CC1Option]>;
def fno_trigraphs : Flag<["-"], "fno-trigraphs">, Group<f_Group>,
- HelpText<"Do not process trigraph sequences">, Flags<[CC1Option]>;
+ HelpText<"Do not process trigraph sequences">,
+ Visibility<[ClangOption, CC1Option]>;
def funsigned_bitfields : Flag<["-"], "funsigned-bitfields">, Group<f_Group>;
def funsigned_char : Flag<["-"], "funsigned-char">, Group<f_Group>;
def fno_unsigned_char : Flag<["-"], "fno-unsigned-char">;
def funwind_tables : Flag<["-"], "funwind-tables">, Group<f_Group>;
defm register_global_dtors_with_atexit : BoolFOption<"register-global-dtors-with-atexit",
CodeGenOpts<"RegisterGlobalDtorsWithAtExit">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
NegFlag<SetFalse, [], [ClangOption], "Don't use">,
BothFlags<[], [ClangOption], " atexit or __cxa_atexit to register global destructors">>;
defm use_init_array : BoolFOption<"use-init-array",
CodeGenOpts<"UseInitArray">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Use .ctors/.dtors instead of .init_array/.fini_array">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Use .ctors/.dtors instead of .init_array/.fini_array">,
PosFlag<SetTrue>>;
def fno_var_tracking : Flag<["-"], "fno-var-tracking">, Group<clang_ignored_f_Group>;
def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>,
@@ -3324,143 +3701,170 @@ def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>,
def dA : Flag<["-"], "dA">, Alias<fverbose_asm>;
defm visibility_from_dllstorageclass : BoolFOption<"visibility-from-dllstorageclass",
LangOpts<"VisibilityFromDLLStorageClass">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Set the visibility of symbols in the generated code from their DLL storage class">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Set the visibility of symbols in the generated code from their DLL storage class">,
NegFlag<SetFalse>>;
-def fvisibility_dllexport_EQ : Joined<["-"], "fvisibility-dllexport=">, Group<f_Group>, Flags<[CC1Option]>,
+def fvisibility_dllexport_EQ : Joined<["-"], "fvisibility-dllexport=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"The visibility for dllexport definitions [-fvisibility-from-dllstorageclass]">,
MarshallingInfoVisibility<LangOpts<"DLLExportVisibility">, "DefaultVisibility">,
ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
-def fvisibility_nodllstorageclass_EQ : Joined<["-"], "fvisibility-nodllstorageclass=">, Group<f_Group>, Flags<[CC1Option]>,
+def fvisibility_nodllstorageclass_EQ : Joined<["-"], "fvisibility-nodllstorageclass=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"The visibility for definitions without an explicit DLL export class [-fvisibility-from-dllstorageclass]">,
MarshallingInfoVisibility<LangOpts<"NoDLLStorageClassVisibility">, "HiddenVisibility">,
ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
-def fvisibility_externs_dllimport_EQ : Joined<["-"], "fvisibility-externs-dllimport=">, Group<f_Group>, Flags<[CC1Option]>,
+def fvisibility_externs_dllimport_EQ : Joined<["-"], "fvisibility-externs-dllimport=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"The visibility for dllimport external declarations [-fvisibility-from-dllstorageclass]">,
MarshallingInfoVisibility<LangOpts<"ExternDeclDLLImportVisibility">, "DefaultVisibility">,
ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
-def fvisibility_externs_nodllstorageclass_EQ : Joined<["-"], "fvisibility-externs-nodllstorageclass=">, Group<f_Group>, Flags<[CC1Option]>,
+def fvisibility_externs_nodllstorageclass_EQ : Joined<["-"], "fvisibility-externs-nodllstorageclass=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"The visibility for external declarations without an explicit DLL dllstorageclass [-fvisibility-from-dllstorageclass]">,
MarshallingInfoVisibility<LangOpts<"ExternDeclNoDLLStorageClassVisibility">, "HiddenVisibility">,
ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
-def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>, Flags<[CC1Option]>,
+def fvisibility_EQ : Joined<["-"], "fvisibility=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the default symbol visibility for all global definitions">,
MarshallingInfoVisibility<LangOpts<"ValueVisibilityMode">, "DefaultVisibility">;
defm visibility_inlines_hidden : BoolFOption<"visibility-inlines-hidden",
LangOpts<"InlineVisibilityHidden">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Give inline C++ member functions hidden visibility by default">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Give inline C++ member functions hidden visibility by default">,
NegFlag<SetFalse>>;
defm visibility_inlines_hidden_static_local_var : BoolFOption<"visibility-inlines-hidden-static-local-var",
LangOpts<"VisibilityInlinesHiddenStaticLocalVar">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "When -fvisibility-inlines-hidden is enabled, static variables in"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "When -fvisibility-inlines-hidden is enabled, static variables in"
" inline C++ member functions will also be given hidden visibility by default">,
NegFlag<SetFalse, [], [ClangOption], "Disables -fvisibility-inlines-hidden-static-local-var"
- " (this is the default on non-darwin targets)">, BothFlags<[CC1Option]>>;
+ " (this is the default on non-darwin targets)">, BothFlags<
+ [], [ClangOption, CC1Option]>>;
def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group<f_Group>,
HelpText<"Give global types 'default' visibility and global functions and "
"variables 'hidden' visibility by default">;
def fvisibility_global_new_delete_hidden : Flag<["-"], "fvisibility-global-new-delete-hidden">, Group<f_Group>,
- HelpText<"Give global C++ operator new and delete declarations hidden visibility">, Flags<[CC1Option]>,
+ HelpText<"Give global C++ operator new and delete declarations hidden visibility">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<LangOpts<"GlobalAllocationFunctionVisibilityHidden">>;
def mdefault_visibility_export_mapping_EQ : Joined<["-"], "mdefault-visibility-export-mapping=">,
Values<"none,explicit,all">,
NormalizedValuesScope<"LangOptions::DefaultVisiblityExportMapping">,
NormalizedValues<["None", "Explicit", "All"]>,
HelpText<"Mapping between default visibility and export">,
- Group<m_Group>, Flags<[CC1Option,TargetSpecific]>,
+ Group<m_Group>, Flags<[TargetSpecific]>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoEnum<LangOpts<"DefaultVisibilityExportMapping">,"None">;
defm new_infallible : BoolFOption<"new-infallible",
LangOpts<"NewInfallible">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
- BothFlags<[CC1Option], [ClangOption], " treating throwing global C++ operator new as always returning valid memory "
+ BothFlags<[], [ClangOption, CC1Option],
+ " treating throwing global C++ operator new as always returning valid memory "
"(annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.">>;
defm whole_program_vtables : BoolFOption<"whole-program-vtables",
CodeGenOpts<"WholeProgramVTables">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enables whole-program vtable optimization. Requires -flto">,
- NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enables whole-program vtable optimization. Requires -flto">,
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
defm split_lto_unit : BoolFOption<"split-lto-unit",
CodeGenOpts<"EnableSplitLTOUnit">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enables splitting of the LTO unit">,
- NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enables splitting of the LTO unit">,
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
defm force_emit_vtables : BoolFOption<"force-emit-vtables",
CodeGenOpts<"ForceEmitVTables">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Emits more virtual tables to improve devirtualization">,
- NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Emits more virtual tables to improve devirtualization">,
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
DocBrief<[{In order to improve devirtualization, forces emitting of vtables even in
modules where it isn't necessary. It causes more inline virtual functions
to be emitted.}]>;
defm virtual_function_elimination : BoolFOption<"virtual-function-elimination",
CodeGenOpts<"VirtualFunctionElimination">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enables dead virtual function elimination optimization. Requires -flto=full">,
- NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enables dead virtual function elimination optimization. Requires -flto=full">,
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
-def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>, Flags<[CC1Option]>,
+def fwrapv : Flag<["-"], "fwrapv">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Treat signed integer overflow as two's complement">;
-def fwritable_strings : Flag<["-"], "fwritable-strings">, Group<f_Group>, Flags<[CC1Option]>,
+def fwritable_strings : Flag<["-"], "fwritable-strings">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Store string literals as writable data">,
MarshallingInfoFlag<LangOpts<"WritableStrings">>;
defm zero_initialized_in_bss : BoolFOption<"zero-initialized-in-bss",
CodeGenOpts<"NoZeroInitializedInBSS">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption], "Don't place zero initialized data in BSS">,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Don't place zero initialized data in BSS">,
PosFlag<SetFalse>>;
defm function_sections : BoolFOption<"function-sections",
CodeGenOpts<"FunctionSections">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Place each function in its own section">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Place each function in its own section">,
NegFlag<SetFalse>>;
def fbasic_block_sections_EQ : Joined<["-"], "fbasic-block-sections=">, Group<f_Group>,
- Flags<[CC1Option, CC1AsOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption]>,
HelpText<"Place each function's basic blocks in unique sections (ELF Only)">,
DocBrief<[{Generate labels for each basic block or place each basic block or a subset of basic blocks in its own section.}]>,
Values<"all,labels,none,list=">,
MarshallingInfoString<CodeGenOpts<"BBSections">, [{"none"}]>;
defm data_sections : BoolFOption<"data-sections",
CodeGenOpts<"DataSections">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Place each data in its own section">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Place each data in its own section">,
NegFlag<SetFalse>>;
defm stack_size_section : BoolFOption<"stack-size-section",
CodeGenOpts<"StackSizeSection">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Emit section containing metadata on function stack sizes">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Emit section containing metadata on function stack sizes">,
NegFlag<SetFalse>>;
def fstack_usage : Flag<["-"], "fstack-usage">, Group<f_Group>,
HelpText<"Emit .su file containing information on function stack sizes">;
def stack_usage_file : Separate<["-"], "stack-usage-file">,
- Flags<[CC1Option, NoDriverOption]>,
+ Visibility<[CC1Option]>,
HelpText<"Filename (or -) to write stack usage output to">,
MarshallingInfoString<CodeGenOpts<"StackUsageOutput">>;
defm unique_basic_block_section_names : BoolFOption<"unique-basic-block-section-names",
CodeGenOpts<"UniqueBasicBlockSectionNames">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use unique names for basic block sections (ELF Only)">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use unique names for basic block sections (ELF Only)">,
NegFlag<SetFalse>>;
defm unique_internal_linkage_names : BoolFOption<"unique-internal-linkage-names",
CodeGenOpts<"UniqueInternalLinkageNames">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Uniqueify Internal Linkage Symbol Names by appending"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Uniqueify Internal Linkage Symbol Names by appending"
" the MD5 hash of the module path">,
NegFlag<SetFalse>>;
defm unique_section_names : BoolFOption<"unique-section-names",
CodeGenOpts<"UniqueSectionNames">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Don't use unique names for text and data sections">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Don't use unique names for text and data sections">,
PosFlag<SetTrue>>;
defm split_machine_functions: BoolFOption<"split-machine-functions",
CodeGenOpts<"SplitMachineFunctions">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
BothFlags<[], [ClangOption], " late function splitting using profile information (x86 ELF)">>;
defm strict_return : BoolFOption<"strict-return",
CodeGenOpts<"StrictReturn">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Don't treat control flow paths that fall off the end"
+ NegFlag<SetFalse, [], [ClangOption, CC1Option],
+ "Don't treat control flow paths that fall off the end"
" of a non-void function as unreachable">,
PosFlag<SetTrue>>;
def fenable_matrix : Flag<["-"], "fenable-matrix">, Group<f_Group>,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable matrix data type and related builtin functions">,
MarshallingInfoFlag<LangOpts<"MatrixTypes">>;
def fzero_call_used_regs_EQ
- : Joined<["-"], "fzero-call-used-regs=">, Group<f_Group>, Flags<[CC1Option]>,
+ : Joined<["-"], "fzero-call-used-regs=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Clear call-used registers upon function return (AArch64/x86 only)">,
Values<"skip,used-gpr-arg,used-gpr,used-arg,used,all-gpr-arg,all-gpr,all-arg,all">,
NormalizedValues<["Skip", "UsedGPRArg", "UsedGPR", "UsedArg", "Used",
@@ -3473,24 +3877,26 @@ def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group<f_Group>;
defm debug_ranges_base_address : BoolFOption<"debug-ranges-base-address",
CodeGenOpts<"DebugRangesBaseAddress">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use DWARF base address selection entries in .debug_ranges">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Use DWARF base address selection entries in .debug_ranges">,
NegFlag<SetFalse>>;
defm split_dwarf_inlining : BoolFOption<"split-dwarf-inlining",
CodeGenOpts<"SplitDwarfInlining">, DefaultFalse,
NegFlag<SetFalse, [], [ClangOption]>,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Provide minimal debug info in the object/executable"
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Provide minimal debug info in the object/executable"
" to facilitate online symbolication/stack traces in the absence of"
" .dwo/.dwp files when using Split DWARF">>;
def fdebug_default_version: Joined<["-"], "fdebug-default-version=">, Group<f_Group>,
HelpText<"Default DWARF version to use, if a -g option caused DWARF debug info to be produced">;
def fdebug_prefix_map_EQ
: Joined<["-"], "fdebug-prefix-map=">, Group<f_Group>,
- Flags<[CC1Option,CC1AsOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption]>,
MetaVarName<"<old>=<new>">,
HelpText<"For paths in debug info, remap directory <old> to <new>. If multiple options match a path, the last option wins">;
def fcoverage_prefix_map_EQ
: Joined<["-"], "fcoverage-prefix-map=">, Group<f_Group>,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
MetaVarName<"<old>=<new>">,
HelpText<"remap file source paths <old> to <new> in coverage mapping. If there are multiple options, prefix replacement is applied in reverse order starting from the last one">;
def ffile_prefix_map_EQ
@@ -3498,15 +3904,17 @@ def ffile_prefix_map_EQ
HelpText<"remap file source paths in debug info, predefined preprocessor "
"macros and __builtin_FILE(). Implies -ffile-reproducible.">;
def fmacro_prefix_map_EQ
- : Joined<["-"], "fmacro-prefix-map=">, Group<f_Group>, Flags<[CC1Option]>,
+ : Joined<["-"], "fmacro-prefix-map=">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"remap file source paths in predefined preprocessor macros and "
"__builtin_FILE(). Implies -ffile-reproducible.">;
defm force_dwarf_frame : BoolFOption<"force-dwarf-frame",
CodeGenOpts<"ForceDwarfFrameSection">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Always emit a debug frame section">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Always emit a debug frame section">,
NegFlag<SetFalse>>;
def femit_dwarf_unwind_EQ : Joined<["-"], "femit-dwarf-unwind=">,
- Group<f_Group>, Flags<[CC1Option, CC1AsOption]>,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option, CC1AsOption]>,
HelpText<"When to emit DWARF unwind (EH frame) info">,
Values<"always,no-compact-unwind,default">,
NormalizedValues<["Always", "NoCompactUnwind", "Default"]>,
@@ -3514,14 +3922,18 @@ def femit_dwarf_unwind_EQ : Joined<["-"], "femit-dwarf-unwind=">,
MarshallingInfoEnum<CodeGenOpts<"EmitDwarfUnwind">, "Default">;
defm emit_compact_unwind_non_canonical : BoolFOption<"emit-compact-unwind-non-canonical",
CodeGenOpts<"EmitCompactUnwindNonCanonical">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option, CC1AsOption], [ClangOption], "Try emitting Compact-Unwind for non-canonical entries. Maybe overriden by other constraints">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option, CC1AsOption],
+ "Try emitting Compact-Unwind for non-canonical entries. Maybe overriden by other constraints">,
NegFlag<SetFalse>>;
def g_Flag : Flag<["-"], "g">, Group<g_Group>,
- Flags<[CoreOption,FlangOption]>, HelpText<"Generate source-level debug information">;
+ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
+ HelpText<"Generate source-level debug information">;
def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<gN_Group>,
- Flags<[CoreOption,FlangOption]>, HelpText<"Emit debug line number tables only">;
+ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
+ HelpText<"Emit debug line number tables only">;
def gline_directives_only : Flag<["-"], "gline-directives-only">, Group<gN_Group>,
- Flags<[CoreOption]>, HelpText<"Emit debug line info directives only">;
+ Visibility<[ClangOption, CLOption, DXCOption]>,
+ HelpText<"Emit debug line info directives only">;
def gmlt : Flag<["-"], "gmlt">, Alias<gline_tables_only>;
def g0 : Flag<["-"], "g0">, Group<gN_Group>;
def g1 : Flag<["-"], "g1">, Group<gN_Group>, Alias<gline_tables_only>;
@@ -3537,7 +3949,8 @@ def gsce : Flag<["-"], "gsce">, Group<gTune_Group>;
def gdbx : Flag<["-"], "gdbx">, Group<gTune_Group>;
// Equivalent to our default dwarf version. Forces usual dwarf emission when
// CodeView is enabled.
-def gdwarf : Flag<["-"], "gdwarf">, Group<g_Group>, Flags<[CoreOption]>,
+def gdwarf : Flag<["-"], "gdwarf">, Group<g_Group>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Generate source-level debug information with the default dwarf version">;
def gdwarf_2 : Flag<["-"], "gdwarf-2">, Group<g_Group>,
HelpText<"Generate source-level debug information with dwarf version 2">;
@@ -3548,30 +3961,32 @@ def gdwarf_4 : Flag<["-"], "gdwarf-4">, Group<g_Group>,
def gdwarf_5 : Flag<["-"], "gdwarf-5">, Group<g_Group>,
HelpText<"Generate source-level debug information with dwarf version 5">;
def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>,
- Flags<[CC1Option, CC1AsOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption]>,
HelpText<"Enables DWARF64 format for ELF binaries, if debug information emission is enabled.">,
MarshallingInfoFlag<CodeGenOpts<"Dwarf64">>;
def gdwarf32 : Flag<["-"], "gdwarf32">, Group<g_Group>,
- Flags<[CC1Option, CC1AsOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption]>,
HelpText<"Enables DWARF32 format for ELF binaries, if debug information emission is enabled.">;
def gcodeview : Flag<["-"], "gcodeview">,
HelpText<"Generate CodeView debug information">,
- Flags<[CC1Option, CC1AsOption, CoreOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
MarshallingInfoFlag<CodeGenOpts<"EmitCodeView">>;
defm codeview_ghash : BoolOption<"g", "codeview-ghash",
CodeGenOpts<"CodeViewGHash">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Emit type record hashes in a .debug$H section">,
- NegFlag<SetFalse>, BothFlags<[CoreOption]>>;
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Emit type record hashes in a .debug$H section">,
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
defm codeview_command_line : BoolOption<"g", "codeview-command-line",
CodeGenOpts<"CodeViewCommandLine">, DefaultTrue,
PosFlag<SetTrue, [], [ClangOption], "Emit compiler path and command line into CodeView debug information">,
NegFlag<SetFalse, [], [ClangOption], "Don't emit compiler path and command line into CodeView debug information">,
- BothFlags<[CoreOption, CC1Option]>>;
+ BothFlags<[], [ClangOption, CLOption, DXCOption, CC1Option]>>;
defm inline_line_tables : BoolGOption<"inline-line-tables",
CodeGenOpts<"NoInlineLineTables">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option], [ClangOption], "Don't emit inline line tables.">,
- PosFlag<SetFalse>, BothFlags<[CoreOption]>>;
+ NegFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Don't emit inline line tables.">,
+ PosFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>;
def gfull : Flag<["-"], "gfull">, Group<g_Group>;
def gused : Flag<["-"], "gused">, Group<g_Group>;
@@ -3588,39 +4003,43 @@ def : Flag<["-"], "grecord-gcc-switches">, Alias<grecord_command_line>;
def : Flag<["-"], "gno-record-gcc-switches">, Alias<gno_record_command_line>;
defm strict_dwarf : BoolOption<"g", "strict-dwarf",
CodeGenOpts<"DebugStrictDwarf">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Restrict DWARF features to those defined in "
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Restrict DWARF features to those defined in "
"the specified version, avoiding features from later versions.">,
- NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
Group<g_flags_Group>;
defm column_info : BoolOption<"g", "column-info",
CodeGenOpts<"DebugColumnInfo">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption]>,
- PosFlag<SetTrue>, BothFlags<[CoreOption]>>,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option]>,
+ PosFlag<SetTrue>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
Group<g_flags_Group>;
def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group<g_flags_Group>,
- Flags<[CoreOption]>, HelpText<"Set DWARF fission mode">,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
+ HelpText<"Set DWARF fission mode">,
Values<"split,single">;
def gno_split_dwarf : Flag<["-"], "gno-split-dwarf">, Group<g_flags_Group>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def gsimple_template_names : Flag<["-"], "gsimple-template-names">, Group<g_flags_Group>;
def gsimple_template_names_EQ
: Joined<["-"], "gsimple-template-names=">,
HelpText<"Use simple template names in DWARF, or include the full "
"template name with a modified prefix for validation">,
- Values<"simple,mangled">, Flags<[CC1Option, NoDriverOption]>;
+ Values<"simple,mangled">, Visibility<[CC1Option]>;
def gsrc_hash_EQ : Joined<["-"], "gsrc-hash=">,
- Group<g_flags_Group>, Flags<[CC1Option, NoDriverOption]>,
+ Group<g_flags_Group>, Visibility<[CC1Option]>,
Values<"md5,sha1,sha256">,
NormalizedValues<["DSH_MD5", "DSH_SHA1", "DSH_SHA256"]>,
NormalizedValuesScope<"CodeGenOptions">,
MarshallingInfoEnum<CodeGenOpts<"DebugSrcHash">, "DSH_MD5">;
def gno_simple_template_names : Flag<["-"], "gno-simple-template-names">,
Group<g_flags_Group>;
-def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
+def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>,
+ Visibility<[ClangOption, CC1Option]>;
def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>;
-def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
+def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>,
+ Visibility<[ClangOption, CC1Option]>;
def gno_pubnames : Flag<["-"], "gno-pubnames">, Group<g_flags_Group>;
def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group<g_flags_Group>;
def gmodules : Flag <["-"], "gmodules">, Group<gN_Group>,
@@ -3630,7 +4049,8 @@ def gno_modules : Flag <["-"], "gno-modules">, Group<g_flags_Group>;
def gz_EQ : Joined<["-"], "gz=">, Group<g_flags_Group>,
HelpText<"DWARF debug sections compression type">;
def gz : Flag<["-"], "gz">, Alias<gz_EQ>, AliasArgs<["zlib"]>, Group<g_flags_Group>;
-def gembed_source : Flag<["-"], "gembed-source">, Group<g_flags_Group>, Flags<[CC1Option]>,
+def gembed_source : Flag<["-"], "gembed-source">, Group<g_flags_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Embed source text in DWARF debug sections">,
MarshallingInfoFlag<CodeGenOpts<"EmbedSource">>;
def gno_embed_source : Flag<["-"], "gno-embed-source">, Group<g_flags_Group>,
@@ -3638,65 +4058,79 @@ def gno_embed_source : Flag<["-"], "gno-embed-source">, Group<g_flags_Group>,
HelpText<"Restore the default behavior of not embedding source text in DWARF debug sections">;
def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">;
def help : Flag<["-", "--"], "help">,
- Flags<[CC1Option, CC1AsOption, FC1Option, FlangOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, FC1Option, FlangOption]>,
HelpText<"Display available options">,
MarshallingInfoFlag<FrontendOpts<"ShowHelp">>;
def ibuiltininc : Flag<["-"], "ibuiltininc">, Group<clang_i_Group>,
HelpText<"Enable builtin #include directories even when -nostdinc is used "
"before or after -ibuiltininc. "
"Using -nobuiltininc after the option disables it">;
-def index_header_map : Flag<["-"], "index-header-map">, Flags<[CC1Option]>,
+def index_header_map : Flag<["-"], "index-header-map">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Make the next included directory (-I or -F) an indexer header map">;
-def idirafter : JoinedOrSeparate<["-"], "idirafter">, Group<clang_i_Group>, Flags<[CC1Option]>,
+def idirafter : JoinedOrSeparate<["-"], "idirafter">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Add directory to AFTER include search path">;
-def iframework : JoinedOrSeparate<["-"], "iframework">, Group<clang_i_Group>, Flags<[CC1Option]>,
+def iframework : JoinedOrSeparate<["-"], "iframework">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Add directory to SYSTEM framework search path">;
def iframeworkwithsysroot : JoinedOrSeparate<["-"], "iframeworkwithsysroot">,
Group<clang_i_Group>,
HelpText<"Add directory to SYSTEM framework search path, "
"absolute paths are relative to -isysroot">,
- MetaVarName<"<directory>">, Flags<[CC1Option]>;
-def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>, Flags<[CC1Option]>,
+ MetaVarName<"<directory>">, Visibility<[ClangOption, CC1Option]>;
+def imacros : JoinedOrSeparate<["-", "--"], "imacros">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Include macros from file before parsing">, MetaVarName<"<file>">,
MarshallingInfoStringVector<PreprocessorOpts<"MacroIncludes">>;
def image__base : Separate<["-"], "image_base">;
def include_ : JoinedOrSeparate<["-", "--"], "include">, Group<clang_i_Group>, EnumName<"include">,
- MetaVarName<"<file>">, HelpText<"Include file before parsing">, Flags<[CC1Option]>;
-def include_pch : Separate<["-"], "include-pch">, Group<clang_i_Group>, Flags<[CC1Option]>,
+ MetaVarName<"<file>">, HelpText<"Include file before parsing">,
+ Visibility<[ClangOption, CC1Option]>;
+def include_pch : Separate<["-"], "include-pch">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Include precompiled header file">, MetaVarName<"<file>">,
MarshallingInfoString<PreprocessorOpts<"ImplicitPCHInclude">>;
-def relocatable_pch : Flag<["-", "--"], "relocatable-pch">, Flags<[CC1Option]>,
+def relocatable_pch : Flag<["-", "--"], "relocatable-pch">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Whether to build a relocatable precompiled header">,
MarshallingInfoFlag<FrontendOpts<"RelocatablePCH">>;
-def verify_pch : Flag<["-"], "verify-pch">, Group<Action_Group>, Flags<[CC1Option]>,
+def verify_pch : Flag<["-"], "verify-pch">, Group<Action_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Load and verify that a pre-compiled header file is not stale">;
def init : Separate<["-"], "init">;
def install__name : Separate<["-"], "install_name">;
-def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>, Flags<[CC1Option]>,
+def iprefix : JoinedOrSeparate<["-"], "iprefix">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">, MetaVarName<"<dir>">;
-def iquote : JoinedOrSeparate<["-"], "iquote">, Group<clang_i_Group>, Flags<[CC1Option]>,
+def iquote : JoinedOrSeparate<["-"], "iquote">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Add directory to QUOTE include search path">, MetaVarName<"<directory>">;
-def isysroot : JoinedOrSeparate<["-"], "isysroot">, Group<clang_i_Group>, Flags<[CC1Option]>,
+def isysroot : JoinedOrSeparate<["-"], "isysroot">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the system root directory (usually /)">, MetaVarName<"<dir>">,
MarshallingInfoString<HeaderSearchOpts<"Sysroot">, [{"/"}]>;
def isystem : JoinedOrSeparate<["-"], "isystem">, Group<clang_i_Group>,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Add directory to SYSTEM include search path">, MetaVarName<"<directory>">;
def isystem_after : JoinedOrSeparate<["-"], "isystem-after">,
Group<clang_i_Group>, Flags<[NoXarchOption]>, MetaVarName<"<directory>">,
HelpText<"Add directory to end of the SYSTEM include search path">;
def iwithprefixbefore : JoinedOrSeparate<["-"], "iwithprefixbefore">, Group<clang_i_Group>,
HelpText<"Set directory to include search path with prefix">, MetaVarName<"<dir>">,
- Flags<[CC1Option]>;
-def iwithprefix : JoinedOrSeparate<["-"], "iwithprefix">, Group<clang_i_Group>, Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>;
+def iwithprefix : JoinedOrSeparate<["-"], "iwithprefix">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set directory to SYSTEM include search path with prefix">, MetaVarName<"<dir>">;
def iwithsysroot : JoinedOrSeparate<["-"], "iwithsysroot">, Group<clang_i_Group>,
HelpText<"Add directory to SYSTEM include search path, "
"absolute paths are relative to -isysroot">, MetaVarName<"<directory>">,
- Flags<[CC1Option]>;
-def ivfsoverlay : JoinedOrSeparate<["-"], "ivfsoverlay">, Group<clang_i_Group>, Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>;
+def ivfsoverlay : JoinedOrSeparate<["-"], "ivfsoverlay">, Group<clang_i_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Overlay the virtual filesystem described by file over the real file system">;
-def vfsoverlay : JoinedOrSeparate<["-", "--"], "vfsoverlay">, Flags<[CC1Option, CoreOption]>,
+def vfsoverlay : JoinedOrSeparate<["-", "--"], "vfsoverlay">,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Overlay the virtual filesystem described by file over the real file system. "
"Additionally, pass this overlay file to the linker if it supports it">;
def imultilib : Separate<["-"], "imultilib">, Group<gfortran_Group>;
@@ -3706,22 +4140,31 @@ def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>,
Group<Link_Group>;
def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>;
def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>;
-def mlittle_endian : Flag<["-"], "mlittle-endian">, Group<m_Group>, Flags<[NoXarchOption,TargetSpecific]>;
+def mlittle_endian : Flag<["-"], "mlittle-endian">, Group<m_Group>,
+ Flags<[NoXarchOption, TargetSpecific]>;
def EL : Flag<["-"], "EL">, Alias<mlittle_endian>;
-def mbig_endian : Flag<["-"], "mbig-endian">, Group<m_Group>, Flags<[NoXarchOption,TargetSpecific]>;
+def mbig_endian : Flag<["-"], "mbig-endian">, Group<m_Group>,
+ Flags<[NoXarchOption, TargetSpecific]>;
def EB : Flag<["-"], "EB">, Alias<mbig_endian>;
-def m16 : Flag<["-"], "m16">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
-def m32 : Flag<["-"], "m32">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
+def m16 : Flag<["-"], "m16">, Group<m_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
+def m32 : Flag<["-"], "m32">, Group<m_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def maix32 : Flag<["-"], "maix32">, Group<m_Group>, Flags<[NoXarchOption]>;
-def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group<m_Group>, Flags<[NoXarchOption,CC1Option]>,
+def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable hexagon-qdsp6 backward compatibility">,
MarshallingInfoFlag<LangOpts<"HexagonQdsp6Compat">>;
-def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
+def m64 : Flag<["-"], "m64">, Group<m_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
def maix64 : Flag<["-"], "maix64">, Group<m_Group>, Flags<[NoXarchOption]>;
-def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
-def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>,
+def mx32 : Flag<["-"], "mx32">, Group<m_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>;
+def miamcu : Flag<["-"], "miamcu">, Group<m_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Use Intel MCU ABI">;
-def mno_iamcu : Flag<["-"], "mno-iamcu">, Group<m_Group>, Flags<[NoXarchOption, CoreOption]>;
+def mno_iamcu : Flag<["-"], "mno-iamcu">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
def malign_functions_EQ : Joined<["-"], "malign-functions=">, Group<clang_ignored_m_Group>;
def malign_loops_EQ : Joined<["-"], "malign-loops=">, Group<clang_ignored_m_Group>;
def malign_jumps_EQ : Joined<["-"], "malign-jumps=">, Group<clang_ignored_m_Group>;
@@ -3741,14 +4184,17 @@ def mlong_calls : Flag<["-"], "mlong-calls">, Group<m_Group>,
HelpText<"Generate branches with extended addressability, usually via indirect jumps.">;
} // let Flags = [TargetSpecific]
def mdouble_EQ : Joined<["-"], "mdouble=">, Group<m_Group>,
- MetaVarName<"<n">, Values<"32,64">, Flags<[CC1Option]>,
+ MetaVarName<"<n">, Values<"32,64">, Visibility<[ClangOption, CC1Option]>,
HelpText<"Force double to be <n> bits">,
MarshallingInfoInt<LangOpts<"DoubleSize">, "0">;
-def mlong_double_64 : Flag<["-"], "mlong-double-64">, Group<LongDouble_Group>, Flags<[CC1Option]>,
+def mlong_double_64 : Flag<["-"], "mlong-double-64">, Group<LongDouble_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Force long double to be 64 bits">;
-def mlong_double_80 : Flag<["-"], "mlong-double-80">, Group<LongDouble_Group>, Flags<[CC1Option]>,
+def mlong_double_80 : Flag<["-"], "mlong-double-80">, Group<LongDouble_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Force long double to be 80 bits, padded to 128 bits for storage">;
-def mlong_double_128 : Flag<["-"], "mlong-double-128">, Group<LongDouble_Group>, Flags<[CC1Option]>,
+def mlong_double_128 : Flag<["-"], "mlong-double-128">, Group<LongDouble_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Force long double to be 128 bits">;
let Flags = [TargetSpecific] in {
def mno_long_calls : Flag<["-"], "mno-long-calls">, Group<m_Group>,
@@ -3773,16 +4219,20 @@ def mwatchos_version_min_EQ : Joined<["-"], "mwatchos-version-min=">, Group<m_Gr
def mwatchos_simulator_version_min_EQ : Joined<["-"], "mwatchos-simulator-version-min=">, Group<m_Group>;
def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias<mwatchos_simulator_version_min_EQ>;
} // let Flags = [TargetSpecific]
-def march_EQ : Joined<["-"], "march=">, Group<m_Group>, Flags<[CoreOption,TargetSpecific]>,
+def march_EQ : Joined<["-"], "march=">, Group<m_Group>,
+ Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"For a list of available architectures for the target use '-mcpu=help'">;
def masm_EQ : Joined<["-"], "masm=">, Group<m_Group>, Flags<[NoXarchOption]>;
-def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group<m_Group>, Flags<[CC1Option]>,
+def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
Values<"att,intel">,
NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["IAD_ATT", "IAD_Intel"]>,
MarshallingInfoEnum<CodeGenOpts<"InlineAsmDialect">, "IAD_ATT">;
-def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>, Flags<[CC1Option]>,
+def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoString<TargetOpts<"CodeModel">, [{"default"}]>;
-def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>, Flags<[NoXarchOption, CC1Option]>,
+def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
"12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">,
MarshallingInfoInt<CodeGenOpts<"TLSSize">>;
@@ -3809,7 +4259,8 @@ def mieee_fp : Flag<["-"], "mieee-fp">, Group<clang_ignored_m_Group>;
def minline_all_stringops : Flag<["-"], "minline-all-stringops">, Group<clang_ignored_m_Group>;
def mno_inline_all_stringops : Flag<["-"], "mno-inline-all-stringops">, Group<clang_ignored_m_Group>;
} // let Flags = [TargetSpecific]
-def malign_double : Flag<["-"], "malign-double">, Group<m_Group>, Flags<[CC1Option]>,
+def malign_double : Flag<["-"], "malign-double">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Align doubles to two words in structs (x86 only)">,
MarshallingInfoFlag<LangOpts<"AlignDouble">>;
let Flags = [TargetSpecific] in {
@@ -3819,7 +4270,8 @@ def mfpu_EQ : Joined<["-"], "mfpu=">, Group<m_Group>;
def mhwdiv_EQ : Joined<["-"], "mhwdiv=">, Group<m_Group>;
def mhwmult_EQ : Joined<["-"], "mhwmult=">, Group<m_Group>;
} // let Flags = [TargetSpecific]
-def mglobal_merge : Flag<["-"], "mglobal-merge">, Group<m_Group>, Flags<[CC1Option]>,
+def mglobal_merge : Flag<["-"], "mglobal-merge">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable merging of globals">;
let Flags = [TargetSpecific] in {
def mhard_float : Flag<["-"], "mhard-float">, Group<m_Group>;
@@ -3830,56 +4282,72 @@ def : Joined<["-"], "miphoneos-version-min=">,
def mios_simulator_version_min_EQ : Joined<["-"], "mios-simulator-version-min=">, Group<m_Group>;
def : Joined<["-"], "miphonesimulator-version-min=">, Alias<mios_simulator_version_min_EQ>;
def mkernel : Flag<["-"], "mkernel">, Group<m_Group>;
-def mlinker_version_EQ : Joined<["-"], "mlinker-version=">, Group<m_Group>, Flags<[NoXarchOption]>;
+def mlinker_version_EQ : Joined<["-"], "mlinker-version=">, Group<m_Group>,
+ Flags<[NoXarchOption]>;
} // let Flags = [TargetSpecific]
-def mllvm : Separate<["-"], "mllvm">,Flags<[CC1Option,CC1AsOption,CoreOption,FC1Option,FlangOption]>,
+def mllvm : Separate<["-"], "mllvm">,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption, FC1Option, FlangOption]>,
HelpText<"Additional arguments to forward to LLVM's option processing">,
MarshallingInfoStringVector<FrontendOpts<"LLVMArgs">>;
-def : Joined<["-"], "mllvm=">, Flags<[CoreOption,FlangOption]>, Alias<mllvm>,
+def : Joined<["-"], "mllvm=">,
+ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>, Alias<mllvm>,
HelpText<"Alias for -mllvm">, MetaVarName<"<arg>">;
-def mmlir : Separate<["-"], "mmlir">, Flags<[CoreOption,FC1Option,FlangOption]>,
+def mmlir : Separate<["-"], "mmlir">,
+ Visibility<[ClangOption, CLOption, DXCOption, FC1Option, FlangOption]>,
HelpText<"Additional arguments to forward to MLIR's option processing">;
def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">,
- Group<m_Group>, Flags<[CC1Option]>, HelpText<"Set Fuchsia API level">,
+ Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Set Fuchsia API level">,
MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>;
def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
Group<m_Group>, HelpText<"Set macOS deployment target">;
def : Joined<["-"], "mmacosx-version-min=">,
Group<m_Group>, Alias<mmacos_version_min_EQ>;
-def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CC1Option]>,
+def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">,
MarshallingInfoFlag<LangOpts<"MSBitfields">>;
-def moutline : Flag<["-"], "moutline">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def moutline : Flag<["-"], "moutline">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable function outlining (AArch64 only)">;
-def mno_outline : Flag<["-"], "mno-outline">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def mno_outline : Flag<["-"], "mno-outline">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable function outlining (AArch64 only)">;
def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">;
-def mskip_rax_setup : Flag<["-"], "mskip-rax-setup">, Group<m_Group>, Flags<[CC1Option]>,
+def mskip_rax_setup : Flag<["-"], "mskip-rax-setup">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Skip setting up RAX register when passing variable arguments (x86 only)">,
MarshallingInfoFlag<CodeGenOpts<"SkipRaxSetup">>;
-def mno_skip_rax_setup : Flag<["-"], "mno-skip-rax-setup">, Group<m_Group>, Flags<[CC1Option]>;
-def mstackrealign : Flag<["-"], "mstackrealign">, Group<m_Group>, Flags<[CC1Option]>,
+def mno_skip_rax_setup : Flag<["-"], "mno-skip-rax-setup">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>;
+def mstackrealign : Flag<["-"], "mstackrealign">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Force realign the stack at entry to every function">,
MarshallingInfoFlag<CodeGenOpts<"StackRealignment">>;
-def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group<m_Group>, Flags<[CC1Option]>,
+def mstack_alignment : Joined<["-"], "mstack-alignment=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the stack alignment">,
MarshallingInfoInt<CodeGenOpts<"StackAlignment">>;
-def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group<m_Group>, Flags<[CC1Option]>,
+def mstack_probe_size : Joined<["-"], "mstack-probe-size=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set the stack probe size">,
MarshallingInfoInt<CodeGenOpts<"StackProbeSize">, "4096">;
def mstack_arg_probe : Flag<["-"], "mstack-arg-probe">, Group<m_Group>,
HelpText<"Enable stack probes">;
def mzos_sys_include_EQ : Joined<["-"], "mzos-sys-include=">, MetaVarName<"<SysInclude>">,
HelpText<"Path to system headers on z/OS">;
-def mno_stack_arg_probe : Flag<["-"], "mno-stack-arg-probe">, Group<m_Group>, Flags<[CC1Option]>,
+def mno_stack_arg_probe : Flag<["-"], "mno-stack-arg-probe">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable stack probes which are enabled by default">,
MarshallingInfoFlag<CodeGenOpts<"NoStackArgProbe">>;
-def mthread_model : Separate<["-"], "mthread-model">, Group<m_Group>, Flags<[CC1Option]>,
+def mthread_model : Separate<["-"], "mthread-model">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"The thread model to use. Defaults to 'posix')">, Values<"posix,single">,
NormalizedValues<["POSIX", "Single"]>, NormalizedValuesScope<"LangOptions::ThreadModelKind">,
MarshallingInfoEnum<LangOpts<"ThreadModel">, "POSIX">;
-def meabi : Separate<["-"], "meabi">, Group<m_Group>, Flags<[CC1Option]>,
+def meabi : Separate<["-"], "meabi">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set EABI type. Default depends on triple)">, Values<"default,4,5,gnu">,
MarshallingInfoEnum<TargetOpts<"EABIVersion">, "Default">,
NormalizedValuesScope<"llvm::EABI">,
@@ -3894,12 +4362,14 @@ def mzos_hlq_csslib_EQ : Joined<["-"], "mzos-hlq-csslib=">, MetaVarName<"<Csslib
HelpText<"High level qualifier for z/OS CSSLIB dataset">;
def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group<m_Group>;
-def mno_global_merge : Flag<["-"], "mno-global-merge">, Group<m_Group>, Flags<[CC1Option]>,
+def mno_global_merge : Flag<["-"], "mno-global-merge">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable merging of globals">;
def mno_pascal_strings : Flag<["-"], "mno-pascal-strings">,
Alias<fno_pascal_strings>;
def mno_red_zone : Flag<["-"], "mno-red-zone">, Group<m_Group>;
-def mno_tls_direct_seg_refs : Flag<["-"], "mno-tls-direct-seg-refs">, Group<m_Group>, Flags<[CC1Option]>,
+def mno_tls_direct_seg_refs : Flag<["-"], "mno-tls-direct-seg-refs">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable direct TLS access through segment registers">,
MarshallingInfoFlag<CodeGenOpts<"IndirectTlsSegRefs">>;
def mno_relax_all : Flag<["-"], "mno-relax-all">, Group<m_Group>;
@@ -3909,25 +4379,33 @@ def mno_soft_float : Flag<["-"], "mno-soft-float">, Group<m_Group>;
def mno_stackrealign : Flag<["-"], "mno-stackrealign">, Group<m_Group>;
} // let Flags = [TargetSpecific]
-def mretpoline : Flag<["-"], "mretpoline">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>;
-def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>;
+def mretpoline : Flag<["-"], "mretpoline">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
+def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
defm speculative_load_hardening : BoolOption<"m", "speculative-load-hardening",
CodeGenOpts<"SpeculativeLoadHardening">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption]>,
- NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
Group<m_Group>;
-def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
+def mlvi_hardening : Flag<["-"], "mlvi-hardening">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Enable all mitigations for Load Value Injection (LVI)">;
-def mno_lvi_hardening : Flag<["-"], "mno-lvi-hardening">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
+def mno_lvi_hardening : Flag<["-"], "mno-lvi-hardening">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable mitigations for Load Value Injection (LVI)">;
-def mlvi_cfi : Flag<["-"], "mlvi-cfi">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
+def mlvi_cfi : Flag<["-"], "mlvi-cfi">, Group<m_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Enable only control-flow mitigations for Load Value Injection (LVI)">;
-def mno_lvi_cfi : Flag<["-"], "mno-lvi-cfi">, Group<m_Group>, Flags<[CoreOption,NoXarchOption]>,
+def mno_lvi_cfi : Flag<["-"], "mno-lvi-cfi">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable control-flow mitigations for Load Value Injection (LVI)">;
-def m_seses : Flag<["-"], "mseses">, Group<m_Group>, Flags<[CoreOption, NoXarchOption]>,
+def m_seses : Flag<["-"], "mseses">, Group<m_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Enable speculative execution side effect suppression (SESES). "
"Includes LVI control flow integrity mitigations">;
-def mno_seses : Flag<["-"], "mno-seses">, Group<m_Group>, Flags<[CoreOption, NoXarchOption]>,
+def mno_seses : Flag<["-"], "mno-seses">, Group<m_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Disable speculative execution side effect suppression (SESES)">;
def mrelax : Flag<["-"], "mrelax">, Group<m_Group>,
@@ -3944,10 +4422,12 @@ def mno_save_restore : Flag<["-"], "mno-save-restore">, Group<m_riscv_Features_G
HelpText<"Disable using library calls for save and restore">;
} // let Flags = [TargetSpecific]
def mcmodel_EQ_medlow : Flag<["-"], "mcmodel=medlow">, Group<m_Group>,
- Flags<[CC1Option]>, Alias<mcmodel_EQ>, AliasArgs<["small"]>,
+ Visibility<[ClangOption, CC1Option]>,
+ Alias<mcmodel_EQ>, AliasArgs<["small"]>,
HelpText<"Equivalent to -mcmodel=small, compatible with RISC-V gcc.">;
def mcmodel_EQ_medany : Flag<["-"], "mcmodel=medany">, Group<m_Group>,
- Flags<[CC1Option]>, Alias<mcmodel_EQ>, AliasArgs<["medium"]>,
+ Visibility<[ClangOption, CC1Option]>,
+ Alias<mcmodel_EQ>, AliasArgs<["medium"]>,
HelpText<"Equivalent to -mcmodel=medium, compatible with RISC-V gcc.">;
let Flags = [TargetSpecific] in {
def menable_experimental_extensions : Flag<["-"], "menable-experimental-extensions">, Group<m_Group>,
@@ -3964,9 +4444,11 @@ def munaligned_access : Flag<["-"], "munaligned-access">, Group<m_Group>,
def mno_unaligned_access : Flag<["-"], "mno-unaligned-access">, Group<m_Group>,
HelpText<"Force all memory accesses to be aligned (AArch32/AArch64/LoongArch/RISC-V only)">;
} // let Flags = [TargetSpecific]
-def mstrict_align : Flag<["-"], "mstrict-align">, Alias<mno_unaligned_access>, Flags<[CC1Option,HelpHidden]>,
+def mstrict_align : Flag<["-"], "mstrict-align">, Alias<mno_unaligned_access>,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Force all memory accesses to be aligned (same as mno-unaligned-access)">;
-def mno_strict_align : Flag<["-"], "mno-strict-align">, Alias<munaligned_access>, Flags<[CC1Option,HelpHidden]>,
+def mno_strict_align : Flag<["-"], "mno-strict-align">, Alias<munaligned_access>,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Allow memory accesses to be unaligned (same as munaligned-access)">;
let Flags = [TargetSpecific] in {
def mno_thumb : Flag<["-"], "mno-thumb">, Group<m_arm_Features_Group>;
@@ -3987,18 +4469,19 @@ def mno_neg_immediates: Flag<["-"], "mno-neg-immediates">, Group<m_arm_Features_
HelpText<"Disallow converting instructions with negative immediates to their negation or inversion.">;
} // let Flags = [TargetSpecific]
def mcmse : Flag<["-"], "mcmse">, Group<m_arm_Features_Group>,
- Flags<[NoXarchOption,CC1Option]>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Allow use of CMSE (Armv8-M Security Extensions)">,
MarshallingInfoFlag<LangOpts<"Cmse">>;
def ForceAAPCSBitfieldLoad : Flag<["-"], "faapcs-bitfield-load">, Group<m_arm_Features_Group>,
- Flags<[NoXarchOption,CC1Option]>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Follows the AAPCS standard that all volatile bit-field write generates at least one load. (ARM only).">,
MarshallingInfoFlag<CodeGenOpts<"ForceAAPCSBitfieldLoad">>;
defm aapcs_bitfield_width : BoolOption<"f", "aapcs-bitfield-width",
CodeGenOpts<"AAPCSBitfieldWidth">, DefaultTrue,
NegFlag<SetFalse, [], [ClangOption], "Do not follow">,
PosFlag<SetTrue, [], [ClangOption], "Follow">,
- BothFlags<[NoXarchOption, CC1Option], [ClangOption], " the AAPCS standard requirement stating that"
+ BothFlags<[NoXarchOption], [ClangOption, CC1Option],
+ " the AAPCS standard requirement stating that"
" volatile bit-field width is dictated by the field container type. (ARM only).">>,
Group<m_arm_Features_Group>;
let Flags = [TargetSpecific] in {
@@ -4055,17 +4538,20 @@ def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">, Group<m_aarch64_Fe
} // let Flags = [TargetSpecific]
def mvscale_min_EQ : Joined<["-"], "mvscale-min=">,
- Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
+ Group<m_aarch64_Features_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify the vscale minimum. Defaults to \"1\". (AArch64/RISC-V only)">,
MarshallingInfoInt<LangOpts<"VScaleMin">>;
def mvscale_max_EQ : Joined<["-"], "mvscale-max=">,
- Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
+ Group<m_aarch64_Features_Group>, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specify the vscale maximum. Defaults to the"
" vector length agnostic value of \"0\". (AArch64/RISC-V only)">,
MarshallingInfoInt<LangOpts<"VScaleMax">>;
def msign_return_address_EQ : Joined<["-"], "msign-return-address=">,
- Flags<[CC1Option]>, Group<m_Group>, Values<"none,all,non-leaf">,
+ Visibility<[ClangOption, CC1Option]>,
+ Group<m_Group>, Values<"none,all,non-leaf">,
HelpText<"Select return address signing scope">;
let Flags = [TargetSpecific] in {
def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">,
@@ -4117,11 +4603,11 @@ defm amdgpu_ieee : BoolOption<"m", "amdgpu-ieee",
" mode register. Floating point opcodes that support exception flag "
"gathering quiet and propagate signaling NaN inputs per IEEE 754-2008. "
"This option changes the ABI. (AMDGPU only)">,
- NegFlag<SetFalse, [CC1Option], [ClangOption]>>, Group<m_Group>;
+ NegFlag<SetFalse, [], [ClangOption, CC1Option]>>, Group<m_Group>;
def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
HelpText<"Specify code object ABI version. Defaults to 4. (AMDGPU only)">,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
Values<"none,2,3,4,5">,
NormalizedValuesScope<"TargetOptions">,
NormalizedValues<["COV_None", "COV_2", "COV_3", "COV_4", "COV_5"]>,
@@ -4138,14 +4624,16 @@ defm wavefrontsize64 : SimpleMFlag<"wavefrontsize64",
defm unsafe_fp_atomics : BoolOption<"m", "unsafe-fp-atomics",
TargetOpts<"AllowAMDGPUUnsafeFPAtomics">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable generation of unsafe floating point "
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable generation of unsafe floating point "
"atomic instructions. May generate more efficient code, but may not "
"respect rounding and denormal modes, and may give incorrect results "
"for certain memory destinations. (AMDGPU only)">,
NegFlag<SetFalse>>, Group<m_Group>;
def faltivec : Flag<["-"], "faltivec">, Group<f_Group>, Flags<[NoXarchOption]>;
-def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>, Flags<[NoXarchOption]>;
+def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>,
+ Flags<[NoXarchOption]>;
let Flags = [TargetSpecific] in {
def maltivec : Flag<["-"], "maltivec">, Group<m_ppc_Features_Group>,
HelpText<"Enable AltiVec vector initializer syntax">;
@@ -4159,7 +4647,7 @@ def mno_spe : Flag<["-"], "mno-spe">, Group<m_ppc_Features_Group>;
def mefpu2 : Flag<["-"], "mefpu2">, Group<m_ppc_Features_Group>;
} // let Flags = [TargetSpecific]
def mabi_EQ_quadword_atomics : Flag<["-"], "mabi=quadword-atomics">,
- Group<m_Group>, Flags<[CC1Option]>,
+ Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable quadword atomics ABI on AIX (AIX PPC64 only). Uses lqarx/stqcx. instructions.">,
MarshallingInfoFlag<LangOpts<"EnableAIXQuadwordAtomicsABI">>;
let Flags = [TargetSpecific] in {
@@ -4231,17 +4719,18 @@ def mprivileged : Flag<["-"], "mprivileged">,
Group<m_ppc_Features_Group>;
} // let Flags = [TargetSpecific]
def maix_struct_return : Flag<["-"], "maix-struct-return">,
- Group<m_Group>, Flags<[CC1Option]>,
+ Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Return all structs in memory (PPC32 only)">,
DocBrief<"Override the default ABI for 32-bit targets to return all "
"structs in memory, as in the Power 32-bit ABI for Linux (2011), "
"and on AIX and Darwin.">;
def msvr4_struct_return : Flag<["-"], "msvr4-struct-return">,
- Group<m_Group>, Flags<[CC1Option]>,
+ Group<m_Group>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Return small structs in registers (PPC32 only)">,
DocBrief<"Override the default ABI for 32-bit targets to return small "
"structs in registers, as in the System V ABI (1995).">;
-def mxcoff_roptr : Flag<["-"], "mxcoff-roptr">, Group<m_Group>, Flags<[CC1Option,TargetSpecific]>,
+def mxcoff_roptr : Flag<["-"], "mxcoff-roptr">, Group<m_Group>,
+ Flags<[TargetSpecific]>, Visibility<[ClangOption, CC1Option]>,
HelpText<"Place constant objects with relocatable address values in the RO data section and add -bforceimprw to the linker flags (AIX only)">;
def mno_xcoff_roptr : Flag<["-"], "mno-xcoff-roptr">, Group<m_Group>, TargetSpecific;
@@ -4252,7 +4741,8 @@ def mno_vx : Flag<["-"], "mno-vx">, Group<m_Group>;
defm zvector : BoolFOption<"zvector",
LangOpts<"ZVector">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Enable System z vector language extension">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Enable System z vector language extension">,
NegFlag<SetFalse>>;
def mzvector : Flag<["-"], "mzvector">, Alias<fzvector>;
def mno_zvector : Flag<["-"], "mno-zvector">, Alias<fno_zvector>;
@@ -4261,11 +4751,12 @@ def mxcoff_build_id_EQ : Joined<["-"], "mxcoff-build-id=">, Group<Link_Group>, M
HelpText<"On AIX, request creation of a build-id string, \"0xHEXSTRING\", in the string table of the loader section inside the linked binary">;
def mignore_xcoff_visibility : Flag<["-"], "mignore-xcoff-visibility">, Group<m_Group>,
HelpText<"Not emit the visibility attribute for asm in AIX OS or give all symbols 'unspecified' visibility in XCOFF object file">,
- Flags<[CC1Option,TargetSpecific]>;
+ Flags<[TargetSpecific]>, Visibility<[ClangOption, CC1Option]>;
defm backchain : BoolOption<"m", "backchain",
CodeGenOpts<"Backchain">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Link stack frames through backchain on System Z">,
- NegFlag<SetFalse>, BothFlags<[NoXarchOption,CC1Option]>>, Group<m_Group>;
+ NegFlag<SetFalse>, BothFlags<[NoXarchOption], [ClangOption, CC1Option]
+ >>, Group<m_Group>;
def mno_warn_nonportable_cfstrings : Flag<["-"], "mno-warn-nonportable-cfstrings">, Group<m_Group>;
def mno_omit_leaf_frame_pointer : Flag<["-"], "mno-omit-leaf-frame-pointer">, Group<m_Group>;
@@ -4277,66 +4768,79 @@ def mred_zone : Flag<["-"], "mred-zone">, Group<m_Group>;
def mtls_direct_seg_refs : Flag<["-"], "mtls-direct-seg-refs">, Group<m_Group>,
HelpText<"Enable direct TLS access through segment registers (default)">;
def mregparm_EQ : Joined<["-"], "mregparm=">, Group<m_Group>;
-def mrelax_all : Flag<["-"], "mrelax-all">, Group<m_Group>, Flags<[CC1Option,CC1AsOption]>,
+def mrelax_all : Flag<["-"], "mrelax-all">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption]>,
HelpText<"(integrated-as) Relax all machine instructions">,
MarshallingInfoFlag<CodeGenOpts<"RelaxAll">>;
def mincremental_linker_compatible : Flag<["-"], "mincremental-linker-compatible">, Group<m_Group>,
- Flags<[CC1Option,CC1AsOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption]>,
HelpText<"(integrated-as) Emit an object file which can be used with an incremental linker">,
MarshallingInfoFlag<CodeGenOpts<"IncrementalLinkerCompatible">>;
def mno_incremental_linker_compatible : Flag<["-"], "mno-incremental-linker-compatible">, Group<m_Group>,
HelpText<"(integrated-as) Emit an object file which cannot be used with an incremental linker">;
-def mrtd : Flag<["-"], "mrtd">, Group<m_Group>, Flags<[CC1Option]>,
+def mrtd : Flag<["-"], "mrtd">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Make StdCall calling convention the default">;
def msmall_data_threshold_EQ : Joined <["-"], "msmall-data-threshold=">,
Group<m_Group>, Alias<G>;
-def msoft_float : Flag<["-"], "msoft-float">, Group<m_Group>, Flags<[CC1Option]>,
+def msoft_float : Flag<["-"], "msoft-float">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use software floating point">,
MarshallingInfoFlag<CodeGenOpts<"SoftFloat">>;
-def mno_fmv : Flag<["-"], "mno-fmv">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def mno_fmv : Flag<["-"], "mno-fmv">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Disable function multiversioning">;
-def moutline_atomics : Flag<["-"], "moutline-atomics">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def moutline_atomics : Flag<["-"], "moutline-atomics">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Generate local calls to out-of-line atomic operations">;
-def mno_outline_atomics : Flag<["-"], "mno-outline-atomics">, Group<f_clang_Group>, Flags<[CC1Option]>,
+def mno_outline_atomics : Flag<["-"], "mno-outline-atomics">, Group<f_clang_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Don't generate local calls to out-of-line atomic operations">;
def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group<m_Group>,
HelpText<"Don't generate implicit floating point or vector instructions">;
def mimplicit_float : Flag<["-"], "mimplicit-float">, Group<m_Group>;
def mrecip : Flag<["-"], "mrecip">, Group<m_Group>,
HelpText<"Equivalent to '-mrecip=all'">;
-def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group<m_Group>, Flags<[CC1Option]>,
+def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Control use of approximate reciprocal and reciprocal square root instructions followed by <n> iterations of "
"Newton-Raphson refinement. "
"<value> = ( ['!'] ['vec-'] ('rcp'|'sqrt') [('h'|'s'|'d')] [':'<n>] ) | 'all' | 'default' | 'none'">,
MarshallingInfoStringVector<CodeGenOpts<"Reciprocals">>;
-def mprefer_vector_width_EQ : Joined<["-"], "mprefer-vector-width=">, Group<m_Group>, Flags<[CC1Option]>,
+def mprefer_vector_width_EQ : Joined<["-"], "mprefer-vector-width=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Specifies preferred vector width for auto-vectorization. Defaults to 'none' which allows target specific decisions.">,
MarshallingInfoString<CodeGenOpts<"PreferVectorWidth">>;
-def mstack_protector_guard_EQ : Joined<["-"], "mstack-protector-guard=">, Group<m_Group>, Flags<[CC1Option]>,
+def mstack_protector_guard_EQ : Joined<["-"], "mstack-protector-guard=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use the given guard (global, tls) for addressing the stack-protector guard">,
MarshallingInfoString<CodeGenOpts<"StackProtectorGuard">>;
-def mstack_protector_guard_offset_EQ : Joined<["-"], "mstack-protector-guard-offset=">, Group<m_Group>, Flags<[CC1Option]>,
+def mstack_protector_guard_offset_EQ : Joined<["-"], "mstack-protector-guard-offset=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use the given offset for addressing the stack-protector guard">,
MarshallingInfoInt<CodeGenOpts<"StackProtectorGuardOffset">, "INT_MAX", "int">;
-def mstack_protector_guard_symbol_EQ : Joined<["-"], "mstack-protector-guard-symbol=">, Group<m_Group>, Flags<[CC1Option]>,
+def mstack_protector_guard_symbol_EQ : Joined<["-"], "mstack-protector-guard-symbol=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use the given symbol for addressing the stack-protector guard">,
MarshallingInfoString<CodeGenOpts<"StackProtectorGuardSymbol">>;
-def mstack_protector_guard_reg_EQ : Joined<["-"], "mstack-protector-guard-reg=">, Group<m_Group>, Flags<[CC1Option]>,
+def mstack_protector_guard_reg_EQ : Joined<["-"], "mstack-protector-guard-reg=">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Use the given reg for addressing the stack-protector guard">,
MarshallingInfoString<CodeGenOpts<"StackProtectorGuardReg">>;
def mfentry : Flag<["-"], "mfentry">, HelpText<"Insert calls to fentry at function entry (x86/SystemZ only)">,
- Flags<[CC1Option]>, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
MarshallingInfoFlag<CodeGenOpts<"CallFEntry">>;
def mnop_mcount : Flag<["-"], "mnop-mcount">, HelpText<"Generate mcount/__fentry__ calls as nops. To activate they need to be patched in.">,
- Flags<[CC1Option]>, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
MarshallingInfoFlag<CodeGenOpts<"MNopMCount">>;
def mrecord_mcount : Flag<["-"], "mrecord-mcount">, HelpText<"Generate a __mcount_loc section entry for each __fentry__ call.">,
- Flags<[CC1Option]>, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
MarshallingInfoFlag<CodeGenOpts<"RecordMCount">>;
def mpacked_stack : Flag<["-"], "mpacked-stack">, HelpText<"Use packed stack layout (SystemZ only).">,
- Flags<[CC1Option]>, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>, Group<m_Group>,
MarshallingInfoFlag<CodeGenOpts<"PackedStack">>;
-def mno_packed_stack : Flag<["-"], "mno-packed-stack">, Flags<[CC1Option]>, Group<m_Group>;
+def mno_packed_stack : Flag<["-"], "mno-packed-stack">,
+ Visibility<[ClangOption, CC1Option]>, Group<m_Group>;
let Flags = [TargetSpecific] in {
def mips16 : Flag<["-"], "mips16">, Group<m_mips_Features_Group>;
@@ -4490,7 +4994,8 @@ def mno_relax_pic_calls : Flag<["-"], "mno-relax-pic-calls">,
"call sequences into direct calls (MIPS only)">, Flags<[HelpHidden]>;
def mglibc : Flag<["-"], "mglibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
def muclibc : Flag<["-"], "muclibc">, Group<m_libc_Group>, Flags<[HelpHidden]>;
-def module_file_info : Flag<["-"], "module-file-info">, Flags<[NoXarchOption,CC1Option]>, Group<Action_Group>,
+def module_file_info : Flag<["-"], "module-file-info">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>, Group<Action_Group>,
HelpText<"Provide information about a particular module file">;
def mthumb : Flag<["-"], "mthumb">, Group<m_Group>;
def mtune_EQ : Joined<["-"], "mtune=">, Group<m_Group>,
@@ -4499,15 +5004,20 @@ def multi__module : Flag<["-"], "multi_module">;
def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
def multiply__defined : Separate<["-"], "multiply_defined">;
def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Group<m_Group>;
-def canonical_prefixes : Flag<["-"], "canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
+def canonical_prefixes : Flag<["-"], "canonical-prefixes">,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Use absolute paths for invoking subcommands (default)">;
-def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
+def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">,
+ Flags<[HelpHidden]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Use relative paths for invoking subcommands">;
def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>;
-def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[NoXarchOption]>;
+def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">,
+ Flags<[NoXarchOption]>;
def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
def no__dead__strip__inits__and__terms : Flag<["-"], "no_dead_strip_inits_and_terms">;
-def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option, CoreOption]>, Group<IncludePath_Group>,
+def nobuiltininc : Flag<["-"], "nobuiltininc">,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
+ Group<IncludePath_Group>,
HelpText<"Disable builtin #include directories">,
MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseBuiltinIncludes">>;
def nogpuinc : Flag<["-"], "nogpuinc">, Group<IncludePath_Group>,
@@ -4517,7 +5027,8 @@ def nohipwrapperinc : Flag<["-"], "nohipwrapperinc">, Group<IncludePath_Group>,
HelpText<"Do not include the default HIP wrapper headers and include paths">;
def : Flag<["-"], "nocudainc">, Alias<nogpuinc>;
def nogpulib : Flag<["-"], "nogpulib">, MarshallingInfoFlag<LangOpts<"NoGPULib">>,
- Flags<[CC1Option]>, HelpText<"Do not link device library for CUDA/HIP device compilation">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Do not link device library for CUDA/HIP device compilation">;
def : Flag<["-"], "nocudalib">, Alias<nogpulib>;
def nodefaultlibs : Flag<["-"], "nodefaultlibs">;
def nodriverkitlib : Flag<["-"], "nodriverkitlib">;
@@ -4530,31 +5041,39 @@ def noprebind : Flag<["-"], "noprebind">;
def noprofilelib : Flag<["-"], "noprofilelib">;
def noseglinkedit : Flag<["-"], "noseglinkedit">;
def nostartfiles : Flag<["-"], "nostartfiles">, Group<Link_Group>;
-def nostdinc : Flag<["-"], "nostdinc">, Flags<[CoreOption]>, Group<IncludePath_Group>;
+def nostdinc : Flag<["-"], "nostdinc">,
+ Visibility<[ClangOption, CLOption, DXCOption]>, Group<IncludePath_Group>;
def nostdlibinc : Flag<["-"], "nostdlibinc">, Group<IncludePath_Group>;
-def nostdincxx : Flag<["-"], "nostdinc++">, Flags<[CC1Option]>, Group<IncludePath_Group>,
+def nostdincxx : Flag<["-"], "nostdinc++">, Visibility<[ClangOption, CC1Option]>,
+ Group<IncludePath_Group>,
HelpText<"Disable standard #include directories for the C++ standard library">,
MarshallingInfoNegativeFlag<HeaderSearchOpts<"UseStandardCXXIncludes">>;
def nostdlib : Flag<["-"], "nostdlib">, Group<Link_Group>;
def nostdlibxx : Flag<["-"], "nostdlib++">;
def object : Flag<["-"], "object">;
def o : JoinedOrSeparate<["-"], "o">,
- Flags<[NoXarchOption, CC1Option, CC1AsOption, FC1Option, FlangOption]>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, FC1Option, FlangOption]>,
HelpText<"Write output to <file>">, MetaVarName<"<file>">,
MarshallingInfoString<FrontendOpts<"OutputFile">>;
-def object_file_name_EQ : Joined<["-"], "object-file-name=">, Flags<[CC1Option, CC1AsOption, CoreOption]>,
+def object_file_name_EQ : Joined<["-"], "object-file-name=">,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
HelpText<"Set the output <file> for debug infos">, MetaVarName<"<file>">,
MarshallingInfoString<CodeGenOpts<"ObjectFilenameForDebug">>;
-def object_file_name : Separate<["-"], "object-file-name">, Flags<[CC1Option, CC1AsOption, CoreOption]>,
+def object_file_name : Separate<["-"], "object-file-name">,
+ Visibility<[ClangOption, CC1Option, CC1AsOption, CLOption, DXCOption]>,
Alias<object_file_name_EQ>;
def pagezero__size : JoinedOrSeparate<["-"], "pagezero_size">;
def pass_exit_codes : Flag<["-", "--"], "pass-exit-codes">, Flags<[Unsupported]>;
-def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group<pedantic_Group>, Flags<[CC1Option]>,
+def pedantic_errors : Flag<["-", "--"], "pedantic-errors">, Group<pedantic_Group>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<DiagnosticOpts<"PedanticErrors">>;
-def pedantic : Flag<["-", "--"], "pedantic">, Group<pedantic_Group>, Flags<[CC1Option,FlangOption,FC1Option]>,
+def pedantic : Flag<["-", "--"], "pedantic">, Group<pedantic_Group>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Warn on language extensions">, MarshallingInfoFlag<DiagnosticOpts<"Pedantic">>;
def p : Flag<["-"], "p">, HelpText<"Enable mcount instrumentation with prof">;
-def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">, Flags<[CC1Option]>,
+def pg : Flag<["-"], "pg">, HelpText<"Enable mcount instrumentation">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<CodeGenOpts<"InstrumentForProfiling">>;
def pipe : Flag<["-", "--"], "pipe">,
HelpText<"Use pipes between commands, when possible">;
@@ -4563,7 +5082,8 @@ def prebind : Flag<["-"], "prebind">;
def preload : Flag<["-"], "preload">;
def print_file_name_EQ : Joined<["-", "--"], "print-file-name=">,
HelpText<"Print the full library path of <file>">, MetaVarName<"<file>">;
-def print_ivar_layout : Flag<["-"], "print-ivar-layout">, Flags<[CC1Option]>,
+def print_ivar_layout : Flag<["-"], "print-ivar-layout">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable Objective-C Ivar layout bitmap print trace">,
MarshallingInfoFlag<LangOpts<"ObjCGCBitmapPrint">>;
def print_libgcc_file_name : Flag<["-", "--"], "print-libgcc-file-name">,
@@ -4576,9 +5096,11 @@ def print_multi_flags : Flag<["-", "--"], "print-multi-flags-experimental">,
def print_multi_os_directory : Flag<["-", "--"], "print-multi-os-directory">,
Flags<[Unsupported]>;
def print_target_triple : Flag<["-", "--"], "print-target-triple">,
- HelpText<"Print the normalized target triple">, Flags<[FlangOption]>;
+ HelpText<"Print the normalized target triple">,
+ Visibility<[ClangOption, FlangOption]>;
def print_effective_triple : Flag<["-", "--"], "print-effective-triple">,
- HelpText<"Print the effective target triple">, Flags<[FlangOption]>;
+ HelpText<"Print the effective target triple">,
+ Visibility<[ClangOption, FlangOption]>;
// GCC --disable-multiarch, GCC --enable-multiarch (upstream and Debian
// specific) have
diff erent behaviors. We choose not to support the option.
def : Flag<["-", "--"], "print-multiarch">, Flags<[Unsupported]>;
@@ -4601,21 +5123,25 @@ def pthreads : Flag<["-"], "pthreads">;
defm pthread : BoolOption<"", "pthread",
LangOpts<"POSIXThreads">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Support POSIX threads in generated code">,
- NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
def pie : Flag<["-"], "pie">, Group<Link_Group>;
def static_pie : Flag<["-"], "static-pie">, Group<Link_Group>;
def read__only__relocs : Separate<["-"], "read_only_relocs">;
def remap : Flag<["-"], "remap">;
-def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[NoXarchOption,CC1Option]>,
+def rewrite_objc : Flag<["-"], "rewrite-objc">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Rewrite Objective-C source to C++">, Group<Action_Group>;
-def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">, Flags<[NoXarchOption]>,
+def rewrite_legacy_objc : Flag<["-"], "rewrite-legacy-objc">,
+ Flags<[NoXarchOption]>,
HelpText<"Rewrite Legacy Objective-C source to C++">;
def rdynamic : Flag<["-"], "rdynamic">, Group<Link_Group>;
def resource_dir : Separate<["-"], "resource-dir">,
- Flags<[NoXarchOption, CC1Option, CoreOption, HelpHidden]>,
+ Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"The directory which holds the compiler resource files">,
MarshallingInfoString<HeaderSearchOpts<"ResourceDir">>;
-def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[NoXarchOption, CoreOption]>,
+def resource_dir_EQ : Joined<["-"], "resource-dir=">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
Alias<resource_dir>;
def rpath : Separate<["-"], "rpath">, Flags<[LinkerInput]>, Group<Link_Group>;
def rtlib_EQ : Joined<["-", "--"], "rtlib=">,
@@ -4623,21 +5149,27 @@ def rtlib_EQ : Joined<["-", "--"], "rtlib=">,
def frtlib_add_rpath: Flag<["-"], "frtlib-add-rpath">, Flags<[NoArgumentUnused]>,
HelpText<"Add -rpath with architecture-specific resource directory to the linker flags. "
"When --hip-link is specified, also add -rpath with HIP runtime library directory to the linker flags">;
-def fno_rtlib_add_rpath: Flag<["-"], "fno-rtlib-add-rpath">, Flags<[NoArgumentUnused]>,
+def fno_rtlib_add_rpath: Flag<["-"], "fno-rtlib-add-rpath">,
+ Flags<[NoArgumentUnused]>,
HelpText<"Do not add -rpath with architecture-specific resource directory to the linker flags. "
"When --hip-link is specified, do not add -rpath with HIP runtime library directory to the linker flags">;
-def offload_add_rpath: Flag<["--"], "offload-add-rpath">, Flags<[NoArgumentUnused]>,
+def offload_add_rpath: Flag<["--"], "offload-add-rpath">,
+ Flags<[NoArgumentUnused]>,
Alias<frtlib_add_rpath>;
-def no_offload_add_rpath: Flag<["--"], "no-offload-add-rpath">, Flags<[NoArgumentUnused]>,
+def no_offload_add_rpath: Flag<["--"], "no-offload-add-rpath">,
+ Flags<[NoArgumentUnused]>,
Alias<frtlib_add_rpath>;
-def r : Flag<["-"], "r">, Flags<[LinkerInput,NoArgumentUnused]>,
+def r : Flag<["-"], "r">, Flags<[LinkerInput, NoArgumentUnused]>,
Group<Link_Group>;
-def regcall4 : Flag<["-"], "regcall4">, Group<m_Group>, Flags<[CC1Option]>,
+def regcall4 : Flag<["-"], "regcall4">, Group<m_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Set __regcall4 as a default calling convention to respect __regcall ABI v.4">,
MarshallingInfoFlag<LangOpts<"RegCall4">>;
-def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[CC1Option, FlangOption, FC1Option, NoXarchOption]>,
+def save_temps_EQ : Joined<["-", "--"], "save-temps=">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Save intermediate compilation results.">;
-def save_temps : Flag<["-", "--"], "save-temps">, Flags<[FlangOption, FC1Option, NoXarchOption]>,
+def save_temps : Flag<["-", "--"], "save-temps">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, FlangOption, FC1Option]>,
Alias<save_temps_EQ>, AliasArgs<["cwd"]>,
HelpText<"Save intermediate compilation results">;
def save_stats_EQ : Joined<["-", "--"], "save-stats=">, Flags<[NoXarchOption]>,
@@ -4666,13 +5198,16 @@ def shared : Flag<["-", "--"], "shared">, Group<Link_Group>;
def single__module : Flag<["-"], "single_module">;
def specs_EQ : Joined<["-", "--"], "specs=">, Group<Link_Group>;
def specs : Separate<["-", "--"], "specs">, Flags<[Unsupported]>;
-def start_no_unused_arguments : Flag<["--"], "start-no-unused-arguments">, Flags<[CoreOption]>,
+def start_no_unused_arguments : Flag<["--"], "start-no-unused-arguments">,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Don't emit warnings about unused arguments for the following arguments">;
def static_libgcc : Flag<["-"], "static-libgcc">;
def static_libstdcxx : Flag<["-"], "static-libstdc++">;
-def static : Flag<["-", "--"], "static">, Group<Link_Group>, Flags<[NoArgumentUnused]>;
+def static : Flag<["-", "--"], "static">, Group<Link_Group>,
+ Flags<[NoArgumentUnused]>;
def std_default_EQ : Joined<["-"], "std-default=">;
-def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option,FlangOption,FC1Option]>,
+def std_EQ : Joined<["-", "--"], "std=">,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
Group<CompileOnly_Group>, HelpText<"Language standard to compile for">,
ValuesCode<[{
static constexpr const char VALUES_CODE [] =
@@ -4681,34 +5216,40 @@ def std_EQ : Joined<["-", "--"], "std=">, Flags<[CC1Option,FlangOption,FC1Option
#include "clang/Basic/LangStandards.def"
;
}]>;
-def stdlib_EQ : Joined<["-", "--"], "stdlib=">, Flags<[CC1Option]>,
+def stdlib_EQ : Joined<["-", "--"], "stdlib=">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"C++ standard library to use">, Values<"libc++,libstdc++,platform">;
def stdlibxx_isystem : JoinedOrSeparate<["-"], "stdlib++-isystem">,
Group<clang_i_Group>,
HelpText<"Use directory as the C++ standard library include path">,
Flags<[NoXarchOption]>, MetaVarName<"<directory>">;
-def unwindlib_EQ : Joined<["-", "--"], "unwindlib=">, Flags<[CC1Option]>,
+def unwindlib_EQ : Joined<["-", "--"], "unwindlib=">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Unwind library to use">, Values<"libgcc,unwindlib,platform">;
def sub__library : JoinedOrSeparate<["-"], "sub_library">;
def sub__umbrella : JoinedOrSeparate<["-"], "sub_umbrella">;
def system_header_prefix : Joined<["--"], "system-header-prefix=">,
- Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
+ Group<clang_i_Group>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<prefix>">,
HelpText<"Treat all #include paths starting with <prefix> as including a "
"system header.">;
def : Separate<["--"], "system-header-prefix">, Alias<system_header_prefix>;
def no_system_header_prefix : Joined<["--"], "no-system-header-prefix=">,
- Group<clang_i_Group>, Flags<[CC1Option]>, MetaVarName<"<prefix>">,
+ Group<clang_i_Group>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<prefix>">,
HelpText<"Treat all #include paths starting with <prefix> as not including a "
"system header.">;
def : Separate<["--"], "no-system-header-prefix">, Alias<no_system_header_prefix>;
def s : Flag<["-"], "s">, Group<Link_Group>;
-def target : Joined<["--"], "target=">, Flags<[NoXarchOption, CoreOption, FlangOption]>,
+def target : Joined<["--"], "target=">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
HelpText<"Generate code for the given target">;
def darwin_target_variant : Separate<["-"], "darwin-target-variant">,
- Flags<[NoXarchOption, CoreOption]>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Generate code for an additional runtime variant of the deployment target">;
def print_supported_cpus : Flag<["-", "--"], "print-supported-cpus">,
- Group<CompileOnly_Group>, Flags<[CC1Option, CoreOption]>,
+ Group<CompileOnly_Group>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Print supported cpu models for the given target (if target is not specified,"
" it will print the supported cpus for the default target)">,
MarshallingInfoFlag<FrontendOpts<"PrintSupportedCPUs">>;
@@ -4716,7 +5257,8 @@ def : Flag<["-"], "mcpu=help">, Alias<print_supported_cpus>;
def : Flag<["-"], "mtune=help">, Alias<print_supported_cpus>;
def time : Flag<["-"], "time">,
HelpText<"Time individual commands">;
-def traditional_cpp : Flag<["-", "--"], "traditional-cpp">, Flags<[CC1Option]>,
+def traditional_cpp : Flag<["-", "--"], "traditional-cpp">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Enable some traditional CPP emulation">,
MarshallingInfoFlag<LangOpts<"TraditionalCPP">>;
def traditional : Flag<["-", "--"], "traditional">;
@@ -4727,16 +5269,18 @@ def twolevel__namespace : Flag<["-"], "twolevel_namespace">;
def t : Flag<["-"], "t">, Group<Link_Group>;
def umbrella : Separate<["-"], "umbrella">;
def undefined : JoinedOrSeparate<["-"], "undefined">, Group<u_Group>;
-def undef : Flag<["-"], "undef">, Group<u_Group>, Flags<[CC1Option]>,
+def undef : Flag<["-"], "undef">, Group<u_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"undef all system defines">,
MarshallingInfoNegativeFlag<PreprocessorOpts<"UsePredefines">>;
def unexported__symbols__list : Separate<["-"], "unexported_symbols_list">;
def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
-def v : Flag<["-"], "v">, Flags<[CC1Option, CoreOption]>,
+def v : Flag<["-"], "v">,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"Show commands to run and use verbose output">,
MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
- Flags<[CC1Option]>, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>, Group<f_Group>,
HelpText<"Source-level compatibility for Altivec vectors (for PowerPC "
"targets). This includes results of vector comparison (scalar for "
"'xl', vector for 'gcc') as well as behavior when initializing with "
@@ -4747,7 +5291,8 @@ def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
NormalizedValuesScope<"LangOptions::AltivecSrcCompatKind">,
NormalizedValues<["Mixed", "GCC", "XL"]>,
MarshallingInfoEnum<LangOpts<"AltivecSrcCompat">, "Mixed">;
-def verify_debug_info : Flag<["--"], "verify-debug-info">, Flags<[NoXarchOption]>,
+def verify_debug_info : Flag<["--"], "verify-debug-info">,
+ Flags<[NoXarchOption]>,
HelpText<"Verify the binary representation of debug output">;
def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>;
def weak__framework : Separate<["-"], "weak_framework">, Flags<[LinkerInput]>;
@@ -4756,42 +5301,54 @@ def weak__reference__mismatches : Separate<["-"], "weak_reference_mismatches">;
def whatsloaded : Flag<["-"], "whatsloaded">;
def why_load : Flag<["-"], "why_load">;
def whyload : Flag<["-"], "whyload">, Alias<why_load>;
-def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">, Flags<[CC1Option]>,
+def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoFlag<DiagnosticOpts<"IgnoreWarnings">>;
def x : JoinedOrSeparate<["-"], "x">,
-Flags<[NoXarchOption,CC1Option,FlangOption,FC1Option]>,
+Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
HelpText<"Treat subsequent input files as having type <language>">,
MetaVarName<"<language>">;
def y : Joined<["-"], "y">;
defm integrated_as : BoolFOption<"integrated-as",
CodeGenOpts<"DisableIntegratedAS">, DefaultFalse,
- NegFlag<SetTrue, [CC1Option, FlangOption], [ClangOption], "Disable">,
+ NegFlag<SetTrue, [], [ClangOption, CC1Option, FlangOption], "Disable">,
PosFlag<SetFalse, [], [ClangOption], "Enable">,
BothFlags<[], [ClangOption], " the integrated assembler">>;
def fintegrated_cc1 : Flag<["-"], "fintegrated-cc1">,
- Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
+ Group<f_Group>,
HelpText<"Run cc1 in-process">;
def fno_integrated_cc1 : Flag<["-"], "fno-integrated-cc1">,
- Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
+ Group<f_Group>,
HelpText<"Spawn a separate process for each cc1">;
def fintegrated_objemitter : Flag<["-"], "fintegrated-objemitter">,
- Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ Group<f_Group>,
HelpText<"Use internal machine object code emitter.">;
def fno_integrated_objemitter : Flag<["-"], "fno-integrated-objemitter">,
- Flags<[CoreOption, NoXarchOption]>, Group<f_Group>,
+ Flags<[NoXarchOption]>, Visibility<[ClangOption, CLOption, DXCOption]>,
+ Group<f_Group>,
HelpText<"Use external machine object code emitter.">;
-def : Flag<["-"], "integrated-as">, Alias<fintegrated_as>, Flags<[NoXarchOption]>;
+def : Flag<["-"], "integrated-as">, Alias<fintegrated_as>,
+ Flags<[NoXarchOption]>;
def : Flag<["-"], "no-integrated-as">, Alias<fno_integrated_as>,
- Flags<[CC1Option, FlangOption, NoXarchOption]>;
+ Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CC1Option, FlangOption]>;
-def working_directory : Separate<["-"], "working-directory">, Flags<[CC1Option]>,
+def working_directory : Separate<["-"], "working-directory">,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Resolve file paths relative to the specified directory">,
MarshallingInfoString<FileSystemOpts<"WorkingDir">>;
-def working_directory_EQ : Joined<["-"], "working-directory=">, Flags<[CC1Option]>,
+def working_directory_EQ : Joined<["-"], "working-directory=">,
+ Visibility<[ClangOption, CC1Option]>,
Alias<working_directory>;
// Double dash options, which are usually an alias for one of the previous
@@ -4802,10 +5359,13 @@ def _mhwdiv : Separate<["--"], "mhwdiv">, Alias<mhwdiv_EQ>;
def _CLASSPATH_EQ : Joined<["--"], "CLASSPATH=">, Alias<fclasspath_EQ>;
def _CLASSPATH : Separate<["--"], "CLASSPATH">, Alias<fclasspath_EQ>;
def _all_warnings : Flag<["--"], "all-warnings">, Alias<Wall>;
-def _analyzer_no_default_checks : Flag<["--"], "analyzer-no-default-checks">, Flags<[NoXarchOption]>;
-def _analyzer_output : JoinedOrSeparate<["--"], "analyzer-output">, Flags<[NoXarchOption]>,
+def _analyzer_no_default_checks : Flag<["--"], "analyzer-no-default-checks">,
+ Flags<[NoXarchOption]>;
+def _analyzer_output : JoinedOrSeparate<["--"], "analyzer-output">,
+ Flags<[NoXarchOption]>,
HelpText<"Static analyzer report output format (html|plist|plist-multi-file|plist-html|sarif|sarif-html|text).">;
-def _analyze : Flag<["--"], "analyze">, Flags<[NoXarchOption, CoreOption]>,
+def _analyze : Flag<["--"], "analyze">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
HelpText<"Run the static analyzer">;
def _assemble : Flag<["--"], "assemble">, Alias<S>;
def _assert_EQ : Joined<["--"], "assert=">, Alias<A>;
@@ -4882,11 +5442,12 @@ def _profile : Flag<["--"], "profile">, Alias<p>;
def _resource_EQ : Joined<["--"], "resource=">, Alias<fcompile_resource_EQ>;
def _resource : Separate<["--"], "resource">, Alias<fcompile_resource_EQ>;
def _rtlib : Separate<["--"], "rtlib">, Alias<rtlib_EQ>;
-def _serialize_diags : Separate<["-", "--"], "serialize-diagnostics">, Flags<[NoXarchOption]>,
+def _serialize_diags : Separate<["-", "--"], "serialize-diagnostics">,
+ Flags<[NoXarchOption]>,
HelpText<"Serialize compiler diagnostics to a file">;
// We give --version
diff erent semantics from -version.
def _version : Flag<["--"], "version">,
- Flags<[CoreOption, FlangOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption, FlangOption]>,
HelpText<"Print version information">;
def _signed_char : Flag<["--"], "signed-char">, Alias<fsigned_char>;
def _std : Separate<["--"], "std">, Alias<std_EQ>;
@@ -4962,21 +5523,29 @@ def ffixed_r19: Flag<["-"], "ffixed-r19">, Group<f_Group>,
HelpText<"Reserve register r19 (Hexagon only)">;
} // let Flags = [TargetSpecific]
def mmemops : Flag<["-"], "mmemops">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Enable generation of memop instructions">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Enable generation of memop instructions">;
def mno_memops : Flag<["-"], "mno-memops">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Disable generation of memop instructions">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Disable generation of memop instructions">;
def mpackets : Flag<["-"], "mpackets">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Enable generation of instruction packets">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Enable generation of instruction packets">;
def mno_packets : Flag<["-"], "mno-packets">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Disable generation of instruction packets">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Disable generation of instruction packets">;
def mnvj : Flag<["-"], "mnvj">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Enable generation of new-value jumps">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Enable generation of new-value jumps">;
def mno_nvj : Flag<["-"], "mno-nvj">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Disable generation of new-value jumps">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Disable generation of new-value jumps">;
def mnvs : Flag<["-"], "mnvs">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Enable generation of new-value stores">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Enable generation of new-value stores">;
def mno_nvs : Flag<["-"], "mno-nvs">, Group<m_hexagon_Features_Group>,
- Flags<[CC1Option]>, HelpText<"Disable generation of new-value stores">;
+ Visibility<[ClangOption, CC1Option]>,
+ HelpText<"Disable generation of new-value stores">;
def mcabac: Flag<["-"], "mcabac">, Group<m_hexagon_Features_Group>,
HelpText<"Enable CABAC instructions">;
@@ -5244,7 +5813,7 @@ def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group<m_x86_Features_Group>;
// style of double-dash and equals-joined flags.
def target_legacy_spelling : Separate<["-"], "target">,
Alias<target>,
- Flags<[CoreOption]>;
+ Visibility<[ClangOption, CLOption, DXCOption]>;
// Special internal option to handle -Xlinker --no-demangle.
def Z_Xlinker__no_demangle : Flag<["-"], "Z-Xlinker-no-demangle">,
@@ -5256,9 +5825,11 @@ def Zlinker_input : Separate<["-"], "Zlinker-input">,
// Reserved library options.
def Z_reserved_lib_stdcxx : Flag<["-"], "Z-reserved-lib-stdc++">,
- Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>;
+ Flags<[LinkerInput, NoArgumentUnused, Unsupported]>,
+ Group<reserved_lib_Group>;
def Z_reserved_lib_cckext : Flag<["-"], "Z-reserved-lib-cckext">,
- Flags<[LinkerInput, NoArgumentUnused, Unsupported]>, Group<reserved_lib_Group>;
+ Flags<[LinkerInput, NoArgumentUnused, Unsupported]>,
+ Group<reserved_lib_Group>;
// Ignored options
multiclass BooleanFFlag<string name> {
@@ -5276,12 +5847,14 @@ def fprofile_dir : Joined<["-"], "fprofile-dir=">, Group<f_Group>;
// The default value matches BinutilsVersion in MCAsmInfo.h.
def fbinutils_version_EQ : Joined<["-"], "fbinutils-version=">,
- MetaVarName<"<major.minor>">, Group<f_Group>, Flags<[CC1Option]>,
+ MetaVarName<"<major.minor>">, Group<f_Group>,
+ Visibility<[ClangOption, CC1Option]>,
HelpText<"Produced object files can use all ELF features supported by this "
"binutils version and newer. If -fno-integrated-as is specified, the "
"generated assembly will consider GNU as support. 'none' means that all ELF "
"features can be used, regardless of binutils support. Defaults to 2.26.">;
-def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>, Flags<[CoreOption, LinkOption]>;
+def fuse_ld_EQ : Joined<["-"], "fuse-ld=">, Group<f_Group>,
+ Flags<[LinkOption]>, Visibility<[ClangOption, CLOption, DXCOption]>;
def ld_path_EQ : Joined<["--"], "ld-path=">, Group<Link_Group>;
defm align_labels : BooleanFFlag<"align-labels">, Group<clang_ignored_gcc_optimization_f_Group>;
@@ -5297,7 +5870,7 @@ def fdiagnostics_show_location_EQ : Joined<["-"], "fdiagnostics-show-location=">
defm check_new : BoolOption<"f", "check-new",
LangOpts<"CheckNew">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Do not assume C++ operator new may not return NULL">,
- NegFlag<SetFalse>, BothFlags<[CC1Option]>>;
+ NegFlag<SetFalse>, BothFlags<[], [ClangOption, CC1Option]>>;
defm caller_saves : BooleanFFlag<"caller-saves">, Group<clang_ignored_gcc_optimization_f_Group>;
defm reorder_blocks : BooleanFFlag<"reorder-blocks">, Group<clang_ignored_gcc_optimization_f_Group>;
@@ -5328,7 +5901,7 @@ defm ipa_cp : BooleanFFlag<"ipa-cp">,
defm ivopts : BooleanFFlag<"ivopts">, Group<clang_ignored_gcc_optimization_f_Group>;
defm semantic_interposition : BoolFOption<"semantic-interposition",
LangOpts<"SemanticInterposition">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption]>,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option]>,
NegFlag<SetFalse>>,
DocBrief<[{Enable semantic interposition. Semantic interposition allows for the
interposition of a symbol by another at runtime, thus preventing a range of
@@ -5467,9 +6040,11 @@ defm : FlangIgnoredDiagOpt<"frontend-loop-interchange">;
defm : FlangIgnoredDiagOpt<"target-lifetime">;
// C++ SYCL options
-def fsycl : Flag<["-"], "fsycl">, Flags<[NoXarchOption, CoreOption]>,
+def fsycl : Flag<["-"], "fsycl">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
Group<sycl_Group>, HelpText<"Enables SYCL kernels compilation for device">;
-def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>,
+def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption, DXCOption]>,
Group<sycl_Group>, HelpText<"Disables SYCL kernels compilation for device">;
//===----------------------------------------------------------------------===//
@@ -5477,11 +6052,11 @@ def fno_sycl : Flag<["-"], "fno-sycl">, Flags<[NoXarchOption, CoreOption]>,
//===----------------------------------------------------------------------===//
def flang_experimental_hlfir : Flag<["-"], "flang-experimental-hlfir">,
- Flags<[FlangOption, FC1Option, FlangOnlyOption, NoXarchOption, HelpHidden]>,
+ Flags<[NoXarchOption, HelpHidden]>, Visibility<[FlangOption, FC1Option]>,
HelpText<"Use HLFIR lowering (experimental)">;
def flang_experimental_polymorphism : Flag<["-"], "flang-experimental-polymorphism">,
- Flags<[FlangOption, FC1Option, FlangOnlyOption, NoXarchOption, HelpHidden]>,
+ Flags<[NoXarchOption, HelpHidden]>, Visibility<[FlangOption, FC1Option]>,
HelpText<"Enable Fortran 2003 polymorphism (experimental)">;
@@ -5491,14 +6066,14 @@ def flang_experimental_polymorphism : Flag<["-"], "flang-experimental-polymorphi
def Xflang : Separate<["-"], "Xflang">,
HelpText<"Pass <arg> to the flang compiler">, MetaVarName<"<arg>">,
- Flags<[FlangOption, FlangOnlyOption, NoXarchOption, CoreOption]>,
+ Flags<[NoXarchOption]>, Visibility<[FlangOption, CLOption, DXCOption]>,
Group<CompileOnly_Group>;
//===----------------------------------------------------------------------===//
// FlangOption and FC1 Options
//===----------------------------------------------------------------------===//
-let Flags = [FC1Option, FlangOption, FlangOnlyOption] in {
+let Visibility = [FC1Option, FlangOption] in {
def cpp : Flag<["-"], "cpp">, Group<f_Group>,
HelpText<"Enable predefined and command line preprocessor macros">;
@@ -5557,10 +6132,10 @@ defm stack_arrays : BoolOptionWithoutMarshalling<"f", "stack-arrays",
defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stride",
PosFlag<SetTrue, [], [ClangOption], "Create unit-strided versions of loops">,
NegFlag<SetFalse, [], [ClangOption], "Do not create unit-strided loops (default)">>;
-} // let Flags = [FC1Option, FlangOption, FlangOnlyOption]
+} // let Visibility = [FC1Option, FlangOption]
def J : JoinedOrSeparate<["-"], "J">,
- Flags<[RenderJoined, FlangOption, FC1Option, FlangOnlyOption]>,
+ Flags<[RenderJoined]>, Visibility<[FlangOption, FC1Option]>,
Group<gfortran_Group>,
Alias<module_dir>;
@@ -5568,7 +6143,7 @@ def J : JoinedOrSeparate<["-"], "J">,
// FC1 Options
//===----------------------------------------------------------------------===//
-let Flags = [FC1Option, FlangOnlyOption] in {
+let Visibility = [FC1Option] in {
def fget_definition : MultiArg<["-"], "fget-definition", 3>,
HelpText<"Get the symbol definition from <line> <start-column> <end-column>">,
@@ -5625,13 +6200,13 @@ def emit_mlir : Flag<["-"], "emit-mlir">, Alias<emit_fir>;
def emit_hlfir : Flag<["-"], "emit-hlfir">, Group<Action_Group>,
HelpText<"Build the parse tree, then lower it to HLFIR">;
-} // let Flags = [FC1Option, FlangOnlyOption]
+} // let Visibility = [FC1Option]
//===----------------------------------------------------------------------===//
// Target Options (cc1 + cc1as)
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
+let Visibility = [CC1Option, CC1AsOption] in {
def tune_cpu : Separate<["-"], "tune-cpu">,
HelpText<"Tune for a specific cpu type">,
@@ -5645,22 +6220,22 @@ def darwin_target_variant_sdk_version_EQ : Joined<["-"],
"darwin-target-variant-sdk-version=">,
HelpText<"The version of darwin target variant SDK used for compilation">;
-} // let Flags = [CC1Option, CC1AsOption, NoDriverOption]
+} // let Visibility = [CC1Option, CC1AsOption]
-let Flags = [CC1Option, CC1AsOption] in {
+let Visibility = [ClangOption, CC1Option, CC1AsOption] in {
def darwin_target_variant_triple : Separate<["-"], "darwin-target-variant-triple">,
HelpText<"Specify the darwin target variant triple">,
MarshallingInfoString<TargetOpts<"DarwinTargetVariantTriple">>,
Normalizer<"normalizeTriple">;
-} // let Flags = [CC1Option, CC1AsOption]
+} // let Visibility = [ClangOption, CC1Option, CC1AsOption]
//===----------------------------------------------------------------------===//
// Target Options (cc1 + cc1as + fc1)
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, CC1AsOption, FC1Option, NoDriverOption] in {
+let Visibility = [CC1Option, CC1AsOption, FC1Option] in {
def target_cpu : Separate<["-"], "target-cpu">,
HelpText<"Target a specific cpu type">,
@@ -5673,13 +6248,13 @@ def triple : Separate<["-"], "triple">,
MarshallingInfoString<TargetOpts<"Triple">, "llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple())">,
AlwaysEmit, Normalizer<"normalizeTriple">;
-} // let Flags = [CC1Option, CC1AsOption, FC1Option, NoDriverOption]
+} // let Visibility = [CC1Option, CC1AsOption, FC1Option]
//===----------------------------------------------------------------------===//
// Target Options (other)
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def target_linker_version : Separate<["-"], "target-linker-version">,
HelpText<"Target linker version">,
@@ -5695,13 +6270,13 @@ defm padding_on_unsigned_fixed_point : BoolOption<"f", "padding-on-unsigned-fixe
NegFlag<SetFalse>>,
ShouldParseIf<ffixed_point.KeyPath>;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Analyzer Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def analysis_UnoptimizedCFG : Flag<["-"], "unoptimized-cfg">,
HelpText<"Generate unoptimized CFGs for all analyses">,
@@ -5846,7 +6421,7 @@ def analyzer_werror : Flag<["-"], "analyzer-werror">,
HelpText<"Emit analyzer results as errors rather than warnings">,
MarshallingInfoFlag<AnalyzerOpts<"AnalyzerWerror">>;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Migrator Options
@@ -5854,19 +6429,19 @@ def analyzer_werror : Flag<["-"], "analyzer-werror">,
def migrator_no_nsalloc_error : Flag<["-"], "no-ns-alloc-error">,
HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">,
- Flags<[CC1Option, NoDriverOption]>,
+ Visibility<[CC1Option]>,
MarshallingInfoFlag<MigratorOpts<"NoNSAllocReallocError">>;
def migrator_no_finalize_removal : Flag<["-"], "no-finalize-removal">,
HelpText<"Do not remove finalize method in gc mode">,
- Flags<[CC1Option, NoDriverOption]>,
+ Visibility<[CC1Option]>,
MarshallingInfoFlag<MigratorOpts<"NoFinalizeRemoval">>;
//===----------------------------------------------------------------------===//
// CodeGen Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, CC1AsOption, FC1Option, NoDriverOption] in {
+let Visibility = [CC1Option, CC1AsOption, FC1Option] in {
def mrelocation_model : Separate<["-"], "mrelocation-model">,
HelpText<"The relocation model to use">, Values<"static,pic,ropi,rwpi,ropi-rwpi,dynamic-no-pic">,
@@ -5875,9 +6450,9 @@ def mrelocation_model : Separate<["-"], "mrelocation-model">,
MarshallingInfoEnum<CodeGenOpts<"RelocationModel">, "PIC_">;
def debug_info_kind_EQ : Joined<["-"], "debug-info-kind=">;
-} // let Flags = [CC1Option, CC1AsOption, FC1Option, NoDriverOption]
+} // let Visibility = [CC1Option, CC1AsOption, FC1Option]
-let Flags = [CC1Option, CC1AsOption, NoDriverOption] in {
+let Visibility = [CC1Option, CC1AsOption] in {
def debug_info_macro : Flag<["-"], "debug-info-macro">,
HelpText<"Emit macro debug information">,
@@ -5934,9 +6509,9 @@ def as_secure_log_file : Separate<["-"], "as-secure-log-file">,
HelpText<"Emit .secure_log_unique directives to this filename.">,
MarshallingInfoString<CodeGenOpts<"AsSecureLogFile">>;
-} // let Flags = [CC1Option, CC1AsOption, NoDriverOption]
+} // let Visibility = [CC1Option, CC1AsOption]
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def llvm_verify_each : Flag<["-"], "llvm-verify-each">,
HelpText<"Run the LLVM verifier after every LLVM pass">,
@@ -6044,7 +6619,8 @@ defm constructor_aliases : BoolOption<"m", "constructor-aliases",
CodeGenOpts<"CXXCtorDtorAliases">, DefaultFalse,
PosFlag<SetTrue, [], [ClangOption], "Enable">,
NegFlag<SetFalse, [], [ClangOption], "Disable">,
- BothFlags<[CC1Option], [ClangOption], " emitting complete constructors and destructors as aliases when possible">>;
+ BothFlags<[], [ClangOption, CC1Option],
+ " emitting complete constructors and destructors as aliases when possible">>;
def mlink_bitcode_file : Separate<["-"], "mlink-bitcode-file">,
HelpText<"Link the given bitcode file before performing optimizations.">;
def mlink_builtin_bitcode : Separate<["-"], "mlink-builtin-bitcode">,
@@ -6164,7 +6740,8 @@ def flto_visibility_public_std:
MarshallingInfoFlag<CodeGenOpts<"LTOVisibilityPublicStd">>;
defm lto_unit : BoolOption<"f", "lto-unit",
CodeGenOpts<"LTOUnit">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Emit IR to support LTO unit features (CFI, whole program vtable opt)">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option],
+ "Emit IR to support LTO unit features (CFI, whole program vtable opt)">,
NegFlag<SetFalse>>;
def fverify_debuginfo_preserve
: Flag<["-"], "fverify-debuginfo-preserve">,
@@ -6214,13 +6791,13 @@ def fexperimental_assignment_tracking_EQ : Joined<["-"], "fexperimental-assignme
Values<"disabled,enabled,forced">, NormalizedValues<["Disabled","Enabled","Forced"]>,
MarshallingInfoEnum<CodeGenOpts<"AssignmentTrackingMode">, "Enabled">;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Dependency Output Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def sys_header_deps : Flag<["-"], "sys-header-deps">,
HelpText<"Include system headers in dependency output">,
@@ -6245,13 +6822,13 @@ def header_include_filtering_EQ : Joined<["-"], "header-include-filtering=">,
def show_includes : Flag<["--"], "show-includes">,
HelpText<"Print cl.exe style /showIncludes to stdout">;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Diagnostic Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def diagnostic_log_file : Separate<["-"], "diagnostic-log-file">,
HelpText<"Filename (or -) to log diagnostics to">,
@@ -6293,13 +6870,13 @@ def Wno_rewrite_macros : Flag<["-"], "Wno-rewrite-macros">,
HelpText<"Silence ObjC rewriting warnings">,
MarshallingInfoFlag<DiagnosticOpts<"NoRewriteMacros">>;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Frontend Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
// This isn't normally used, it is just here so we can parse a
// CompilerInvocation out of a driver-derived argument vector.
@@ -6526,7 +7103,7 @@ def mt_migrate_directory : Separate<["-"], "mt-migrate-directory">,
HelpText<"Directory for temporary files produced during ARC or ObjC migration">,
MarshallingInfoString<FrontendOpts<"MTMigrateDir">>;
-def arcmt_action_EQ : Joined<["-"], "arcmt-action=">, Flags<[CC1Option, NoDriverOption]>,
+def arcmt_action_EQ : Joined<["-"], "arcmt-action=">, Visibility<[CC1Option]>,
HelpText<"The ARC migration action to take">,
Values<"check,modify,migrate">,
NormalizedValuesScope<"FrontendOptions">,
@@ -6592,7 +7169,7 @@ def aligned_alloc_unavailable : Flag<["-"], "faligned-alloc-unavailable">,
MarshallingInfoFlag<LangOpts<"AlignedAllocationUnavailable">>,
ShouldParseIf<faligned_allocation.KeyPath>;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Language Options
@@ -6600,19 +7177,19 @@ def aligned_alloc_unavailable : Flag<["-"], "faligned-alloc-unavailable">,
def version : Flag<["-"], "version">,
HelpText<"Print the compiler version">,
- Flags<[CC1Option, CC1AsOption, FC1Option, NoDriverOption]>,
+ Visibility<[CC1Option, CC1AsOption, FC1Option]>,
MarshallingInfoFlag<FrontendOpts<"ShowVersion">>;
def main_file_name : Separate<["-"], "main-file-name">,
HelpText<"Main file name to use for debug info and source if missing">,
- Flags<[CC1Option, CC1AsOption, NoDriverOption]>,
+ Visibility<[CC1Option, CC1AsOption]>,
MarshallingInfoString<CodeGenOpts<"MainFileName">>;
def split_dwarf_output : Separate<["-"], "split-dwarf-output">,
HelpText<"File name to use for split dwarf debug info output">,
- Flags<[CC1Option, CC1AsOption, NoDriverOption]>,
+ Visibility<[CC1Option, CC1AsOption]>,
MarshallingInfoString<CodeGenOpts<"SplitDwarfOutput">>;
-let Flags = [CC1Option, FC1Option, NoDriverOption] in {
+let Visibility = [CC1Option, FC1Option] in {
def mreassociate : Flag<["-"], "mreassociate">,
HelpText<"Allow reassociation transformations for floating-point instructions">,
@@ -6631,9 +7208,9 @@ def pic_is_pie : Flag<["-"], "pic-is-pie">,
HelpText<"File is for a position independent executable">,
MarshallingInfoFlag<LangOpts<"PIE">>;
-} // let Flags = [CC1Option, FC1Option, NoDriverOption]
+} // let Visibility = [CC1Option, FC1Option]
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def fblocks_runtime_optional : Flag<["-"], "fblocks-runtime-optional">,
HelpText<"Weakly link in the blocks runtime">,
@@ -6724,7 +7301,7 @@ def fbracket_depth : Separate<["-"], "fbracket-depth">,
MarshallingInfoInt<LangOpts<"BracketDepth">, "256">;
defm const_strings : BoolOption<"f", "const-strings",
LangOpts<"ConstStrings">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
NegFlag<SetFalse, [], [ClangOption], "Don't use">,
BothFlags<[], [ClangOption], " a const qualified type for string literals in C and ObjC">>;
def fno_bitfield_type_align : Flag<["-"], "fno-bitfield-type-align">,
@@ -6794,7 +7371,7 @@ def fwchar_type_EQ : Joined<["-"], "fwchar-type=">,
MarshallingInfoEnum<LangOpts<"WCharSize">, "0">;
defm signed_wchar : BoolOption<"f", "signed-wchar",
LangOpts<"WCharIsSigned">, DefaultTrue,
- NegFlag<SetFalse, [CC1Option], [ClangOption], "Use an unsigned">,
+ NegFlag<SetFalse, [], [ClangOption, CC1Option], "Use an unsigned">,
PosFlag<SetTrue, [], [ClangOption], "Use a signed">,
BothFlags<[], [ClangOption], " type for wchar_t">>;
def fcompatibility_qualified_id_block_param_type_checking : Flag<["-"], "fcompatibility-qualified-id-block-type-checking">,
@@ -6818,13 +7395,13 @@ def fexperimental_max_bitint_width_EQ:
HelpText<"Set the maximum bitwidth for _BitInt (this option is expected to be removed in the future)">,
MarshallingInfoInt<LangOpts<"MaxBitIntWidth">>;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Header Search Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def nostdsysteminc : Flag<["-"], "nostdsysteminc">,
HelpText<"Disable standard system #include directories">,
@@ -6859,13 +7436,13 @@ def internal_externc_isystem : Separate<["-"], "internal-externc-isystem">,
"user-provided and are used to model system and standard headers' "
"paths.">;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// Preprocessor Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def chain_include : Separate<["-"], "chain-include">, MetaVarName<"<file>">,
HelpText<"Include and chain a header file after turning it into PCH">;
@@ -6885,13 +7462,13 @@ def source_date_epoch : Separate<["-"], "source-date-epoch">,
MetaVarName<"<time since Epoch in seconds>">,
HelpText<"Time to be used in __DATE__, __TIME__, and __TIMESTAMP__ macros">;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// CUDA Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, NoDriverOption] in {
+let Visibility = [CC1Option] in {
def fcuda_is_device : Flag<["-"], "fcuda-is-device">,
HelpText<"Generate code for CUDA device">,
@@ -6906,13 +7483,13 @@ def fno_cuda_host_device_constexpr : Flag<["-"], "fno-cuda-host-device-constexpr
HelpText<"Don't treat unattributed constexpr functions as __host__ __device__.">,
MarshallingInfoNegativeFlag<LangOpts<"CUDAHostDeviceConstexpr">>;
-} // let Flags = [CC1Option, NoDriverOption]
+} // let Visibility = [CC1Option]
//===----------------------------------------------------------------------===//
// OpenMP Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, FC1Option, NoDriverOption] in {
+let Visibility = [CC1Option, FC1Option] in {
def fopenmp_is_target_device : Flag<["-"], "fopenmp-is-target-device">,
HelpText<"Generate code only for an OpenMP target device.">;
@@ -6920,7 +7497,7 @@ def : Flag<["-"], "fopenmp-is-device">, Alias<fopenmp_is_target_device>;
def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
HelpText<"Path to the IR file produced by the frontend for the host.">;
-} // let Flags = [CC1Option, FC1Option, NoDriverOption]
+} // let Visibility = [CC1Option, FC1Option]
//===----------------------------------------------------------------------===//
// SYCL Options
@@ -6928,15 +7505,16 @@ def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
def fsycl_is_device : Flag<["-"], "fsycl-is-device">,
HelpText<"Generate code for SYCL device.">,
- Flags<[CC1Option, NoDriverOption]>,
+ Visibility<[CC1Option]>,
MarshallingInfoFlag<LangOpts<"SYCLIsDevice">>;
def fsycl_is_host : Flag<["-"], "fsycl-is-host">,
HelpText<"SYCL host compilation">,
- Flags<[CC1Option, NoDriverOption]>,
+ Visibility<[CC1Option]>,
MarshallingInfoFlag<LangOpts<"SYCLIsHost">>;
def sycl_std_EQ : Joined<["-"], "sycl-std=">, Group<sycl_Group>,
- Flags<[CC1Option, NoArgumentUnused, CoreOption]>,
+ Flags<[NoArgumentUnused]>,
+ Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
HelpText<"SYCL language standard to compile for.">,
Values<"2020,2017,121,1.2.1,sycl-1.2.1">,
NormalizedValues<["SYCL_2020", "SYCL_2017", "SYCL_2017", "SYCL_2017", "SYCL_2017"]>,
@@ -6946,7 +7524,7 @@ def sycl_std_EQ : Joined<["-"], "sycl-std=">, Group<sycl_Group>,
defm gpu_approx_transcendentals : BoolFOption<"gpu-approx-transcendentals",
LangOpts<"GPUDeviceApproxTranscendentals">, DefaultFalse,
- PosFlag<SetTrue, [CC1Option], [ClangOption], "Use">,
+ PosFlag<SetTrue, [], [ClangOption, CC1Option], "Use">,
NegFlag<SetFalse, [], [ClangOption], "Don't use">,
BothFlags<[], [ClangOption], " approximate transcendental functions">>;
def : Flag<["-"], "fcuda-approx-transcendentals">, Alias<fgpu_approx_transcendentals>;
@@ -6956,7 +7534,7 @@ def : Flag<["-"], "fno-cuda-approx-transcendentals">, Alias<fno_gpu_approx_trans
// Frontend Options - cc1 + fc1
//===----------------------------------------------------------------------===//
-let Flags = [CC1Option, FC1Option, NoDriverOption] in {
+let Visibility = [CC1Option, FC1Option] in {
let Group = Action_Group in {
def emit_obj : Flag<["-"], "emit-obj">,
@@ -6985,13 +7563,13 @@ def opt_record_passes : Separate<["-"], "opt-record-passes">,
def opt_record_format : Separate<["-"], "opt-record-format">,
HelpText<"The format used for serializing remarks (default: YAML)">;
-} // let Flags = [CC1Option, FC1Option, NoDriverOption]
+} // let Visibility = [CC1Option, FC1Option]
//===----------------------------------------------------------------------===//
// cc1as-only Options
//===----------------------------------------------------------------------===//
-let Flags = [CC1AsOption, NoDriverOption] in {
+let Visibility = [CC1AsOption] in {
// Language Options
def n : Flag<["-"], "n">,
@@ -7016,7 +7594,7 @@ def dwarf_debug_producer : Separate<["-"], "dwarf-debug-producer">,
def defsym : Separate<["-"], "defsym">,
HelpText<"Define a value for a symbol">;
-} // let Flags = [CC1AsOption, NoDriverOption]
+} // let Visibility = [CC1AsOption]
//===----------------------------------------------------------------------===//
// clang-cl Options
@@ -7032,41 +7610,45 @@ def cl_ignored_Group : OptionGroup<"<clang-cl ignored options>">,
Group<cl_Group>;
class CLFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
- Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
+ Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
class CLDXCFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
- Group<cl_Group>, Flags<[CLDXCOption, NoXarchOption]>;
+ Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption, DXCOption]>;
class CLCompileFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
- Group<cl_compile_Group>, Flags<[CLOption, NoXarchOption]>;
+ Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
class CLIgnoredFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
- Group<cl_ignored_Group>, Flags<[CLOption, NoXarchOption]>;
+ Group<cl_ignored_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
class CLJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
- Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
+ Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
class CLDXCJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
- Group<cl_Group>, Flags<[CLDXCOption, NoXarchOption]>;
+ Group<cl_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption, DXCOption]>;
class CLCompileJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
- Group<cl_compile_Group>, Flags<[CLOption, NoXarchOption]>;
+ Group<cl_compile_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>;
class CLIgnoredJoined<string name> : Option<["/", "-"], name, KIND_JOINED>,
- Group<cl_ignored_Group>, Flags<[CLOption, NoXarchOption, HelpHidden]>;
+ Group<cl_ignored_Group>, Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[CLOption]>;
class CLJoinedOrSeparate<string name> : Option<["/", "-"], name,
- KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
+ KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[NoXarchOption]>,
+ Visibility<[CLOption]>;
class CLDXCJoinedOrSeparate<string name> : Option<["/", "-"], name,
- KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[CLDXCOption, NoXarchOption]>;
+ KIND_JOINED_OR_SEPARATE>, Group<cl_Group>, Flags<[NoXarchOption]>,
+ Visibility<[CLOption, DXCOption]>;
class CLCompileJoinedOrSeparate<string name> : Option<["/", "-"], name,
KIND_JOINED_OR_SEPARATE>, Group<cl_compile_Group>,
- Flags<[CLOption, NoXarchOption]>;
+ Flags<[NoXarchOption]>, Visibility<[CLOption]>;
class CLRemainingArgsJoined<string name> : Option<["/", "-"], name,
- KIND_REMAINING_ARGS_JOINED>, Group<cl_Group>, Flags<[CLOption, NoXarchOption]>;
+ KIND_REMAINING_ARGS_JOINED>, Group<cl_Group>, Flags<[NoXarchOption]>,
+ Visibility<[CLOption]>;
// Aliases:
// (We don't put any of these in cl_compile_Group as the options they alias are
@@ -7357,13 +7939,16 @@ def _SLASH_LDd : CLFlag<"LDd">, HelpText<"Create debug DLL">;
def _SLASH_link : CLRemainingArgsJoined<"link">,
HelpText<"Forward options to the linker">, MetaVarName<"<options>">;
def _SLASH_MD : Option<["/", "-"], "MD", KIND_FLAG>, Group<_SLASH_M_Group>,
- Flags<[CLOption, NoXarchOption]>, HelpText<"Use DLL run-time">;
+ Flags<[NoXarchOption]>, Visibility<[CLOption]>, HelpText<"Use DLL run-time">;
def _SLASH_MDd : Option<["/", "-"], "MDd", KIND_FLAG>, Group<_SLASH_M_Group>,
- Flags<[CLOption, NoXarchOption]>, HelpText<"Use DLL debug run-time">;
+ Flags<[NoXarchOption]>, Visibility<[CLOption]>,
+ HelpText<"Use DLL debug run-time">;
def _SLASH_MT : Option<["/", "-"], "MT", KIND_FLAG>, Group<_SLASH_M_Group>,
- Flags<[CLOption, NoXarchOption]>, HelpText<"Use static run-time">;
+ Flags<[NoXarchOption]>, Visibility<[CLOption]>,
+ HelpText<"Use static run-time">;
def _SLASH_MTd : Option<["/", "-"], "MTd", KIND_FLAG>, Group<_SLASH_M_Group>,
- Flags<[CLOption, NoXarchOption]>, HelpText<"Use static debug run-time">;
+ Flags<[NoXarchOption]>, Visibility<[CLOption]>,
+ HelpText<"Use static debug run-time">;
def _SLASH_o : CLJoinedOrSeparate<"o">,
HelpText<"Deprecated (set output file name); use /Fe or /Fe">,
MetaVarName<"<file or dir/>">;
@@ -7392,7 +7977,7 @@ def _SLASH_winsysroot : CLJoinedOrSeparate<"winsysroot">,
HelpText<"Same as \"/diasdkdir <dir>/DIA SDK\" /vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsversion> \"/winsdkdir <dir>/Windows Kits/10\"">,
MetaVarName<"<dir>">;
def _SLASH_volatile_iso : Option<["/", "-"], "volatile:iso", KIND_FLAG>,
- Group<_SLASH_volatile_Group>, Flags<[CLOption, NoXarchOption]>,
+ Group<_SLASH_volatile_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>,
HelpText<"Volatile loads and stores have standard semantics">;
def _SLASH_vmb : CLFlag<"vmb">,
HelpText<"Use a best-case representation method for member pointers">;
@@ -7407,7 +7992,7 @@ def _SLASH_vmv : CLFlag<"vmv">,
HelpText<"Set the default most-general representation to "
"virtual inheritance">;
def _SLASH_volatile_ms : Option<["/", "-"], "volatile:ms", KIND_FLAG>,
- Group<_SLASH_volatile_Group>, Flags<[CLOption, NoXarchOption]>,
+ Group<_SLASH_volatile_Group>, Flags<[NoXarchOption]>, Visibility<[CLOption]>,
HelpText<"Volatile loads and stores have acquire and release semantics">;
def _SLASH_clang : CLJoined<"clang:">,
HelpText<"Pass <arg> to the clang driver">, MetaVarName<"<arg>">;
@@ -7559,22 +8144,25 @@ def _SLASH_ZW : CLJoined<"ZW">;
// clang-dxc Options
//===----------------------------------------------------------------------===//
-def dxc_Group : OptionGroup<"<clang-dxc options>">, Flags<[DXCOption]>,
+def dxc_Group : OptionGroup<"<clang-dxc options>">, Visibility<[DXCOption]>,
HelpText<"dxc compatibility options">;
class DXCFlag<string name> : Option<["/", "-"], name, KIND_FLAG>,
- Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>;
+ Group<dxc_Group>, Flags<[NoXarchOption]>, Visibility<[DXCOption]>;
class DXCJoinedOrSeparate<string name> : Option<["/", "-"], name,
- KIND_JOINED_OR_SEPARATE>, Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>;
+ KIND_JOINED_OR_SEPARATE>, Group<dxc_Group>, Flags<[NoXarchOption]>,
+ Visibility<[DXCOption]>;
def dxc_help : Option<["/", "-", "--"], "help", KIND_JOINED>,
- Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>, Alias<help>,
+ Group<dxc_Group>, Flags<[NoXarchOption]>, Visibility<[DXCOption]>,
+ Alias<help>,
HelpText<"Display available options">;
def dxc_no_stdinc : DXCFlag<"hlsl-no-stdinc">,
HelpText<"HLSL only. Disables all standard includes containing non-native compiler types and functions.">;
def Fo : DXCJoinedOrSeparate<"Fo">, Alias<o>,
HelpText<"Output object file">;
def dxil_validator_version : Option<["/", "-"], "validator-version", KIND_SEPARATE>,
- Group<dxc_Group>, Flags<[DXCOption, NoXarchOption, CC1Option, HelpHidden]>,
+ Group<dxc_Group>, Flags<[NoXarchOption, HelpHidden]>,
+ Visibility<[DXCOption, ClangOption, CC1Option]>,
HelpText<"Override validator version for module. Format: <major.minor>;"
"Default: DXIL.dll version or current internal version">,
MarshallingInfoString<TargetOpts<"DxilValidatorVersion">>;
@@ -7590,7 +8178,7 @@ def target_profile : DXCJoinedOrSeparate<"T">, MetaVarName<"<profile>">,
"ms_6_5, ms_6_6, ms_6_7,"
"as_6_5, as_6_6, as_6_7">;
def dxc_D : Option<["--", "/", "-"], "D", KIND_JOINED_OR_SEPARATE>,
- Group<dxc_Group>, Flags<[DXCOption, NoXarchOption]>, Alias<D>;
+ Group<dxc_Group>, Flags<[NoXarchOption]>, Visibility<[DXCOption]>, Alias<D>;
def emit_pristine_llvm : DXCFlag<"emit-pristine-llvm">,
HelpText<"Emit pristine LLVM IR from the frontend by not running any LLVM passes at all."
"Same as -S + -emit-llvm + -disable-llvm-passes.">;
@@ -7600,12 +8188,12 @@ def enable_16bit_types : DXCFlag<"enable-16bit-types">, Alias<fnative_half_type>
"Available in HLSL 2018 and shader model 6.2.">;
def hlsl_entrypoint : Option<["-"], "hlsl-entry", KIND_SEPARATE>,
Group<dxc_Group>,
- Flags<[CC1Option]>,
+ Visibility<[ClangOption, CC1Option]>,
MarshallingInfoString<TargetOpts<"HLSLEntry">, "\"main\"">,
HelpText<"Entry point name for hlsl">;
def dxc_entrypoint : Option<["--", "/", "-"], "E", KIND_JOINED_OR_SEPARATE>,
Group<dxc_Group>,
- Flags<[DXCOption, NoXarchOption]>,
+ Flags<[NoXarchOption]>, Visibility<[DXCOption]>,
HelpText<"Entry point name">;
def dxc_validator_path_EQ : Joined<["--"], "dxv-path=">, Group<dxc_Group>,
HelpText<"DXIL validator installation path">;
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 150040cc9dd2e4..3947ae949014d7 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -254,25 +254,14 @@ void Driver::setDriverMode(StringRef Value) {
}
InputArgList Driver::ParseArgStrings(ArrayRef<const char *> ArgStrings,
- bool IsClCompatMode,
- bool &ContainsError) {
+ bool UseDriverMode, bool &ContainsError) {
llvm::PrettyStackTraceString CrashInfo("Command line argument parsing");
ContainsError = false;
- unsigned IncludedFlagsBitmask;
- unsigned ExcludedFlagsBitmask;
- std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) =
- getIncludeExcludeOptionFlagMasks(IsClCompatMode);
-
- // Make sure that Flang-only options don't pollute the Clang output
- // TODO: Make sure that Clang-only options don't pollute Flang output
- if (!IsFlangMode())
- ExcludedFlagsBitmask |= options::FlangOnlyOption;
-
+ llvm::opt::Visibility VisibilityMask = getOptionVisibilityMask(UseDriverMode);
unsigned MissingArgIndex, MissingArgCount;
- InputArgList Args =
- getOpts().ParseArgs(ArgStrings, MissingArgIndex, MissingArgCount,
- IncludedFlagsBitmask, ExcludedFlagsBitmask);
+ InputArgList Args = getOpts().ParseArgs(ArgStrings, MissingArgIndex,
+ MissingArgCount, VisibilityMask);
// Check for missing argument error.
if (MissingArgCount) {
@@ -306,10 +295,10 @@ InputArgList Driver::ParseArgStrings(ArrayRef<const char *> ArgStrings,
unsigned DiagID;
auto ArgString = A->getAsString(Args);
std::string Nearest;
- if (getOpts().findNearest(ArgString, Nearest, IncludedFlagsBitmask,
- ExcludedFlagsBitmask) > 1) {
+ if (getOpts().findNearest(ArgString, Nearest, VisibilityMask) > 1) {
if (!IsCLMode() &&
- getOpts().findExact(ArgString, Nearest, options::CC1Option)) {
+ getOpts().findExact(ArgString, Nearest,
+ llvm::opt::Visibility(options::CC1Option))) {
DiagID = diag::err_drv_unknown_argument_with_suggestion;
Diags.Report(DiagID) << ArgString << "-Xclang " + Nearest;
} else {
@@ -334,8 +323,7 @@ InputArgList Driver::ParseArgStrings(ArrayRef<const char *> ArgStrings,
// Warn on joined arguments that are similar to a long argument.
std::string ArgString = ArgStrings[A->getIndex()];
std::string Nearest;
- if (getOpts().findExact("-" + ArgString, Nearest, IncludedFlagsBitmask,
- ExcludedFlagsBitmask))
+ if (getOpts().findExact("-" + ArgString, Nearest, VisibilityMask))
Diags.Report(diag::warn_drv_potentially_misspelled_joined_argument)
<< A->getAsString(Args) << Nearest;
}
@@ -1021,7 +1009,7 @@ bool Driver::readConfigFile(StringRef FileName,
llvm::sys::path::native(CfgFileName);
bool ContainErrors;
std::unique_ptr<InputArgList> NewOptions = std::make_unique<InputArgList>(
- ParseArgStrings(NewCfgArgs, IsCLMode(), ContainErrors));
+ ParseArgStrings(NewCfgArgs, /*UseDriverMode=*/true, ContainErrors));
if (ContainErrors)
return true;
@@ -1212,7 +1200,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// Arguments specified in command line.
bool ContainsError;
CLOptions = std::make_unique<InputArgList>(
- ParseArgStrings(ArgList.slice(1), IsCLMode(), ContainsError));
+ ParseArgStrings(ArgList.slice(1), /*UseDriverMode=*/true, ContainsError));
// Try parsing configuration file.
if (!ContainsError)
@@ -1245,7 +1233,8 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// Parse any pass through args using default clang processing rather
// than clang-cl processing.
auto CLModePassThroughOptions = std::make_unique<InputArgList>(
- ParseArgStrings(CLModePassThroughArgList, false, ContainsError));
+ ParseArgStrings(CLModePassThroughArgList, /*UseDriverMode=*/false,
+ ContainsError));
if (!ContainsError)
for (auto *Opt : *CLModePassThroughOptions) {
@@ -1943,24 +1932,18 @@ int Driver::ExecuteCompilation(
}
void Driver::PrintHelp(bool ShowHidden) const {
- unsigned IncludedFlagsBitmask;
- unsigned ExcludedFlagsBitmask;
- std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) =
- getIncludeExcludeOptionFlagMasks(IsCLMode());
-
- ExcludedFlagsBitmask |= options::NoDriverOption;
- if (!ShowHidden)
- ExcludedFlagsBitmask |= HelpHidden;
+ llvm::opt::Visibility VisibilityMask = getOptionVisibilityMask();
+ // TODO: We're overriding the mask for flang here to keep this NFC for the
+ // option refactoring, but what we really need to do is annotate the flags
+ // that Flang uses.
if (IsFlangMode())
- IncludedFlagsBitmask |= options::FlangOption;
- else
- ExcludedFlagsBitmask |= options::FlangOnlyOption;
+ VisibilityMask = llvm::opt::Visibility(options::FlangOption);
std::string Usage = llvm::formatv("{0} [options] file...", Name).str();
getOpts().printHelp(llvm::outs(), Usage.c_str(), DriverTitle.c_str(),
- IncludedFlagsBitmask, ExcludedFlagsBitmask,
- /*ShowAllAliases=*/false);
+ ShowHidden, /*ShowAllAliases=*/false,
+ VisibilityMask);
}
void Driver::PrintVersion(const Compilation &C, raw_ostream &OS) const {
@@ -2008,13 +1991,12 @@ void Driver::HandleAutocompletions(StringRef PassedFlags) const {
std::vector<std::string> SuggestedCompletions;
std::vector<std::string> Flags;
- unsigned int DisableFlags =
- options::NoDriverOption | options::Unsupported | options::Ignored;
+ llvm::opt::Visibility VisibilityMask(options::ClangOption);
// Make sure that Flang-only options don't pollute the Clang output
// TODO: Make sure that Clang-only options don't pollute Flang output
- if (!IsFlangMode())
- DisableFlags |= options::FlangOnlyOption;
+ if (IsFlangMode())
+ VisibilityMask = llvm::opt::Visibility(options::FlangOption);
// Distinguish "--autocomplete=-someflag" and "--autocomplete=-someflag,"
// because the latter indicates that the user put space before pushing tab
@@ -2033,7 +2015,7 @@ void Driver::HandleAutocompletions(StringRef PassedFlags) const {
// We want to show cc1-only options only when clang is invoked with -cc1 or
// -Xclang.
if (llvm::is_contained(Flags, "-Xclang") || llvm::is_contained(Flags, "-cc1"))
- DisableFlags &= ~options::NoDriverOption;
+ VisibilityMask = llvm::opt::Visibility(options::CC1Option);
const llvm::opt::OptTable &Opts = getOpts();
StringRef Cur;
@@ -2063,7 +2045,9 @@ void Driver::HandleAutocompletions(StringRef PassedFlags) const {
// If the flag is in the form of "--autocomplete=-foo",
// we were requested to print out all option names that start with "-foo".
// For example, "--autocomplete=-fsyn" is expanded to "-fsyntax-only".
- SuggestedCompletions = Opts.findByPrefix(Cur, DisableFlags);
+ SuggestedCompletions = Opts.findByPrefix(
+ Cur, VisibilityMask,
+ /*DisableFlags=*/options::Unsupported | options::Ignored);
// We have to query the -W flags manually as they're not in the OptTable.
// TODO: Find a good way to add them to OptTable instead and them remove
@@ -2516,13 +2500,8 @@ bool Driver::DiagnoseInputExistence(const DerivedArgList &Args, StringRef Value,
// filenames, but e.g. `/diagnostic:caret` is more likely a typo for
// the option `/diagnostics:caret` than a reference to a file in the root
// directory.
- unsigned IncludedFlagsBitmask;
- unsigned ExcludedFlagsBitmask;
- std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) =
- getIncludeExcludeOptionFlagMasks(IsCLMode());
std::string Nearest;
- if (getOpts().findNearest(Value, Nearest, IncludedFlagsBitmask,
- ExcludedFlagsBitmask) <= 1) {
+ if (getOpts().findNearest(Value, Nearest, getOptionVisibilityMask()) <= 1) {
Diag(clang::diag::err_drv_no_such_file_with_suggestion)
<< Value << Nearest;
return false;
@@ -6481,31 +6460,20 @@ bool Driver::GetReleaseVersion(StringRef Str,
return false;
}
-std::pair<unsigned, unsigned>
-Driver::getIncludeExcludeOptionFlagMasks(bool IsClCompatMode) const {
- unsigned IncludedFlagsBitmask = 0;
- unsigned ExcludedFlagsBitmask = options::NoDriverOption;
-
- if (IsClCompatMode) {
- // Include CL and Core options.
- IncludedFlagsBitmask |= options::CLOption;
- IncludedFlagsBitmask |= options::CLDXCOption;
- IncludedFlagsBitmask |= options::CoreOption;
- } else {
- ExcludedFlagsBitmask |= options::CLOption;
- }
- if (IsDXCMode()) {
- // Include DXC and Core options.
- IncludedFlagsBitmask |= options::DXCOption;
- IncludedFlagsBitmask |= options::CLDXCOption;
- IncludedFlagsBitmask |= options::CoreOption;
- } else {
- ExcludedFlagsBitmask |= options::DXCOption;
+llvm::opt::Visibility
+Driver::getOptionVisibilityMask(bool UseDriverMode) const {
+ if (!UseDriverMode)
+ return llvm::opt::Visibility(options::ClangOption);
+ if (IsCLMode())
+ return llvm::opt::Visibility(options::CLOption);
+ if (IsDXCMode())
+ return llvm::opt::Visibility(options::DXCOption);
+ if (IsFlangMode()) {
+ // TODO: Does flang really want *all* of the clang driver options?
+ // We probably need to annotate more specifically.
+ return llvm::opt::Visibility(options::ClangOption | options::FlangOption);
}
- if (!IsClCompatMode && !IsDXCMode())
- ExcludedFlagsBitmask |= options::CLDXCOption;
-
- return std::make_pair(IncludedFlagsBitmask, ExcludedFlagsBitmask);
+ return llvm::opt::Visibility(options::ClangOption);
}
const char *Driver::getExecutableForDriverMode(DriverMode Mode) {
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 0d7a497cbd42af..a35f6aa1cdf535 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -426,7 +426,7 @@ static T extractMaskValue(T KeyPath) {
FLAGS, VISIBILITY, PARAM, HELPTEXT, METAVAR, VALUES, SHOULD_PARSE, \
ALWAYS_EMIT, KEYPATH, DEFAULT_VALUE, IMPLIED_CHECK, IMPLIED_VALUE, \
NORMALIZER, DENORMALIZER, MERGER, EXTRACTOR, TABLE_INDEX) \
- if ((FLAGS)&options::CC1Option) { \
+ if ((VISIBILITY)&options::CC1Option) { \
KEYPATH = MERGER(KEYPATH, DEFAULT_VALUE); \
if (IMPLIED_CHECK) \
KEYPATH = MERGER(KEYPATH, IMPLIED_VALUE); \
@@ -440,10 +440,10 @@ static T extractMaskValue(T KeyPath) {
// with lifetime extension of the reference.
#define GENERATE_OPTION_WITH_MARSHALLING( \
CONSUMER, PREFIX_TYPE, SPELLING, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, \
- VISIBILKITY, PARAM, HELPTEXT, METAVAR, VALUES, SHOULD_PARSE, ALWAYS_EMIT, \
+ VISIBILITY, PARAM, HELPTEXT, METAVAR, VALUES, SHOULD_PARSE, ALWAYS_EMIT, \
KEYPATH, DEFAULT_VALUE, IMPLIED_CHECK, IMPLIED_VALUE, NORMALIZER, \
DENORMALIZER, MERGER, EXTRACTOR, TABLE_INDEX) \
- if ((FLAGS)&options::CC1Option) { \
+ if ((VISIBILITY)&options::CC1Option) { \
[&](const auto &Extracted) { \
if (ALWAYS_EMIT || \
(Extracted != \
@@ -4361,10 +4361,10 @@ bool CompilerInvocation::CreateFromArgsImpl(
// Parse the arguments.
const OptTable &Opts = getDriverOptTable();
- const unsigned IncludedFlagsBitmask = options::CC1Option;
+ llvm::opt::Visibility VisibilityMask(options::CC1Option);
unsigned MissingArgIndex, MissingArgCount;
InputArgList Args = Opts.ParseArgs(CommandLineArgs, MissingArgIndex,
- MissingArgCount, IncludedFlagsBitmask);
+ MissingArgCount, VisibilityMask);
LangOptions &LangOpts = *Res.getLangOpts();
// Check for missing argument error.
@@ -4376,7 +4376,7 @@ bool CompilerInvocation::CreateFromArgsImpl(
for (const auto *A : Args.filtered(OPT_UNKNOWN)) {
auto ArgString = A->getAsString(Args);
std::string Nearest;
- if (Opts.findNearest(ArgString, Nearest, IncludedFlagsBitmask) > 1)
+ if (Opts.findNearest(ArgString, Nearest, VisibilityMask) > 1)
Diags.Report(diag::err_drv_unknown_argument) << ArgString;
else
Diags.Report(diag::err_drv_unknown_argument_with_suggestion)
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index 310f67774a6605..81145d2a68eee5 100644
--- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -201,8 +201,8 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
driver::getDriverOptTable().printHelp(
llvm::outs(), "clang -cc1 [options] file...",
"LLVM 'Clang' Compiler: http://clang.llvm.org",
- /*Include=*/driver::options::CC1Option,
- /*Exclude=*/0, /*ShowAllAliases=*/false);
+ /*ShowHidden=*/false, /*ShowAllAliases=*/false,
+ llvm::opt::Visibility(driver::options::CC1Option));
return true;
}
diff --git a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
index ff9cb4b62073d7..995019ca5a4d49 100644
--- a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
+++ b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp
@@ -164,8 +164,7 @@ struct TransferableCommand {
const unsigned OldPos = Pos;
std::unique_ptr<llvm::opt::Arg> Arg(OptTable.ParseOneArg(
ArgList, Pos,
- /* Include */ ClangCLMode ? CoreOption | CLOption | CLDXCOption : 0,
- /* Exclude */ ClangCLMode ? 0 : CLOption | CLDXCOption));
+ llvm::opt::Visibility(ClangCLMode ? CLOption : ClangOption)));
if (!Arg)
continue;
diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp
index 3c5926073f026a..bc398fa0731f16 100644
--- a/clang/tools/driver/cc1as_main.cpp
+++ b/clang/tools/driver/cc1as_main.cpp
@@ -204,10 +204,10 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
// Parse the arguments.
const OptTable &OptTbl = getDriverOptTable();
- const unsigned IncludedFlagsBitmask = options::CC1AsOption;
+ llvm::opt::Visibility VisibilityMask(options::CC1AsOption);
unsigned MissingArgIndex, MissingArgCount;
- InputArgList Args = OptTbl.ParseArgs(Argv, MissingArgIndex, MissingArgCount,
- IncludedFlagsBitmask);
+ InputArgList Args =
+ OptTbl.ParseArgs(Argv, MissingArgIndex, MissingArgCount, VisibilityMask);
// Check for missing argument error.
if (MissingArgCount) {
@@ -220,7 +220,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
for (const Arg *A : Args.filtered(OPT_UNKNOWN)) {
auto ArgString = A->getAsString(Args);
std::string Nearest;
- if (OptTbl.findNearest(ArgString, Nearest, IncludedFlagsBitmask) > 1)
+ if (OptTbl.findNearest(ArgString, Nearest, VisibilityMask) > 1)
Diags.Report(diag::err_drv_unknown_argument) << ArgString;
else
Diags.Report(diag::err_drv_unknown_argument_with_suggestion)
@@ -643,9 +643,10 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
if (Asm.ShowHelp) {
getDriverOptTable().printHelp(
llvm::outs(), "clang -cc1as [options] file...",
- "Clang Integrated Assembler",
- /*Include=*/driver::options::CC1AsOption, /*Exclude=*/0,
- /*ShowAllAliases=*/false);
+ "Clang Integrated Assembler", /*ShowHidden=*/false,
+ /*ShowAllAliases=*/false,
+ llvm::opt::Visibility(driver::options::CC1AsOption));
+
return 0;
}
diff --git a/clang/utils/TableGen/ClangOptionDocEmitter.cpp b/clang/utils/TableGen/ClangOptionDocEmitter.cpp
index 3e56c02a0b3f59..242f0324c81aa6 100644
--- a/clang/utils/TableGen/ClangOptionDocEmitter.cpp
+++ b/clang/utils/TableGen/ClangOptionDocEmitter.cpp
@@ -40,25 +40,24 @@ struct DocumentedGroup : Documentation {
Record *Group;
};
-static bool hasFlag(const Record *Option, StringRef OptionFlag) {
- for (const Record *Flag : Option->getValueAsListOfDefs("Flags"))
+static bool hasFlag(const Record *Option, StringRef OptionFlag,
+ StringRef FlagsField) {
+ for (const Record *Flag : Option->getValueAsListOfDefs(FlagsField))
if (Flag->getName() == OptionFlag)
return true;
if (const DefInit *DI = dyn_cast<DefInit>(Option->getValueInit("Group")))
- for (const Record *Flag : DI->getDef()->getValueAsListOfDefs("Flags"))
+ for (const Record *Flag : DI->getDef()->getValueAsListOfDefs(FlagsField))
if (Flag->getName() == OptionFlag)
return true;
return false;
}
static bool isOptionVisible(const Record *Option, const Record *DocInfo) {
- for (StringRef Exclusion : DocInfo->getValueAsListOfStrings("ExcludedFlags"))
- if (hasFlag(Option, Exclusion))
+ for (StringRef IgnoredFlag : DocInfo->getValueAsListOfStrings("IgnoreFlags"))
+ if (hasFlag(Option, IgnoredFlag, "Flags"))
return false;
- if (!DocInfo->getValue("IncludedFlags"))
- return true;
- for (StringRef Inclusion : DocInfo->getValueAsListOfStrings("IncludedFlags"))
- if (hasFlag(Option, Inclusion))
+ for (StringRef Mask : DocInfo->getValueAsListOfStrings("VisibilityMask"))
+ if (hasFlag(Option, Mask, "Visibility"))
return true;
return false;
}
diff --git a/clang/utils/update_options_td_flags.py b/clang/utils/update_options_td_flags.py
new file mode 100755
index 00000000000000..9271b453c3fd6f
--- /dev/null
+++ b/clang/utils/update_options_td_flags.py
@@ -0,0 +1,182 @@
+#!/usr/bin/env python3
+"""Update Options.td for the flags changes in https://reviews.llvm.org/Dxyz
+
+This script translates Options.td from using Flags to control option visibility
+to using Vis instead. It is meant to be idempotent and usable to help update
+downstream forks if they have their own changes to Options.td.
+
+Usage:
+```sh
+% update_options_td_flags.py path/to/Options.td > Options.td.new
+% mv Options.td.new path/to/Options.td
+```
+
+This script will be removed after the next LLVM release.
+"""
+
+import argparse
+import re
+import shutil
+import sys
+import tempfile
+
+def rewrite_option_flags(input_file, output_file):
+ for src_line in input_file:
+ for dst_line in process_line(src_line):
+ output_file.write(dst_line)
+
+def process_line(line):
+ # We only deal with one thing per line. If multiple things can be
+ # on the same line (like NegFlag and PosFlag), please preprocess
+ # that first.
+ m = re.search(r'((NegFlag|PosFlag)<[A-Za-z]+, |BothFlags<)'
+ r'\[([A-Za-z0-9, ]+)\](, \[ClangOption\]|(?=>))', line)
+ if m:
+ return process_boolflags(m.group(3), line[:m.end(1)], line[m.end():])
+ m = re.search(r'\bFlags<\[([A-Za-z0-9, ]*)\]>', line)
+ if m:
+ return process_flags(m.group(1), line[:m.start()], line[m.end():])
+ m = re.search(r'let Flags = \[([A-Za-z0-9, ]*)\]', line)
+ if m:
+ return process_letflags(m.group(1), line[:m.start(1)], line[m.end():])
+
+ return [line]
+
+def process_boolflags(flag_group, prefix, suffix):
+ flags = [f.strip() for f in flag_group.split(',')] if flag_group else []
+ if not flags:
+ return f'{prefix}[], [ClangOption]{suffix}'
+
+ flags_to_keep, vis_mods = translate_flags(flags)
+ flag_text = f'[{", ".join(flags_to_keep)}]'
+ vis_text = f'[{", ".join(vis_mods)}]'
+ new_text = ', '.join([flag_text, vis_text])
+
+ if prefix.startswith('Both'):
+ indent = ' ' * len(prefix)
+ else:
+ indent = ' ' * (len(prefix) - len(prefix.lstrip()) + len('XyzFlag<'))
+
+ return get_edited_lines(prefix, new_text, suffix, indent=indent)
+
+def process_flags(flag_group, prefix, suffix):
+ flags = [f.strip() for f in flag_group.split(',')]
+
+ flags_to_keep, vis_mods = translate_flags(flags)
+
+ flag_text = ''
+ vis_text = ''
+ if flags_to_keep:
+ flag_text = f'Flags<[{", ".join(flags_to_keep)}]>'
+ if vis_mods:
+ flag_text += ', '
+ if vis_mods:
+ vis_text = f'Visibility<[{", ".join(vis_mods)}]>'
+
+ return get_edited_lines(prefix, flag_text, vis_text, suffix)
+
+def process_letflags(flag_group, prefix, suffix):
+ is_end_comment = prefix.startswith('} //')
+ if not is_end_comment and not prefix.startswith('let'):
+ raise AssertionError(f'Unusual let block: {prefix}')
+
+ flags = [f.strip() for f in flag_group.split(',')]
+
+ flags_to_keep, vis_mods = translate_flags(flags)
+
+ lines = []
+ if flags_to_keep:
+ lines += [f'let Flags = [{", ".join(flags_to_keep)}]']
+ if vis_mods:
+ lines += [f'let Visibility = [{", ".join(vis_mods)}]']
+
+ if is_end_comment:
+ lines = list(reversed([f'}} // {l}\n' for l in lines]))
+ else:
+ lines = [f'{l} in {{\n' for l in lines]
+ return lines
+
+def get_edited_lines(prefix, *fragments, indent=' '):
+ out_lines = []
+ current = prefix
+ for fragment in fragments:
+ if fragment and len(current) + len(fragment) > 80:
+ # Make a minimal attempt at reasonable line lengths
+ if fragment.startswith(',') or fragment.startswith(';'):
+ # Avoid wrapping the , or ; to the new line
+ current += fragment[0]
+ fragment = fragment[1:].lstrip()
+ out_lines += [current.rstrip() + '\n']
+ current = max(' ' * (len(current) - len(current.lstrip())), indent)
+ current += fragment
+
+ if current.strip():
+ out_lines += [current]
+ return out_lines
+
+def translate_flags(flags):
+ driver_flags = [
+ 'HelpHidden',
+ 'RenderAsInput',
+ 'RenderJoined',
+ 'RenderSeparate',
+ ]
+ custom_flags = [
+ 'NoXarchOption',
+ 'LinkerInput',
+ 'NoArgumentUnused',
+ 'Unsupported',
+ 'LinkOption',
+ 'Ignored',
+ 'TargetSpecific',
+ ]
+ flag_to_vis = {
+ 'CoreOption': ['ClangOption', 'CLOption', 'DXCOption'],
+ 'CLOption': ['CLOption'],
+ 'CC1Option': ['ClangOption', 'CC1Option'],
+ 'CC1AsOption': ['ClangOption', 'CC1AsOption'],
+ 'FlangOption': ['ClangOption', 'FlangOption'],
+ 'FC1Option': ['ClangOption', 'FC1Option'],
+ 'DXCOption': ['DXCOption'],
+ 'CLDXCOption': ['CLOption', 'DXCOption'],
+ }
+ new_flags = []
+ vis_mods = []
+ has_no_driver = False
+ has_flang_only = False
+ for flag in flags:
+ if flag in driver_flags or flag in custom_flags:
+ new_flags += [flag]
+ elif flag in flag_to_vis:
+ vis_mods += flag_to_vis[flag]
+ elif flag == 'NoDriverOption':
+ has_no_driver = True
+ elif flag == 'FlangOnlyOption':
+ has_flang_only = True
+ else:
+ raise AssertionError(f'Unknown flag: {flag}')
+
+ new_vis_mods = []
+ for vis in vis_mods:
+ if vis in new_vis_mods:
+ continue
+ if has_no_driver and vis == 'ClangOption':
+ continue
+ if has_flang_only and vis == 'ClangOption':
+ continue
+ new_vis_mods += [vis]
+
+ return new_flags, new_vis_mods
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('src', nargs='?', default='-',
+ type=argparse.FileType('r', encoding='UTF-8'))
+ parser.add_argument('-o', dest='dst', default='-',
+ type=argparse.FileType('w', encoding='UTF-8'))
+
+ args = parser.parse_args()
+ rewrite_option_flags(args.src, args.dst)
+
+if __name__ == '__main__':
+ main()
diff --git a/flang/docs/FlangDriver.md b/flang/docs/FlangDriver.md
index 11e86289cd6f6a..da4ae8c9139733 100644
--- a/flang/docs/FlangDriver.md
+++ b/flang/docs/FlangDriver.md
@@ -240,16 +240,14 @@ at times. Sometimes the easiest approach is to find an existing option that has
similar semantics to your new option and start by copying that.
For every new option, you will also have to define the visibility of the new
-option. This is controlled through the `Flags` field. You can use the following
-Flang specific option flags to control this:
+option. This is controlled through the `Visibility` field. You can use the
+following Flang specific visibility flags to control this:
* `FlangOption` - this option will be available in the `flang-new` compiler driver,
* `FC1Option` - this option will be available in the `flang-new -fc1` frontend driver,
- * `FlangOnlyOption` - this option will not be visible in Clang drivers.
-Please make sure that options that you add are only visible in drivers that can
-support it. For example, options that only make sense for Fortran input files
-(e.g. `-ffree-form`) should not be visible in Clang and be marked as
-`FlangOnlyOption`.
+Options that are supported by clang should explicitly specify `ClangOption` in
+`Visibility`, and options that are only supported in Flang should not specify
+`ClangOption`.
When deciding what `OptionGroup` to use when defining a new option in the
`Options.td` file, many new options fall into one of the following two
@@ -271,12 +269,12 @@ two
diff erent places, depending on which driver they belong to:
The parsing will depend on the semantics encoded in the TableGen definition.
When adding a compiler driver option (i.e. an option that contains
-`FlangOption` among its `Flags`) that you also intend to be understood by the
-frontend, make sure that it is either forwarded to `flang-new -fc1` or translated
-into some other option that is accepted by the frontend driver. In the case of
-options that contain both `FlangOption` and `FC1Option` among its flags, we
-usually just forward from `flang-new` to `flang-new -fc1`. This is then tested in
-`flang/test/Driver/frontend-forward.F90`.
+`FlangOption` among in it's `Visibility`) that you also intend to be understood
+by the frontend, make sure that it is either forwarded to `flang-new -fc1` or
+translated into some other option that is accepted by the frontend driver. In
+the case of options that contain both `FlangOption` and `FC1Option` among its
+flags, we usually just forward from `flang-new` to `flang-new -fc1`. This is
+then tested in `flang/test/Driver/frontend-forward.F90`.
What follows is usually very dependant on the meaning of the corresponding
option. In general, regular compiler flags (e.g. `-ffree-form`) are mapped to
diff --git a/flang/docs/FlangOptionsDocs.td b/flang/docs/FlangOptionsDocs.td
index b251849e167fb0..9189899e82c62d 100644
--- a/flang/docs/FlangOptionsDocs.td
+++ b/flang/docs/FlangOptionsDocs.td
@@ -25,11 +25,8 @@ Introduction
}];
string Program = "flang";
-
- list<string> ExcludedFlags = ["HelpHidden", "NoDriverOption",
- "CLOption", "Unsupported", "Ignored"];
- list<string> IncludedFlags = ["FlangOption"];
-
+ list<string> VisibilityMask = ["FlangOption"];
+ list<string> IgnoreFlags = ["HelpHidden", "Unsupported", "Ignored"];
}
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 13a4a2f87581aa..ecafa4e6454147 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -920,10 +920,10 @@ bool CompilerInvocation::createFromArgs(
// Parse the arguments
const llvm::opt::OptTable &opts = clang::driver::getDriverOptTable();
- const unsigned includedFlagsBitmask = clang::driver::options::FC1Option;
+ llvm::opt::Visibility visibilityMask(clang::driver::options::FC1Option);
unsigned missingArgIndex, missingArgCount;
llvm::opt::InputArgList args = opts.ParseArgs(
- commandLineArgs, missingArgIndex, missingArgCount, includedFlagsBitmask);
+ commandLineArgs, missingArgIndex, missingArgCount, visibilityMask);
// Check for missing argument error.
if (missingArgCount) {
@@ -936,7 +936,7 @@ bool CompilerInvocation::createFromArgs(
for (const auto *a : args.filtered(clang::driver::options::OPT_UNKNOWN)) {
auto argString = a->getAsString(args);
std::string nearest;
- if (opts.findNearest(argString, nearest, includedFlagsBitmask) > 1)
+ if (opts.findNearest(argString, nearest, visibilityMask) > 1)
diags.Report(clang::diag::err_drv_unknown_argument) << argString;
else
diags.Report(clang::diag::err_drv_unknown_argument_with_suggestion)
diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index df7876fdcb2513..883f109bcda282 100644
--- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -106,9 +106,8 @@ bool executeCompilerInvocation(CompilerInstance *flang) {
clang::driver::getDriverOptTable().printHelp(
llvm::outs(), "flang-new -fc1 [options] file...",
"LLVM 'Flang' Compiler",
- /*Include=*/clang::driver::options::FC1Option,
- /*Exclude=*/llvm::opt::DriverFlag::HelpHidden,
- /*ShowAllAliases=*/false);
+ /*ShowHidden=*/false, /*ShowAllAliases=*/false,
+ llvm::opt::Visibility(clang::driver::options::FC1Option));
return true;
}
diff --git a/flang/tools/flang-driver/driver.cpp b/flang/tools/flang-driver/driver.cpp
index d8c597a08c62f9..c7c39a731cef2d 100644
--- a/flang/tools/flang-driver/driver.cpp
+++ b/flang/tools/flang-driver/driver.cpp
@@ -55,7 +55,7 @@ createAndPopulateDiagOpts(llvm::ArrayRef<const char *> argv) {
unsigned missingArgIndex, missingArgCount;
llvm::opt::InputArgList args = clang::driver::getDriverOptTable().ParseArgs(
argv.slice(1), missingArgIndex, missingArgCount,
- /*FlagsToInclude=*/clang::driver::options::FlangOption);
+ llvm::opt::Visibility(clang::driver::options::FlangOption));
(void)Fortran::frontend::parseDiagnosticArgs(*diagOpts, args);
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 4d0d531485051c..ac5deb2614f2c5 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -161,6 +161,14 @@ Changes to Sanitizers
Other Changes
-------------
+* The ``Flags`` field of ``llvm::opt::Option`` has been split into ``Flags``
+ and ``Visibility`` to simplify option sharing between various drivers (such
+ as ``clang``, ``clang-cl``, or ``flang``) that rely on Clang's Options.td.
+ Overloads of ``llvm::opt::OptTable`` that use ``FlagsToInclude`` have been
+ deprecated. There is a script and instructions on how to resolve conflicts -
+ see https://reviews.llvm.org/D157150 and https://reviews.llvm.org/D157151 for
+ details.
+
External Open Source Projects Using LLVM 15
===========================================
diff --git a/llvm/include/llvm/Option/OptTable.h b/llvm/include/llvm/Option/OptTable.h
index 262ce103056664..083885121656e6 100644
--- a/llvm/include/llvm/Option/OptTable.h
+++ b/llvm/include/llvm/Option/OptTable.h
@@ -184,6 +184,7 @@ class OptTable {
///
/// \return The vector of flags which start with Cur.
std::vector<std::string> findByPrefix(StringRef Cur,
+ Visibility VisibilityMask,
unsigned int DisableFlags) const;
/// Find the OptTable option that most closely matches the given string.
@@ -207,6 +208,7 @@ class OptTable {
unsigned MinimumLength = 4,
unsigned MaximumDistance = UINT_MAX) const;
+ LLVM_DEPRECATED("Use the VisibilityMask overload instead", "")
unsigned findNearest(StringRef Option, std::string &NearestString,
unsigned FlagsToInclude, unsigned FlagsToExclude = 0,
unsigned MinimumLength = 4,
@@ -224,6 +226,7 @@ class OptTable {
return findNearest(Option, ExactString, VisibilityMask, 4, 0) == 0;
}
+ LLVM_DEPRECATED("Use the VisibilityMask overload instead", "")
bool findExact(StringRef Option, std::string &ExactString,
unsigned FlagsToInclude, unsigned FlagsToExclude = 0) const {
return findNearest(Option, ExactString, FlagsToInclude, FlagsToExclude, 4,
@@ -246,6 +249,7 @@ class OptTable {
ParseOneArg(const ArgList &Args, unsigned &Index,
Visibility VisibilityMask = Visibility()) const;
+ LLVM_DEPRECATED("Use the VisibilityMask overload instead", "")
std::unique_ptr<Arg> ParseOneArg(const ArgList &Args, unsigned &Index,
unsigned FlagsToInclude,
unsigned FlagsToExclude) const;
@@ -276,6 +280,7 @@ class OptTable {
unsigned &MissingArgCount,
Visibility VisibilityMask = Visibility()) const;
+ LLVM_DEPRECATED("Use the VisibilityMask overload instead", "")
InputArgList ParseArgs(ArrayRef<const char *> Args, unsigned &MissingArgIndex,
unsigned &MissingArgCount, unsigned FlagsToInclude,
unsigned FlagsToExclude = 0) const;
@@ -315,6 +320,7 @@ class OptTable {
bool ShowHidden = false, bool ShowAllAliases = false,
Visibility VisibilityMask = Visibility()) const;
+ LLVM_DEPRECATED("Use the VisibilityMask overload instead", "")
void printHelp(raw_ostream &OS, const char *Usage, const char *Title,
unsigned FlagsToInclude, unsigned FlagsToExclude,
bool ShowAllAliases) const;
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index baa537adf3cb12..50eebf1f954bb9 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -205,12 +205,15 @@ OptTable::suggestValueCompletions(StringRef Option, StringRef Arg) const {
}
std::vector<std::string>
-OptTable::findByPrefix(StringRef Cur, unsigned int DisableFlags) const {
+OptTable::findByPrefix(StringRef Cur, Visibility VisibilityMask,
+ unsigned int DisableFlags) const {
std::vector<std::string> Ret;
for (size_t I = FirstSearchableIndex, E = OptionInfos.size(); I < E; I++) {
const Info &In = OptionInfos[I];
if (In.Prefixes.empty() || (!In.HelpText && !In.GroupID))
continue;
+ if (!(In.Visibility & VisibilityMask))
+ continue;
if (In.Flags & DisableFlags)
continue;
diff --git a/llvm/unittests/Option/OptionParsingTest.cpp b/llvm/unittests/Option/OptionParsingTest.cpp
index 7bdb1077e7da6e..254bf64c7f31be 100644
--- a/llvm/unittests/Option/OptionParsingTest.cpp
+++ b/llvm/unittests/Option/OptionParsingTest.cpp
@@ -15,6 +15,8 @@
using namespace llvm;
using namespace llvm::opt;
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
enum ID {
OPT_INVALID = 0, // This is not an option ID.
#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__),
More information about the cfe-commits
mailing list