From 7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 16 Jun 2021 13:56:51 +0100 Subject: [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 --- .../RenderScriptRuntime/RenderScriptRuntime.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp') diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 8a9be6d40c7c..7280e66617f0 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -4187,7 +4187,6 @@ public: result.AppendErrorWithFormat("'%s' takes 1 argument of reduction name, " "and an optional kernel type list", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4201,7 +4200,6 @@ public: auto coord = m_options.m_have_coord ? &m_options.m_coord : nullptr; if (!runtime->PlaceBreakpointOnReduction(target, outstream, name, coord, m_options.m_kernel_types)) { - result.SetStatus(eReturnStatusFailed); result.AppendError("Error: unable to place breakpoint on reduction"); return false; } @@ -4289,7 +4287,6 @@ public: result.AppendErrorWithFormat( "'%s' takes 1 argument of kernel name, and an optional coordinate.", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4302,7 +4299,6 @@ public: auto name = command.GetArgumentAtIndex(0); auto coord = m_options.m_have_coord ? &m_options.m_coord : nullptr; if (!runtime->PlaceBreakpointOnKernel(target, outstream, name, coord)) { - result.SetStatus(eReturnStatusFailed); result.AppendErrorWithFormat( "Error: unable to set breakpoint on kernel '%s'", name); return false; @@ -4340,7 +4336,6 @@ public: if (argc != 1) { result.AppendErrorWithFormat( "'%s' takes 1 argument of 'enable' or 'disable'", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4359,7 +4354,6 @@ public: } else { result.AppendErrorWithFormat( "Argument must be either 'enable' or 'disable'"); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4566,7 +4560,6 @@ public: result.AppendErrorWithFormat("'%s' takes 1 argument, an allocation ID. " "As well as an optional -f argument", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4581,7 +4574,6 @@ public: if (!success) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4606,7 +4598,6 @@ public: std::string error = llvm::toString(file.takeError()); result.AppendErrorWithFormat("Couldn't open file '%s': %s", path.c_str(), error.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } } else @@ -4715,7 +4706,6 @@ public: result.AppendErrorWithFormat( "'%s' takes 2 arguments, an allocation ID and filename to read from.", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4730,7 +4720,6 @@ public: if (!success) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4766,7 +4755,6 @@ public: result.AppendErrorWithFormat( "'%s' takes 2 arguments, an allocation ID and filename to read from.", m_cmd_name.c_str()); - result.SetStatus(eReturnStatusFailed); return false; } @@ -4781,7 +4769,6 @@ public: if (!success) { result.AppendErrorWithFormat("invalid allocation id argument '%s'", id_cstr); - result.SetStatus(eReturnStatusFailed); return false; } -- cgit v1.2.3