aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectHelp.cpp
diff options
context:
space:
mode:
authorPete Lawrence <plawrence@apple.com>2023-10-30 10:21:00 -1000
committerGitHub <noreply@github.com>2023-10-30 13:21:00 -0700
commit92d8a28cc665d73d9d679b8c014dd04f95d1df18 (patch)
tree19b3a218ad57e05a911da01c0f4f80ca3c0a4bd4 /lldb/source/Commands/CommandObjectHelp.cpp
parent2446439f51cf0d2dfb11c823436a930de7a4b8a2 (diff)
downloadllvm-92d8a28cc665d73d9d679b8c014dd04f95d1df18.zip
llvm-92d8a28cc665d73d9d679b8c014dd04f95d1df18.tar.gz
llvm-92d8a28cc665d73d9d679b8c014dd04f95d1df18.tar.bz2
[lldb] Part 2 of 2 - Refactor `CommandObject::DoExecute(...)` return `void` (not `bool`) (#69991)
[lldb] Part 2 of 2 - Refactor `CommandObject::DoExecute(...)` to return `void` instead of ~~`bool`~~ Justifications: - The code doesn't ultimately apply the `true`/`false` return values. - The methods already pass around a `CommandReturnObject`, typically with a `result` parameter. - Each command return object already contains: - A more precise status - The error code(s) that apply to that status Part 1 refactors the `CommandObject::Execute(...)` method. - See [https://github.com/llvm/llvm-project/pull/69989](https://github.com/llvm/llvm-project/pull/69989) rdar://117378957
Diffstat (limited to 'lldb/source/Commands/CommandObjectHelp.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectHelp.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index 10aa49a..ddb006e 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -74,7 +74,7 @@ CommandObjectHelp::CommandOptions::GetDefinitions() {
return llvm::ArrayRef(g_help_options);
}
-bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
+void CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
CommandObject::CommandMap::iterator pos;
CommandObject *cmd_obj;
const size_t argc = command.GetArgumentCount();
@@ -142,14 +142,14 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
}
s.Printf("\n");
result.AppendError(s.GetString());
- return false;
+ return;
} else if (!sub_cmd_obj) {
StreamString error_msg_stream;
GenerateAdditionalHelpAvenuesMessage(
&error_msg_stream, cmd_string.c_str(),
m_interpreter.GetCommandPrefix(), sub_command.c_str());
result.AppendError(error_msg_stream.GetString());
- return false;
+ return;
} else {
GenerateAdditionalHelpAvenuesMessage(
&result.GetOutputStream(), cmd_string.c_str(),
@@ -197,8 +197,6 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
}
}
}
-
- return result.Succeeded();
}
void CommandObjectHelp::HandleCompletion(CompletionRequest &request) {