[Lldb-commits] [lldb] 8235253 - [lldb] Remove unused CommandObjectRegexCommand::m_max_matches (NFC)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 9 19:35:13 PST 2023


Author: Dave Lee
Date: 2023-02-09T19:35:00-08:00
New Revision: 82352538576a67d746ae2c0ba4ec5453839e70cd

URL: https://github.com/llvm/llvm-project/commit/82352538576a67d746ae2c0ba4ec5453839e70cd
DIFF: https://github.com/llvm/llvm-project/commit/82352538576a67d746ae2c0ba4ec5453839e70cd.diff

LOG: [lldb] Remove unused CommandObjectRegexCommand::m_max_matches (NFC)

Added: 
    

Modified: 
    lldb/source/Commands/CommandObjectCommands.cpp
    lldb/source/Commands/CommandObjectRegexCommand.cpp
    lldb/source/Commands/CommandObjectRegexCommand.h
    lldb/source/Interpreter/CommandInterpreter.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 7a5755d8d235b..f06dec8328c9d 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -880,7 +880,7 @@ a number follows 'f':"
     Status error;
     auto name = command[0].ref();
     m_regex_cmd_up = std::make_unique<CommandObjectRegexCommand>(
-        m_interpreter, name, m_options.GetHelp(), m_options.GetSyntax(), 10, 0,
+        m_interpreter, name, m_options.GetHelp(), m_options.GetSyntax(), 0,
         true);
 
     if (argc == 1) {

diff  --git a/lldb/source/Commands/CommandObjectRegexCommand.cpp b/lldb/source/Commands/CommandObjectRegexCommand.cpp
index 857193036e393..2d44ada0acc93 100644
--- a/lldb/source/Commands/CommandObjectRegexCommand.cpp
+++ b/lldb/source/Commands/CommandObjectRegexCommand.cpp
@@ -19,10 +19,9 @@ using namespace lldb_private;
 // CommandObjectRegexCommand constructor
 CommandObjectRegexCommand::CommandObjectRegexCommand(
     CommandInterpreter &interpreter, llvm::StringRef name, llvm::StringRef help,
-    llvm::StringRef syntax, uint32_t max_matches, uint32_t completion_type_mask,
-    bool is_removable)
+    llvm::StringRef syntax, uint32_t completion_type_mask, bool is_removable)
     : CommandObjectRaw(interpreter, name, help, syntax),
-      m_max_matches(max_matches), m_completion_type_mask(completion_type_mask),
+      m_completion_type_mask(completion_type_mask),
       m_is_removable(is_removable) {}
 
 // Destructor

diff  --git a/lldb/source/Commands/CommandObjectRegexCommand.h b/lldb/source/Commands/CommandObjectRegexCommand.h
index b2a375c63a764..47d493a8fdd7b 100644
--- a/lldb/source/Commands/CommandObjectRegexCommand.h
+++ b/lldb/source/Commands/CommandObjectRegexCommand.h
@@ -23,7 +23,7 @@ class CommandObjectRegexCommand : public CommandObjectRaw {
 public:
   CommandObjectRegexCommand(CommandInterpreter &interpreter,
                             llvm::StringRef name, llvm::StringRef help,
-                            llvm::StringRef syntax, uint32_t max_matches,
+                            llvm::StringRef syntax,
                             uint32_t completion_type_mask, bool is_removable);
 
   ~CommandObjectRegexCommand() override;
@@ -50,7 +50,6 @@ class CommandObjectRegexCommand : public CommandObjectRaw {
   };
 
   typedef std::list<Entry> EntryCollection;
-  const uint32_t m_max_matches;
   const uint32_t m_completion_type_mask;
   EntryCollection m_entries;
   bool m_is_removable;

diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 8b24c72d77337..1437ca464e760 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -612,7 +612,6 @@ void CommandInterpreter::LoadCommandDictionary() {
           "current file\n"
           "                                    // containing text 'break "
           "here'.\n",
-          3,
           CommandCompletions::eSymbolCompletion |
               CommandCompletions::eSourceFileCompletion,
           false));
@@ -666,7 +665,6 @@ void CommandInterpreter::LoadCommandDictionary() {
           "current file\n"
           "                                    // containing text 'break "
           "here'.\n",
-          2,
           CommandCompletions::eSymbolCompletion |
               CommandCompletions::eSourceFileCompletion,
           false));
@@ -694,7 +692,7 @@ void CommandInterpreter::LoadCommandDictionary() {
   std::unique_ptr<CommandObjectRegexCommand> attach_regex_cmd_up(
       new CommandObjectRegexCommand(
           *this, "_regexp-attach", "Attach to process by ID or name.",
-          "_regexp-attach <pid> | <process-name>", 2, 0, false));
+          "_regexp-attach <pid> | <process-name>", 0, false));
   if (attach_regex_cmd_up) {
     if (attach_regex_cmd_up->AddRegexCommand("^([0-9]+)[[:space:]]*$",
                                              "process attach --pid %1") &&
@@ -716,7 +714,7 @@ void CommandInterpreter::LoadCommandDictionary() {
                                     "Select a newer stack frame.  Defaults to "
                                     "moving one frame, a numeric argument can "
                                     "specify an arbitrary number.",
-                                    "_regexp-down [<count>]", 2, 0, false));
+                                    "_regexp-down [<count>]", 0, false));
   if (down_regex_cmd_up) {
     if (down_regex_cmd_up->AddRegexCommand("^$", "frame select -r -1") &&
         down_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
@@ -732,7 +730,7 @@ void CommandInterpreter::LoadCommandDictionary() {
           *this, "_regexp-up",
           "Select an older stack frame.  Defaults to moving one "
           "frame, a numeric argument can specify an arbitrary number.",
-          "_regexp-up [<count>]", 2, 0, false));
+          "_regexp-up [<count>]", 0, false));
   if (up_regex_cmd_up) {
     if (up_regex_cmd_up->AddRegexCommand("^$", "frame select -r 1") &&
         up_regex_cmd_up->AddRegexCommand("^([0-9]+)$", "frame select -r %1")) {
@@ -746,7 +744,7 @@ void CommandInterpreter::LoadCommandDictionary() {
       new CommandObjectRegexCommand(
           *this, "_regexp-display",
           "Evaluate an expression at every stop (see 'help target stop-hook'.)",
-          "_regexp-display expression", 2, 0, false));
+          "_regexp-display expression", 0, false));
   if (display_regex_cmd_up) {
     if (display_regex_cmd_up->AddRegexCommand(
             "^(.+)$", "target stop-hook add -o \"expr -- %1\"")) {
@@ -760,7 +758,7 @@ void CommandInterpreter::LoadCommandDictionary() {
       new CommandObjectRegexCommand(*this, "_regexp-undisplay",
                                     "Stop displaying expression at every "
                                     "stop (specified by stop-hook index.)",
-                                    "_regexp-undisplay stop-hook-number", 2, 0,
+                                    "_regexp-undisplay stop-hook-number", 0,
                                     false));
   if (undisplay_regex_cmd_up) {
     if (undisplay_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
@@ -778,7 +776,7 @@ void CommandInterpreter::LoadCommandDictionary() {
           "If no host is specifed, localhost is assumed.\n"
           "gdb-remote is an abbreviation for 'process connect --plugin "
           "gdb-remote connect://<hostname>:<port>'\n",
-          "gdb-remote [<hostname>:]<portnum>", 2, 0, false));
+          "gdb-remote [<hostname>:]<portnum>", 0, false));
   if (connect_gdb_remote_cmd_up) {
     if (connect_gdb_remote_cmd_up->AddRegexCommand(
             "^([^:]+|\\[[0-9a-fA-F:]+.*\\]):([0-9]+)$",
@@ -798,7 +796,7 @@ void CommandInterpreter::LoadCommandDictionary() {
           "If no UDP port is specified, port 41139 is assumed.\n"
           "kdp-remote is an abbreviation for 'process connect --plugin "
           "kdp-remote udp://<hostname>:<port>'\n",
-          "kdp-remote <hostname>[:<portnum>]", 2, 0, false));
+          "kdp-remote <hostname>[:<portnum>]", 0, false));
   if (connect_kdp_remote_cmd_up) {
     if (connect_kdp_remote_cmd_up->AddRegexCommand(
             "^([^:]+:[[:digit:]]+)$",
@@ -818,7 +816,7 @@ void CommandInterpreter::LoadCommandDictionary() {
           "frames.  The argument 'all' displays all threads.  Use 'settings"
           " set frame-format' to customize the printing of individual frames "
           "and 'settings set thread-format' to customize the thread header.",
-          "bt [<digit> | all]", 2, 0, false));
+          "bt [<digit> | all]", 0, false));
   if (bt_regex_cmd_up) {
     // accept but don't document "bt -c <number>" -- before bt was a regex
     // command if you wanted to backtrace three frames you would do "bt -c 3"
@@ -847,7 +845,7 @@ void CommandInterpreter::LoadCommandDictionary() {
           "_regexp-list 0x<address>     // List around specified address\n"
           "_regexp-list -[<count>]      // List previous <count> lines\n"
           "_regexp-list                 // List subsequent lines",
-          2, CommandCompletions::eSourceFileCompletion, false));
+          CommandCompletions::eSourceFileCompletion, false));
   if (list_regex_cmd_up) {
     if (list_regex_cmd_up->AddRegexCommand("^([0-9]+)[[:space:]]*$",
                                            "source list --line %1") &&
@@ -879,7 +877,7 @@ void CommandInterpreter::LoadCommandDictionary() {
           "\n"
           "_regexp-env                  // Show environment\n"
           "_regexp-env <name>=<value>   // Set an environment variable",
-          2, 0, false));
+          0, false));
   if (env_regex_cmd_up) {
     if (env_regex_cmd_up->AddRegexCommand("^$",
                                           "settings show target.env-vars") &&
@@ -899,7 +897,7 @@ void CommandInterpreter::LoadCommandDictionary() {
           "_regexp-jump +<line-offset> | -<line-offset>\n"
           "_regexp-jump <file>:<line>\n"
           "_regexp-jump *<addr>\n",
-          2, 0, false));
+          0, false));
   if (jump_regex_cmd_up) {
     if (jump_regex_cmd_up->AddRegexCommand("^\\*(.*)$",
                                            "thread jump --addr %1") &&


        


More information about the lldb-commits mailing list