diff options
author | Justin Bogner <mail@justinbogner.com> | 2023-07-21 14:08:19 -0700 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2023-08-14 13:24:54 -0700 |
commit | a16104e6da6f36f3d72dbf53d10ba56495a0d65a (patch) | |
tree | 3e46ec9acbc48fd1d8676390149359a8af123217 /llvm/tools | |
parent | f50eaea8ce1342732fdc02d494e077aaafc3b3e4 (diff) | |
download | llvm-a16104e6da6f36f3d72dbf53d10ba56495a0d65a.zip llvm-a16104e6da6f36f3d72dbf53d10ba56495a0d65a.tar.gz llvm-a16104e6da6f36f3d72dbf53d10ba56495a0d65a.tar.bz2 |
[Option] Add "Visibility" field and clone the OptTable APIs to use it
This splits OptTable's "Flags" field into "Flags" and "Visibility",
updates the places where we instantiate Option tables, and adds
variants of the OptTable APIs that use Visibility mask instead of
Include/Exclude flags.
We need to do this to clean up a bunch of complexity in the clang
driver's option handling - there's a whole slew of flags like
CoreOption, NoDriverOption, and FlangOnlyOption there today to try to
handle all of the permutations of flags that the various drivers need,
but it really doesn't scale well, as can be seen by things like the
somewhat recently introduced CLDXCOption.
Instead, we'll provide an additive model for visibility that's
separate from the other flags. For things like "HelpHidden", which is
used as a "subtractive" modifier for option visibility, we leave that
in "Flags" and handle it as a special case.
Note that we don't actually update the users of the Include/Exclude
APIs here or change the flags that exist in clang at all - that will
come in a follow up that refactors clang's Options.td to use the
increased flexibility this change allows.
Differential Revision: https://reviews.llvm.org/D157149
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/dsymutil/dsymutil.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-cvtres/llvm-cvtres.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-dwp/llvm-dwp.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-lipo/llvm-lipo.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-mt/llvm-mt.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-objcopy/ObjcopyOptions.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-rc/llvm-rc.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-strings/llvm-strings.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp | 1 |
13 files changed, 13 insertions, 0 deletions
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp index 6f1e06c..20d11bc 100644 --- a/llvm/tools/dsymutil/dsymutil.cpp +++ b/llvm/tools/dsymutil/dsymutil.cpp @@ -71,6 +71,7 @@ enum ID { #include "Options.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Options.inc" diff --git a/llvm/tools/llvm-cvtres/llvm-cvtres.cpp b/llvm/tools/llvm-cvtres/llvm-cvtres.cpp index 0bc1bcb8..0c10769 100644 --- a/llvm/tools/llvm-cvtres/llvm-cvtres.cpp +++ b/llvm/tools/llvm-cvtres/llvm-cvtres.cpp @@ -49,6 +49,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" diff --git a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp index 1747629..7340643 100644 --- a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp +++ b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp @@ -39,6 +39,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" diff --git a/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp b/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp index cc1f38c..1869f2e 100644 --- a/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp +++ b/llvm/tools/llvm-debuginfod/llvm-debuginfod.cpp @@ -43,6 +43,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" diff --git a/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp b/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp index 08ff4c5..e09060a 100644 --- a/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp +++ b/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp @@ -45,6 +45,7 @@ enum ID { #include "Options.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Options.inc" diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp index af5621e..f976298 100644 --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -55,6 +55,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" diff --git a/llvm/tools/llvm-lipo/llvm-lipo.cpp b/llvm/tools/llvm-lipo/llvm-lipo.cpp index 82b8b3d..b1f2028 100644 --- a/llvm/tools/llvm-lipo/llvm-lipo.cpp +++ b/llvm/tools/llvm-lipo/llvm-lipo.cpp @@ -80,6 +80,7 @@ namespace lipo { #include "LipoOpts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info LipoInfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO_WITH_ID_PREFIX(LIPO_, __VA_ARGS__), #include "LipoOpts.inc" diff --git a/llvm/tools/llvm-mt/llvm-mt.cpp b/llvm/tools/llvm-mt/llvm-mt.cpp index f3283a4..246e092 100644 --- a/llvm/tools/llvm-mt/llvm-mt.cpp +++ b/llvm/tools/llvm-mt/llvm-mt.cpp @@ -47,6 +47,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" diff --git a/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp b/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp index 02b7790..d33adb0 100644 --- a/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp +++ b/llvm/tools/llvm-objcopy/ObjcopyOptions.cpp @@ -26,6 +26,7 @@ using namespace llvm; using namespace llvm::objcopy; +using namespace llvm::opt; namespace { enum ObjcopyID { diff --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp index 5745901..ec1cdae 100644 --- a/llvm/tools/llvm-rc/llvm-rc.cpp +++ b/llvm/tools/llvm-rc/llvm-rc.cpp @@ -44,6 +44,7 @@ using namespace llvm; using namespace llvm::rc; +using namespace llvm::opt; namespace { diff --git a/llvm/tools/llvm-strings/llvm-strings.cpp b/llvm/tools/llvm-strings/llvm-strings.cpp index 9a72720..8642be3 100644 --- a/llvm/tools/llvm-strings/llvm-strings.cpp +++ b/llvm/tools/llvm-strings/llvm-strings.cpp @@ -45,6 +45,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp index 478ebc1..f43aad6 100644 --- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp +++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp @@ -62,6 +62,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" diff --git a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp index 2adce18..a091e37 100644 --- a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp +++ b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp @@ -40,6 +40,7 @@ enum ID { #include "Opts.inc" #undef PREFIX +using namespace llvm::opt; static constexpr opt::OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), #include "Opts.inc" |