[Lldb-commits] [lldb] r210879 - Remove unused variables
Saleem Abdulrasool
compnerd at compnerd.org
Thu Jun 12 20:30:39 PDT 2014
Author: compnerd
Date: Thu Jun 12 22:30:39 2014
New Revision: 210879
URL: http://llvm.org/viewvc/llvm-project?rev=210879&view=rev
Log:
Remove unused variables
Address the 'variable set but not used' warning from GCC. In some cases a few
additional calls were removed where there should be no visible side effects of
the calls (i.e. should not effect any cached state).
Modified:
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=210879&r1=210878&r2=210879&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Thu Jun 12 22:30:39 2014
@@ -2439,10 +2439,6 @@ SBTarget::SetSectionLoadAddress (lldb::S
else
{
ProcessSP process_sp (target_sp->GetProcessSP());
- uint32_t stop_id = 0;
- if (process_sp)
- stop_id = process_sp->GetStopID();
-
if (target_sp->SetSectionLoadAddress (section_sp, section_base_addr))
{
// Flush info in the process (stack frames, etc)
@@ -2475,10 +2471,6 @@ SBTarget::ClearSectionLoadAddress (lldb:
else
{
ProcessSP process_sp (target_sp->GetProcessSP());
- uint32_t stop_id = 0;
- if (process_sp)
- stop_id = process_sp->GetStopID();
-
if (target_sp->SetSectionUnloaded (section.GetSP()))
{
// Flush info in the process (stack frames, etc)
@@ -2554,9 +2546,6 @@ SBTarget::ClearModuleLoadAddress (lldb::
if (section_list)
{
ProcessSP process_sp (target_sp->GetProcessSP());
- uint32_t stop_id = 0;
- if (process_sp)
- stop_id = process_sp->GetStopID();
bool changed = false;
const size_t num_sections = section_list->GetSize();
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=210879&r1=210878&r2=210879&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Jun 12 22:30:39 2014
@@ -1502,16 +1502,7 @@ ClangExpressionDeclMap::GetVariableValue
DWARFExpression &var_location_expr = var->LocationExpression();
- lldb::addr_t loclist_base_load_addr = LLDB_INVALID_ADDRESS;
-
Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();
-
- if (var_location_expr.IsLocationList())
- {
- SymbolContext var_sc;
- var->CalculateSymbolContext (&var_sc);
- loclist_base_load_addr = var_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (target);
- }
Error err;
if (var->GetLocationIsConstantValueData())
Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=210879&r1=210878&r2=210879&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Thu Jun 12 22:30:39 2014
@@ -1018,7 +1018,6 @@ ScriptInterpreterPython::ExecuteMultiple
ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitGlobals : 0),
ScriptInterpreterPython::Locker::FreeAcquiredLock | ScriptInterpreterPython::Locker::TearDownSession);
- bool success = false;
PythonObject return_value;
PythonObject &main_module = GetMainModule ();
PythonDictionary globals (PyModule_GetDict(main_module.get()));
@@ -1052,8 +1051,6 @@ ScriptInterpreterPython::ExecuteMultiple
//PythonInputReaderManager py_input(options.GetEnableIO() ? this : NULL);
return_value.Reset(PyEval_EvalCode (compiled_code, globals.get(), locals.get()));
}
- if (return_value)
- success = true;
}
}
}
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=210879&r1=210878&r2=210879&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Jun 12 22:30:39 2014
@@ -5181,7 +5181,7 @@ ObjectFileMachO::SaveCore (const lldb::P
if (make_core)
{
std::vector<segment_command_64> segment_load_commands;
- uint32_t range_info_idx = 0;
+// uint32_t range_info_idx = 0;
MemoryRegionInfo range_info;
Error range_error = process_sp->GetMemoryRegionInfo(0, range_info);
if (range_error.Success())
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=210879&r1=210878&r2=210879&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Thu Jun 12 22:30:39 2014
@@ -2393,7 +2393,6 @@ GDBRemoteCommunicationClient::GetCurrent
std::string triple;
uint32_t pointer_byte_size = 0;
StringExtractor extractor;
- ByteOrder byte_order = eByteOrderInvalid;
uint32_t num_keys_decoded = 0;
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
while (response.GetNameColonValue(name, value))
@@ -2422,15 +2421,10 @@ GDBRemoteCommunicationClient::GetCurrent
}
else if (name.compare("endian") == 0)
{
- ++num_keys_decoded;
- if (value.compare("little") == 0)
- byte_order = eByteOrderLittle;
- else if (value.compare("big") == 0)
- byte_order = eByteOrderBig;
- else if (value.compare("pdp") == 0)
- byte_order = eByteOrderPDP;
- else
- --num_keys_decoded;
+ if (value.compare("little") == 0 ||
+ value.compare("big") == 0 ||
+ value.compare("pdp") == 0)
+ ++num_keys_decoded;
}
else if (name.compare("ptrsize") == 0)
{
More information about the lldb-commits
mailing list