[llvm] [CommandLine][NFCI] Do not add 'All' to 'RegisteredSubCommands' (PR #77041)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 03:19:24 PST 2024


================
@@ -348,15 +345,14 @@ class CommandLineParser {
 
     // For all options that have been registered for all subcommands, add the
     // option to this subcommand now.
-    if (sub != &SubCommand::getAll()) {
-      for (auto &E : SubCommand::getAll().OptionsMap) {
-        Option *O = E.second;
-        if ((O->isPositional() || O->isSink() || O->isConsumeAfter()) ||
-            O->hasArgStr())
-          addOption(O, sub);
-        else
-          addLiteralOption(*O, sub, E.first());
-      }
+    assert(sub != &SubCommand::getAll());
----------------
RKSimon wrote:

(style) assertion message

https://github.com/llvm/llvm-project/pull/77041


More information about the llvm-commits mailing list