From 3924d754e59683a3461e05e3c8d57a9d6ff347fb Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 13 Jun 2014 03:30:39 +0000 Subject: [PATCH] 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). llvm-svn: 210879 --- lldb/source/API/SBTarget.cpp | 11 ----------- lldb/source/Expression/ClangExpressionDeclMap.cpp | 9 --------- lldb/source/Interpreter/ScriptInterpreterPython.cpp | 3 --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 2 +- .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 14 ++++---------- 5 files changed, 5 insertions(+), 34 deletions(-) diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 27a492d..900ccaf 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -2439,10 +2439,6 @@ SBTarget::SetSectionLoadAddress (lldb::SBSection section, 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::SBSection section) 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::SBModule module) 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(); diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 76b5c58..2dee8c86 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1502,16 +1502,7 @@ ClangExpressionDeclMap::GetVariableValue (VariableSP &var, 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()) diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index da84353..b0a889e 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -1018,7 +1018,6 @@ ScriptInterpreterPython::ExecuteMultipleLines (const char *in_string, const Exec 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::ExecuteMultipleLines (const char *in_string, const Exec //PythonInputReaderManager py_input(options.GetEnableIO() ? this : NULL); return_value.Reset(PyEval_EvalCode (compiled_code, globals.get(), locals.get())); } - if (return_value) - success = true; } } } diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index b858711..75b8e78 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -5181,7 +5181,7 @@ ObjectFileMachO::SaveCore (const lldb::ProcessSP &process_sp, if (make_core) { std::vector 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()) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 182688d..4ba2ca1 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -2393,7 +2393,6 @@ GDBRemoteCommunicationClient::GetCurrentProcessInfo () 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::GetCurrentProcessInfo () } 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) { -- 2.7.4