https://github.com/kazutakahirata created 
https://github.com/llvm/llvm-project/pull/141183

None

>From ab8b6e252e6d62f6dcac140127dae8700634d117 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <k...@google.com>
Date: Wed, 21 May 2025 20:04:38 -0700
Subject: [PATCH] [lldb] Remove redundant control flow statements (NFC)

---
 lldb/include/lldb/Interpreter/ScriptInterpreter.h           | 6 ++----
 lldb/include/lldb/Target/Process.h                          | 2 +-
 lldb/source/Commands/CommandObjectDiagnostics.cpp           | 1 -
 lldb/source/Commands/CommandObjectTarget.cpp                | 2 --
 .../Python/Interfaces/ScriptedPythonInterface.h             | 1 -
 lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp    | 1 -
 6 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h 
b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
index 3a4a7ae924584..f1c3eefdcd874 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
@@ -500,10 +500,8 @@ class ScriptInterpreter : public PluginInterface {
     return false;
   }
 
-  virtual void OptionParsingStartedForCommandObject(
-      StructuredData::GenericSP cmd_obj_sp) {
-    return;
-  }
+  virtual void
+  OptionParsingStartedForCommandObject(StructuredData::GenericSP cmd_obj_sp) {}
 
   virtual uint32_t
   GetFlagsForCommandObject(StructuredData::GenericSP cmd_obj_sp) {
diff --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index 536a69fb89759..a8892e9c43225 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -605,7 +605,7 @@ class Process : public 
std::enable_shared_from_this<Process>,
 
   /// The underlying plugin might store the low-level communication history for
   /// this session.  Dump it into the provided stream.
-  virtual void DumpPluginHistory(Stream &s) { return; }
+  virtual void DumpPluginHistory(Stream &s) {}
 
   /// Launch a new process.
   ///
diff --git a/lldb/source/Commands/CommandObjectDiagnostics.cpp 
b/lldb/source/Commands/CommandObjectDiagnostics.cpp
index ac87f869f0127..b565e16e76b53 100644
--- a/lldb/source/Commands/CommandObjectDiagnostics.cpp
+++ b/lldb/source/Commands/CommandObjectDiagnostics.cpp
@@ -96,7 +96,6 @@ class CommandObjectDiagnosticsDump : public 
CommandObjectParsed {
     result.GetOutputStream() << "diagnostics written to " << *directory << 
'\n';
 
     result.SetStatus(eReturnStatusSuccessFinishResult);
-    return;
   }
 
   CommandOptions m_options;
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp 
b/lldb/source/Commands/CommandObjectTarget.cpp
index 8c877fc971056..e2ba0008badd3 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -649,8 +649,6 @@ class CommandObjectTargetDelete : public 
CommandObjectParsed {
     result.GetOutputStream().Printf("%u targets deleted.\n",
                                     (uint32_t)num_targets_to_delete);
     result.SetStatus(eReturnStatusSuccessFinishResult);
-
-    return;
   }
 
   OptionGroupOptions m_option_group;
diff --git 
a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
 
b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
index 4b9f463ef5605..b38b65e3545c4 100644
--- 
a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
+++ 
b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
@@ -463,7 +463,6 @@ class ScriptedPythonInterface : virtual public 
ScriptedInterface {
   template <typename T, typename U>
   void ReverseTransform(T &original_arg, U transformed_arg, Status &error) {
     // If U is not a PythonObject, don't touch it!
-    return;
   }
 
   template <typename T>
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
index 1703597a7cd2f..a00127b8e5580 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
@@ -263,7 +263,6 @@ void AppleDWARFIndex::GetTypes(
     m_module.LogMessage(log, "FindByNameAndTag()");
   const dw_tag_t expected_tag = context[0].tag;
   SearchFor(*m_apple_types_up, expected_name, callback, expected_tag);
-  return;
 }
 
 void AppleDWARFIndex::GetNamespaces(

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to