From 92d8a28cc665d73d9d679b8c014dd04f95d1df18 Mon Sep 17 00:00:00 2001 From: Pete Lawrence Date: Mon, 30 Oct 2023 10:21:00 -1000 Subject: [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 --- lldb/source/Commands/CommandObjectGUI.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lldb/source/Commands/CommandObjectGUI.cpp') diff --git a/lldb/source/Commands/CommandObjectGUI.cpp b/lldb/source/Commands/CommandObjectGUI.cpp index a63d1718610c..b56e49b073b0 100644 --- a/lldb/source/Commands/CommandObjectGUI.cpp +++ b/lldb/source/Commands/CommandObjectGUI.cpp @@ -24,7 +24,7 @@ CommandObjectGUI::CommandObjectGUI(CommandInterpreter &interpreter) CommandObjectGUI::~CommandObjectGUI() = default; -bool CommandObjectGUI::DoExecute(Args &args, CommandReturnObject &result) { +void CommandObjectGUI::DoExecute(Args &args, CommandReturnObject &result) { #if LLDB_ENABLE_CURSES Debugger &debugger = GetDebugger(); @@ -39,9 +39,7 @@ bool CommandObjectGUI::DoExecute(Args &args, CommandReturnObject &result) { } else { result.AppendError("the gui command requires an interactive terminal."); } - return true; #else result.AppendError("lldb was not built with gui support"); - return false; #endif } -- cgit v1.2.3