diff options
author | David Spickett <david.spickett@linaro.org> | 2021-06-16 13:56:51 +0100 |
---|---|---|
committer | David Spickett <david.spickett@linaro.org> | 2021-06-17 12:21:54 +0100 |
commit | 7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd (patch) | |
tree | d6e721672678b12262a43c60570949b2c15786b0 /lldb/source/Interpreter | |
parent | 983ed1b58ef9d0f97c9cec2876f631e47609d437 (diff) | |
download | llvm-7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd.zip llvm-7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd.tar.gz llvm-7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd.tar.bz2 |
[lldb] Remove redundant calls to set eReturnStatusFailed
Since https://reviews.llvm.org/D103701 AppendError<...>
sets this for you.
This change includes all of the non-command uses.
Some uses remain where it's either tricky to reason about
the logic, or they aren't paired with AppendError calls.
Reviewed By: teemperor
Differential Revision: https://reviews.llvm.org/D104379
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r-- | lldb/source/Interpreter/CommandAlias.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 15 | ||||
-rw-r--r-- | lldb/source/Interpreter/Options.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreter.cpp | 2 |
4 files changed, 0 insertions, 19 deletions
diff --git a/lldb/source/Interpreter/CommandAlias.cpp b/lldb/source/Interpreter/CommandAlias.cpp index f0f577b..d55b3fd 100644 --- a/lldb/source/Interpreter/CommandAlias.cpp +++ b/lldb/source/Interpreter/CommandAlias.cpp @@ -47,7 +47,6 @@ static bool ProcessAliasOptionsArgs(lldb::CommandObjectSP &cmd_obj_sp, if (!args_or) { result.AppendError(toString(args_or.takeError())); result.AppendError("Unable to create requested alias.\n"); - result.SetStatus(eReturnStatusFailed); return false; } args = std::move(*args_or); diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 85025b9..8a3a409 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1465,7 +1465,6 @@ CommandObject *CommandInterpreter::BuildAliasResult( "need at least %d arguments to use " "this alias.\n", index); - result.SetStatus(eReturnStatusFailed); return nullptr; } else { size_t strpos = raw_input_string.find(cmd_args.GetArgumentAtIndex(index)); @@ -1658,7 +1657,6 @@ bool CommandInterpreter::HandleCommand(const char *command_line, if (WasInterrupted()) { result.AppendError("interrupted"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1694,7 +1692,6 @@ bool CommandInterpreter::HandleCommand(const char *command_line, } else { result.AppendErrorWithFormat("Could not find entry: %s in history", command_string.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } @@ -1708,7 +1705,6 @@ bool CommandInterpreter::HandleCommand(const char *command_line, if (m_command_history.IsEmpty()) { result.AppendError("empty command"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1717,7 +1713,6 @@ bool CommandInterpreter::HandleCommand(const char *command_line, original_command_string = command_line; if (m_repeat_command.empty()) { result.AppendError("No auto repeat."); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1731,7 +1726,6 @@ bool CommandInterpreter::HandleCommand(const char *command_line, if (error.Fail()) { result.AppendError(error.AsCString()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -1999,7 +1993,6 @@ void CommandInterpreter::BuildAliasCommandArgs(CommandObject *alias_cmd_obj, "need at least %d arguments to use " "this alias.\n", index); - result.SetStatus(eReturnStatusFailed); return; } else { // Find and remove cmd_args.GetArgumentAtIndex(i) from raw_input_string @@ -2169,7 +2162,6 @@ void CommandInterpreter::SourceInitFileCwd(CommandReturnObject &result) { result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError(InitFileWarning); - result.SetStatus(eReturnStatusFailed); } } } @@ -2331,7 +2323,6 @@ void CommandInterpreter::HandleCommands(const StringList &commands, "Aborting reading of commands after command #%" PRIu64 ": '%s' failed with %s", (uint64_t)idx, cmd, error_msg.str().c_str()); - result.SetStatus(eReturnStatusFailed); m_debugger.SetAsyncExecution(old_async_execution); return; } else if (options.GetPrintResults()) { @@ -2427,7 +2418,6 @@ void CommandInterpreter::HandleCommandsFromFile(FileSpec &cmd_file, result.AppendErrorWithFormat( "Error reading commands from file %s - file not found.\n", cmd_file.GetFilename().AsCString("<Unknown>")); - result.SetStatus(eReturnStatusFailed); return; } @@ -2439,7 +2429,6 @@ void CommandInterpreter::HandleCommandsFromFile(FileSpec &cmd_file, result.AppendErrorWithFormatv( "error: an error occurred read file '{0}': {1}\n", cmd_file_path, llvm::fmt_consume(input_file_up.takeError())); - result.SetStatus(eReturnStatusFailed); return; } FileSP input_file_sp = FileSP(std::move(input_file_up.get())); @@ -3184,7 +3173,6 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line, result.AppendErrorWithFormat("'%s' is not a valid command.\n", next_word.c_str()); } - result.SetStatus(eReturnStatusFailed); return nullptr; } @@ -3196,7 +3184,6 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line, cmd_obj->GetCommandName().str().c_str(), next_word.empty() ? "" : next_word.c_str(), next_word.empty() ? " -- " : " ", suffix.c_str()); - result.SetStatus(eReturnStatusFailed); return nullptr; } } else { @@ -3232,7 +3219,6 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line, result.AppendErrorWithFormat( "the '%s' command doesn't support the --gdb-format option\n", cmd_obj->GetCommandName().str().c_str()); - result.SetStatus(eReturnStatusFailed); return nullptr; } } @@ -3241,7 +3227,6 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line, default: result.AppendErrorWithFormat( "unknown command shorthand suffix: '%s'\n", suffix.c_str()); - result.SetStatus(eReturnStatusFailed); return nullptr; } } diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index f39ef20..4aa298f 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -137,7 +137,6 @@ bool Options::VerifyOptions(CommandReturnObject &result) { result.SetStatus(eReturnStatusSuccessFinishNoResult); } else { result.AppendError("invalid combination of options for the given command"); - result.SetStatus(eReturnStatusFailed); } return options_are_valid; diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index 7fb07fb..3802f2d 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -36,14 +36,12 @@ ScriptInterpreter::ScriptInterpreter( void ScriptInterpreter::CollectDataForBreakpointCommandCallback( std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec, CommandReturnObject &result) { - result.SetStatus(eReturnStatusFailed); result.AppendError( "This script interpreter does not support breakpoint callbacks."); } void ScriptInterpreter::CollectDataForWatchpointCommandCallback( WatchpointOptions *bp_options, CommandReturnObject &result) { - result.SetStatus(eReturnStatusFailed); result.AppendError( "This script interpreter does not support watchpoint callbacks."); } |