[LLDB][Reliability] Remove dead code.

Remove redundant code that can never execute due to preceeding logic checks in the code.

Differential Revision: https://reviews.llvm.org/D130929
This commit is contained in:
Slava Gurevich 2022-08-01 12:36:38 -07:00
parent 85a6dd50ad
commit d735307aa2
5 changed files with 9 additions and 22 deletions

View File

@ -739,7 +739,7 @@ SBValueList SBFrame::GetVariables(bool arguments, bool locals, bool statics,
lldb::DynamicValueType use_dynamic =
frame->CalculateTarget()->GetPreferDynamicValue();
const bool include_runtime_support_values =
target ? target->GetDisplayRuntimeSupportValues() : false;
target->GetDisplayRuntimeSupportValues();
SBVariablesOptions options;
options.SetIncludeArguments(arguments);

View File

@ -612,9 +612,6 @@ static bool LoadValueFromConsecutiveGPRRegisters(
++NGRN;
}
if (reg_info == nullptr)
return false;
const lldb::addr_t value_addr =
reg_ctx->ReadRegisterAsUnsigned(reg_info, LLDB_INVALID_ADDRESS);

View File

@ -582,9 +582,6 @@ static bool LoadValueFromConsecutiveGPRRegisters(
++NGRN;
}
if (reg_info == nullptr)
return false;
const lldb::addr_t value_addr =
reg_ctx->ReadRegisterAsUnsigned(reg_info, LLDB_INVALID_ADDRESS);

View File

@ -65,9 +65,6 @@ bool lldb_private::formatters::CMTimeSummaryProvider(
return true;
}
if (timescale == 0)
return false;
switch (timescale) {
case 0:
return false;

View File

@ -1772,24 +1772,20 @@ lldb::ProcessSP Platform::DoConnectProcess(llvm::StringRef connect_url,
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;
target = new_target_sp.get();
if (!target || error.Fail()) {
return nullptr;
}
}
lldb::ProcessSP process_sp =
target->CreateProcess(debugger.GetListener(), plugin_name, nullptr, true);