[Lldb-commits] [PATCH] D130929: [LLDB][Reliability] Remove dead code.

Slava Gurevich via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 2 10:10:12 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd735307aa2be: [LLDB][Reliability] Remove dead code. (authored by fixathon).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130929/new/

https://reviews.llvm.org/D130929

Files:
  lldb/source/API/SBFrame.cpp
  lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
  lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
  lldb/source/Plugins/Language/ObjC/CoreMedia.cpp
  lldb/source/Target/Platform.cpp


Index: lldb/source/Target/Platform.cpp
===================================================================
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -1772,25 +1772,21 @@
   error.Clear();
 
   if (!target) {
-    ArchSpec arch;
-    if (target && target->GetArchitecture().IsValid())
-      arch = target->GetArchitecture();
-    else
-      arch = Target::GetDefaultArchitecture();
+    ArchSpec arch = Target::GetDefaultArchitecture();
 
-    const char *triple = "";
-    if (arch.IsValid())
-      triple = arch.GetTriple().getTriple().c_str();
+    const char *triple =
+        arch.IsValid() ? arch.GetTriple().getTriple().c_str() : "";
 
     TargetSP new_target_sp;
     error = debugger.GetTargetList().CreateTarget(
         debugger, "", triple, eLoadDependentsNo, nullptr, new_target_sp);
+
     target = new_target_sp.get();
+    if (!target || error.Fail()) {
+      return nullptr;
+    }
   }
 
-  if (!target || error.Fail())
-    return nullptr;
-
   lldb::ProcessSP process_sp =
       target->CreateProcess(debugger.GetListener(), plugin_name, nullptr, true);
 
Index: lldb/source/Plugins/Language/ObjC/CoreMedia.cpp
===================================================================
--- lldb/source/Plugins/Language/ObjC/CoreMedia.cpp
+++ lldb/source/Plugins/Language/ObjC/CoreMedia.cpp
@@ -65,9 +65,6 @@
     return true;
   }
 
-  if (timescale == 0)
-    return false;
-
   switch (timescale) {
   case 0:
     return false;
Index: lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
===================================================================
--- lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
+++ lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
@@ -582,9 +582,6 @@
       ++NGRN;
     }
 
-    if (reg_info == nullptr)
-      return false;
-
     const lldb::addr_t value_addr =
         reg_ctx->ReadRegisterAsUnsigned(reg_info, LLDB_INVALID_ADDRESS);
 
Index: lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
===================================================================
--- lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
+++ lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
@@ -612,9 +612,6 @@
       ++NGRN;
     }
 
-    if (reg_info == nullptr)
-      return false;
-
     const lldb::addr_t value_addr =
         reg_ctx->ReadRegisterAsUnsigned(reg_info, LLDB_INVALID_ADDRESS);
 
Index: lldb/source/API/SBFrame.cpp
===================================================================
--- lldb/source/API/SBFrame.cpp
+++ lldb/source/API/SBFrame.cpp
@@ -739,7 +739,7 @@
     lldb::DynamicValueType use_dynamic =
         frame->CalculateTarget()->GetPreferDynamicValue();
     const bool include_runtime_support_values =
-        target ? target->GetDisplayRuntimeSupportValues() : false;
+        target->GetDisplayRuntimeSupportValues();
 
     SBVariablesOptions options;
     options.SetIncludeArguments(arguments);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130929.449328.patch
Type: text/x-patch
Size: 2913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220802/2ee49f26/attachment.bin>


More information about the lldb-commits mailing list