Progress update.
Landed: OptTable size, making it a cheaper option representation (#224374, #224508, #224805, #224807, #224813, #224818, #224822)
Infois 24 bytes, down from 88.- The strings are string table offsets.
- TableGen emits the tables in a function with no relocations.
Landed: cl:: features removed or restricted
- #224953 Remove
cl::Sink - #224959 Remove
cl::multi_val - #224975 Accept only
true,false,1and0forcl::opt<bool>(-flag=is now an error) - #225609 Remove
cl::DefaultOption(-his now--help) - #225870, #225628 Remove unneeded
cl::Optionalandcl::ZeroOrMorefrom named options. NFC - #224958 Remove
cl::Grouping
Landed: tools moved to OptTable, so that the parser modes above no longer have users
- #224955 llvm-cov gcov (the last explicit
cl::Groupinguser) - #224964 yaml2obj, #224965 obj2yaml, #224966 split-file (the last
LongOptionsUseDoubleDashusers)
In review
- #226347 Remove
LongOptionsUseDoubleDashfromcl::ParseCommandLineOptions - #226359 [BOLT] Remove
cl::callbackuses - #226087 [CGData] Declare command line options in TableGen, one struct per library
- This is the first library to migrate. It adds the TableGen support (
OptionsStruct,BoolField,ValueField),cl::LibraryOptionsforcl::dispatch, and-help-hiddenoutput. - Migrating a library takes one
.tdfile, a small private header, and onestatic opt::RegisterLibraryOptions<T>line. T::Globalis constant-initialized: string members areStringRef, and the parser keeps its own copy of each value.- Bools accept
-x,-no-xand-x=true|false|1|0, ascl::opt<bool>does today.
- This is the first library to migrate. It adds the TableGen support (
- #224978 Accept
-no-<name>forcl::opt<bool>. Parked, since the replies in Cl::opt<bool> spellings: accept -no-<name>? retire -<name>={0,1,false,true}? were split on-no-x.
Next
- The remaining
cl::callbackusers: 10 in libraries.- Two need a hook that runs after parsing:
-print-debug-counterand-time-passes-per-run. - GISel’s
-disable-ruleand-only-enable-rulecan merge by position.
- Two need a hook that runs after parsing:
std::optional<T>fields, for options whose code checksgetNumOccurrences().- Enum fields, then LLVMPasses.