@@ -45,8 +45,6 @@ class Visibility {
4545 operator unsigned () const { return Mask; }
4646};
4747
48- inline constexpr StringRef TopLevelCommandName = " TopLevelCommand" ;
49-
5048// / Provide access to the Option info table.
5149// /
5250// / The OptTable class provides a layer of indirection which allows Option
@@ -57,7 +55,7 @@ inline constexpr StringRef TopLevelCommandName = "TopLevelCommand";
5755class LLVM_ABI OptTable {
5856public:
5957 // / Represents a subcommand and its options in the option table.
60- struct Command {
58+ struct SubCommand {
6159 const char *Name;
6260 const char *HelpText;
6361 const char *Usage;
@@ -107,16 +105,17 @@ class LLVM_ABI OptTable {
107105
108106 bool hasCommands () const { return CommandIDsOffset != 0 ; }
109107
110- unsigned getNumCommandIDs (ArrayRef<unsigned > CommandIDsTable ) const {
108+ unsigned getNumCommandIDs (ArrayRef<unsigned > SubCommandIDsTable ) const {
111109 // We embed the number of command IDs in the value of the first offset.
112- return CommandIDsTable [CommandIDsOffset];
110+ return SubCommandIDsTable [CommandIDsOffset];
113111 }
114112
115- ArrayRef<unsigned > getCommandIDs (ArrayRef<unsigned > CommandIDsTable) const {
116- return hasCommands ()
117- ? CommandIDsTable.slice (CommandIDsOffset + 1 ,
118- getNumCommandIDs (CommandIDsTable))
119- : ArrayRef<unsigned >();
113+ ArrayRef<unsigned >
114+ getCommandIDs (ArrayRef<unsigned > SubCommandIDsTable) const {
115+ return hasCommands () ? SubCommandIDsTable.slice (
116+ CommandIDsOffset + 1 ,
117+ getNumCommandIDs (SubCommandIDsTable))
118+ : ArrayRef<unsigned >();
120119 }
121120
122121 void appendPrefixes (const StringTable &StrTable,
@@ -161,10 +160,10 @@ class LLVM_ABI OptTable {
161160 bool IgnoreCase;
162161
163162 // / The command information table.
164- ArrayRef<Command> Commands ;
163+ ArrayRef<SubCommand> SubCommands ;
165164
166165 // / The command IDs table.
167- ArrayRef<unsigned > CommandIDsTable ;
166+ ArrayRef<unsigned > SubCommandIDsTable ;
168167
169168 bool GroupedShortOptions = false ;
170169 bool DashDashParsing = false ;
@@ -201,8 +200,8 @@ class LLVM_ABI OptTable {
201200 OptTable (const StringTable &StrTable,
202201 ArrayRef<StringTable::Offset> PrefixesTable,
203202 ArrayRef<Info> OptionInfos, bool IgnoreCase = false ,
204- ArrayRef<Command> Commands = {},
205- ArrayRef<unsigned > CommandIDsTable = {});
203+ ArrayRef<SubCommand> SubCommands = {},
204+ ArrayRef<unsigned > SubCommandIDsTable = {});
206205
207206 // / Build (or rebuild) the PrefixChars member.
208207 void buildPrefixChars ();
@@ -213,7 +212,7 @@ class LLVM_ABI OptTable {
213212 // / Return the string table used for option names.
214213 const StringTable &getStrTable () const { return *StrTable; }
215214
216- const ArrayRef<Command> getCommands () const { return Commands ; }
215+ const ArrayRef<SubCommand> getSubCommands () const { return SubCommands ; }
217216
218217 // / Return the prefixes table used for option names.
219218 ArrayRef<StringTable::Offset> getPrefixesTable () const {
@@ -386,7 +385,6 @@ class LLVM_ABI OptTable {
386385private:
387386 std::unique_ptr<Arg>
388387 internalParseOneArg (const ArgList &Args, unsigned &Index,
389- const Command *ActiveCommand,
390388 std::function<bool (const Option &)> ExcludeOption) const ;
391389
392390public:
@@ -468,8 +466,8 @@ class GenericOptTable : public OptTable {
468466 LLVM_ABI GenericOptTable (const StringTable &StrTable,
469467 ArrayRef<StringTable::Offset> PrefixesTable,
470468 ArrayRef<Info> OptionInfos, bool IgnoreCase = false ,
471- ArrayRef<Command > Commands = {},
472- ArrayRef<unsigned > CommandIDsTable = {});
469+ ArrayRef<SubCommand > Commands = {},
470+ ArrayRef<unsigned > SubCommandIDsTable = {});
473471};
474472
475473class PrecomputedOptTable : public OptTable {
@@ -478,10 +476,11 @@ class PrecomputedOptTable : public OptTable {
478476 ArrayRef<StringTable::Offset> PrefixesTable,
479477 ArrayRef<Info> OptionInfos,
480478 ArrayRef<StringTable::Offset> PrefixesUnionOffsets,
481- bool IgnoreCase = false , ArrayRef<Command> Commands = {},
482- ArrayRef<unsigned > CommandIDsTable = {})
483- : OptTable(StrTable, PrefixesTable, OptionInfos, IgnoreCase, Commands,
484- CommandIDsTable) {
479+ bool IgnoreCase = false ,
480+ ArrayRef<SubCommand> SubCommands = {},
481+ ArrayRef<unsigned > SubCommandIDsTable = {})
482+ : OptTable(StrTable, PrefixesTable, OptionInfos, IgnoreCase, SubCommands,
483+ SubCommandIDsTable) {
485484 for (auto PrefixOffset : PrefixesUnionOffsets)
486485 PrefixesUnion.push_back (StrTable[PrefixOffset]);
487486 buildPrefixChars ();
0 commit comments