mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Migrate to common OptTable macros
`OptTable` was a source of consistent churn due to new arguments to the `OPTION` macro. LLVM 3f092f37b7362447cbb13f5502dae4bdd5762afd extracted the handling of the common option parts (eg. an ID and an info) out into separate macros to reduce this - use those here (since unsurprisingly, more arguments were added).
This commit is contained in:
@@ -56,9 +56,7 @@ struct OutputEntry {
|
||||
|
||||
enum ID {
|
||||
OPT_INVALID = 0, // This is not an option ID.
|
||||
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
|
||||
HELPTEXT, METAVAR, VALUES) \
|
||||
OPT_##ID,
|
||||
#define OPTION(...) LLVM_MAKE_OPT_ID(__VA_ARGS__),
|
||||
#include "SwiftCacheToolOptions.inc"
|
||||
LastOption
|
||||
#undef OPTION
|
||||
@@ -72,10 +70,7 @@ enum ID {
|
||||
#undef PREFIX
|
||||
|
||||
static const OptTable::Info InfoTable[] = {
|
||||
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
|
||||
HELPTEXT, METAVAR, VALUES) \
|
||||
{PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, \
|
||||
PARAM, FLAGS, OPT_##GROUP, OPT_##ALIAS, ALIASARGS, VALUES},
|
||||
#define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__),
|
||||
#include "SwiftCacheToolOptions.inc"
|
||||
#undef OPTION
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user