[Lldb-commits] [lldb] 9390b34 - [lldb] Move ScriptCommand and RegexCommand under Commands (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Sep 1 17:33:46 PDT 2020
Author: Jonas Devlieghere
Date: 2020-09-01T17:33:39-07:00
New Revision: 9390b346fc207c3edabbca9665e77260b030cfe0
URL: https://github.com/llvm/llvm-project/commit/9390b346fc207c3edabbca9665e77260b030cfe0
DIFF: https://github.com/llvm/llvm-project/commit/9390b346fc207c3edabbca9665e77260b030cfe0.diff
LOG: [lldb] Move ScriptCommand and RegexCommand under Commands (NFC)
Move the CommandObjectScript and CommandObjectRegexCommand under
Commands where all the other CommandObject implementations live.
Although neither implementations currently use the TableGen-generated
CommandOptions.inc, this move would have been necessary anyway if they
were to in the future.
Added:
lldb/source/Commands/CommandObjectRegexCommand.cpp
lldb/source/Commands/CommandObjectRegexCommand.h
lldb/source/Commands/CommandObjectScript.cpp
lldb/source/Commands/CommandObjectScript.h
Modified:
lldb/source/Commands/CMakeLists.txt
lldb/source/Commands/CommandObjectCommands.cpp
lldb/source/Interpreter/CMakeLists.txt
lldb/source/Interpreter/CommandInterpreter.cpp
Removed:
lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h
lldb/source/Interpreter/CommandObjectRegexCommand.cpp
lldb/source/Interpreter/CommandObjectScript.cpp
lldb/source/Interpreter/CommandObjectScript.h
################################################################################
diff --git a/lldb/source/Commands/CMakeLists.txt b/lldb/source/Commands/CMakeLists.txt
index 28bcfacdf3e8..3e57670fd040 100644
--- a/lldb/source/Commands/CMakeLists.txt
+++ b/lldb/source/Commands/CMakeLists.txt
@@ -21,8 +21,10 @@ add_lldb_library(lldbCommands
CommandObjectPlugin.cpp
CommandObjectProcess.cpp
CommandObjectQuit.cpp
+ CommandObjectRegexCommand.cpp
CommandObjectRegister.cpp
CommandObjectReproducer.cpp
+ CommandObjectScript.cpp
CommandObjectSession.cpp
CommandObjectSettings.cpp
CommandObjectSource.cpp
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 92730b6111bb..96ce82d84248 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -6,15 +6,13 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/ADT/StringRef.h"
-
#include "CommandObjectCommands.h"
#include "CommandObjectHelp.h"
+#include "CommandObjectRegexCommand.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/IOHandler.h"
#include "lldb/Interpreter/CommandHistory.h"
#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandObjectRegexCommand.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
@@ -24,6 +22,7 @@
#include "lldb/Interpreter/ScriptInterpreter.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/StringList.h"
+#include "llvm/ADT/StringRef.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp b/lldb/source/Commands/CommandObjectRegexCommand.cpp
similarity index 96%
rename from lldb/source/Interpreter/CommandObjectRegexCommand.cpp
rename to lldb/source/Commands/CommandObjectRegexCommand.cpp
index 7485fd76cc25..1bf29d3c047b 100644
--- a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp
+++ b/lldb/source/Commands/CommandObjectRegexCommand.cpp
@@ -6,8 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/Interpreter/CommandObjectRegexCommand.h"
-
+#include "CommandObjectRegexCommand.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -17,7 +16,7 @@ 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,
+ llvm::StringRef syntax, uint32_t max_matches, 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),
diff --git a/lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h b/lldb/source/Commands/CommandObjectRegexCommand.h
similarity index 85%
rename from lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h
rename to lldb/source/Commands/CommandObjectRegexCommand.h
index cbd50511c483..2f65c2cd815d 100644
--- a/lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h
+++ b/lldb/source/Commands/CommandObjectRegexCommand.h
@@ -21,10 +21,10 @@ namespace lldb_private {
class CommandObjectRegexCommand : public CommandObjectRaw {
public:
- CommandObjectRegexCommand(CommandInterpreter &interpreter, llvm::StringRef name,
- llvm::StringRef help, llvm::StringRef syntax,
- uint32_t max_matches, uint32_t completion_type_mask,
- bool is_removable);
+ CommandObjectRegexCommand(CommandInterpreter &interpreter,
+ llvm::StringRef name, llvm::StringRef help,
+ llvm::StringRef syntax, uint32_t max_matches,
+ uint32_t completion_type_mask, bool is_removable);
~CommandObjectRegexCommand() override;
diff --git a/lldb/source/Interpreter/CommandObjectScript.cpp b/lldb/source/Commands/CommandObjectScript.cpp
similarity index 100%
rename from lldb/source/Interpreter/CommandObjectScript.cpp
rename to lldb/source/Commands/CommandObjectScript.cpp
diff --git a/lldb/source/Interpreter/CommandObjectScript.h b/lldb/source/Commands/CommandObjectScript.h
similarity index 100%
rename from lldb/source/Interpreter/CommandObjectScript.h
rename to lldb/source/Commands/CommandObjectScript.h
diff --git a/lldb/source/Interpreter/CMakeLists.txt b/lldb/source/Interpreter/CMakeLists.txt
index 7a8c826d040c..af9b0ce86f34 100644
--- a/lldb/source/Interpreter/CMakeLists.txt
+++ b/lldb/source/Interpreter/CMakeLists.txt
@@ -11,8 +11,6 @@ add_lldb_library(lldbInterpreter
CommandHistory.cpp
CommandInterpreter.cpp
CommandObject.cpp
- CommandObjectRegexCommand.cpp
- CommandObjectScript.cpp
CommandOptionValidators.cpp
CommandReturnObject.cpp
OptionArgParser.cpp
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 60e08346e655..8c77227d01f2 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -12,9 +12,6 @@
#include <string>
#include <vector>
-#include "CommandObjectScript.h"
-#include "lldb/Interpreter/CommandObjectRegexCommand.h"
-
#include "Commands/CommandObjectApropos.h"
#include "Commands/CommandObjectBreakpoint.h"
#include "Commands/CommandObjectCommands.h"
@@ -30,8 +27,10 @@
#include "Commands/CommandObjectPlugin.h"
#include "Commands/CommandObjectProcess.h"
#include "Commands/CommandObjectQuit.h"
+#include "Commands/CommandObjectRegexCommand.h"
#include "Commands/CommandObjectRegister.h"
#include "Commands/CommandObjectReproducer.h"
+#include "Commands/CommandObjectScript.h"
#include "Commands/CommandObjectSession.h"
#include "Commands/CommandObjectSettings.h"
#include "Commands/CommandObjectSource.h"
More information about the lldb-commits
mailing list