Remove unused variables
authorSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 13 Jun 2014 03:30:39 +0000 (03:30 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Fri, 13 Jun 2014 03:30:39 +0000 (03:30 +0000)
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
lldb/source/Expression/ClangExpressionDeclMap.cpp
lldb/source/Interpreter/ScriptInterpreterPython.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

index 27a492d..900ccaf 100644 (file)
@@ -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();
index 76b5c58..2dee8c8 100644 (file)
@@ -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())
index da84353..b0a889e 100644 (file)
@@ -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;
             }
         }
     }
index b858711..75b8e78 100644 (file)
@@ -5181,7 +5181,7 @@ ObjectFileMachO::SaveCore (const lldb::ProcessSP &process_sp,
             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())
index 182688d..4ba2ca1 100644 (file)
@@ -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)
                 {