[Lldb-commits] [lldb] r108299 - in /lldb/trunk: include/lldb/Expression/ include/lldb/Interpreter/ lldb.xcodeproj/ source/API/ source/Commands/ source/Core/ source/Expression/ source/Interpreter/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/Process/Utility/libunwind/src/ source/Plugins/SymbolFile/DWARF/ source/Symbol/ source/Target/ tools/driver/

Greg Clayton gclayton at apple.com
Tue Jul 13 17:18:16 PDT 2010


Author: gclayton
Date: Tue Jul 13 19:18:15 2010
New Revision: 108299

URL: http://llvm.org/viewvc/llvm-project?rev=108299&view=rev
Log:
I enabled some extra warnings for hidden local variables and for hidden
virtual functions and caught some things and did some general code cleanup.


Modified:
    lldb/trunk/include/lldb/Expression/ClangASTSource.h
    lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBThread.cpp
    lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
    lldb/trunk/source/Commands/CommandObjectImage.cpp
    lldb/trunk/source/Commands/CommandObjectProcess.cpp
    lldb/trunk/source/Commands/CommandObjectThread.cpp
    lldb/trunk/source/Core/Address.cpp
    lldb/trunk/source/Core/InputReader.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Expression/ClangExpression.cpp
    lldb/trunk/source/Expression/ClangFunction.cpp
    lldb/trunk/source/Interpreter/Args.cpp
    lldb/trunk/source/Interpreter/Options.cpp
    lldb/trunk/source/Interpreter/ScriptInterpreter.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp
    lldb/trunk/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp
    lldb/trunk/source/Symbol/Type.cpp
    lldb/trunk/source/Target/ThreadList.cpp
    lldb/trunk/source/Target/ThreadPlan.cpp
    lldb/trunk/tools/driver/Driver.cpp
    lldb/trunk/tools/driver/IOChannel.cpp

Modified: lldb/trunk/include/lldb/Expression/ClangASTSource.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangASTSource.h?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangASTSource.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangASTSource.h Tue Jul 13 19:18:15 2010
@@ -21,10 +21,10 @@
 public:
     friend struct NameSearchContext;
     
-	ClangASTSource(clang::ASTContext &Context,
-                   ClangExpressionDeclMap &DeclMap) : 
-        Context(Context),
-        DeclMap(DeclMap) {}
+	ClangASTSource(clang::ASTContext &context,
+                   ClangExpressionDeclMap &declMap) : 
+        Context(context),
+        DeclMap(declMap) {}
 	~ClangASTSource();
 	
     clang::Decl *GetExternalDecl(uint32_t);
@@ -49,14 +49,14 @@
     clang::DeclarationName &Name;
     const clang::DeclContext *DC;
     
-    NameSearchContext (ClangASTSource &ASTSource,
-                       llvm::SmallVectorImpl<clang::NamedDecl*> &Decls,
-                       clang::DeclarationName &Name,
-                       const clang::DeclContext *DC) :
-        ASTSource(ASTSource),
-        Decls(Decls),
-        Name(Name),
-        DC(DC) {}
+    NameSearchContext (ClangASTSource &astSource,
+                       llvm::SmallVectorImpl<clang::NamedDecl*> &decls,
+                       clang::DeclarationName &name,
+                       const clang::DeclContext *dc) :
+        ASTSource(astSource),
+        Decls(decls),
+        Name(name),
+        DC(dc) {}
     
     clang::ASTContext *GetASTContext();
     clang::NamedDecl *AddVarDecl(void *type);

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h Tue Jul 13 19:18:15 2010
@@ -73,8 +73,9 @@
     }
 
     virtual void 
-    CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
-                                            CommandReturnObject &result);
+    CollectDataForBreakpointCommandCallback (CommandInterpreter &interpreter,
+                                             BreakpointOptions *bp_options,
+                                             CommandReturnObject &result);
 
     const char *
     GetScriptInterpreterPtyName ();

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Jul 13 19:18:15 2010
@@ -2700,6 +2700,7 @@
 					LLDB_CONFIGURATION_DEBUG,
 				);
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				PREBINDING = NO;
@@ -2722,6 +2723,7 @@
 					LLDB_CONFIGURATION_RELEASE,
 				);
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				PREBINDING = NO;
 				VALID_ARCHS = "x86_64 i386";
@@ -2850,6 +2852,7 @@
 					LLDB_CONFIGURATION_BUILD_AND_INTEGRATION,
 				);
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				PREBINDING = NO;
 				VALID_ARCHS = "x86_64 i386";

Modified: lldb/trunk/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Tue Jul 13 19:18:15 2010
@@ -100,7 +100,6 @@
             }
             else
             {
-                const char *stop_desc = NULL;
                 size_t stop_desc_len = 0;
                 switch (thread_stop_info.GetStopReason())
                 {

Modified: lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp Tue Jul 13 19:18:15 2010
@@ -258,12 +258,15 @@
                     {
                         if (m_options.m_use_script_language)
                         {
-                            interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (bp_loc_sp->GetLocationOptions(),
-                                                                                                          result);
+                            interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (interpreter,
+                                                                                                         bp_loc_sp->GetLocationOptions(),
+                                                                                                         result);
                         }
                         else
                         {
-                            CollectDataForBreakpointCommandCallback (interpreter, bp_loc_sp->GetLocationOptions(), result);
+                            CollectDataForBreakpointCommandCallback (interpreter, 
+                                                                     bp_loc_sp->GetLocationOptions(), 
+                                                                     result);
                         }
                     }
                 }
@@ -271,12 +274,15 @@
                 {
                     if (m_options.m_use_script_language)
                     {
-                        interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (bp->GetOptions(),
-                                                                                                      result);
+                        interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (interpreter,
+                                                                                                     bp->GetOptions(),
+                                                                                                     result);
                     }
                     else
                     {
-                        CollectDataForBreakpointCommandCallback (interpreter, bp->GetOptions(), result);
+                        CollectDataForBreakpointCommandCallback (interpreter, 
+                                                                 bp->GetOptions(), 
+                                                                 result);
                     }
                 }
             }

Modified: lldb/trunk/source/Commands/CommandObjectImage.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectImage.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectImage.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectImage.cpp Tue Jul 13 19:18:15 2010
@@ -1395,9 +1395,9 @@
                     
                     if (num_matching_modules > 0)
                     {
-                        for (size_t i=0; i<num_matching_modules; ++i)
+                        for (size_t j=0; j<num_matching_modules; ++j)
                         {
-                            Module * image_module = matching_modules.GetModulePointerAtIndex(i);
+                            Module * image_module = matching_modules.GetModulePointerAtIndex(j);
                             if (image_module)
                             {
                                 if (LookupInModule (interpreter, image_module, result, syntax_error))

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Tue Jul 13 19:18:15 2010
@@ -536,7 +536,7 @@
                 result.AppendMessageWithFormat ("Resuming process %i\n", process->GetID());
                 if (synchronous_execution)
                 {
-                    StateType state = process->WaitForProcessToStop (NULL);
+                    state = process->WaitForProcessToStop (NULL);
 
                     result.SetDidChangeProcessState (true);
                     result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state));

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Tue Jul 13 19:18:15 2010
@@ -760,7 +760,7 @@
                 result.AppendMessageWithFormat ("Resuming process %i\n", process->GetID());
                 if (synchronous_execution)
                 {
-                    StateType state = process->WaitForProcessToStop (NULL);
+                    state = process->WaitForProcessToStop (NULL);
 
                     result.SetDidChangeProcessState (true);
                     result.AppendMessageWithFormat ("Process %i %s\n", process->GetID(), StateAsCString (state));
@@ -827,7 +827,7 @@
             {
                 case 't':
                 {
-                    uint32_t m_thread_idx = Args::StringToUInt32 (option_arg, LLDB_INVALID_INDEX32);
+                    m_thread_idx = Args::StringToUInt32 (option_arg, LLDB_INVALID_INDEX32);
                     if (m_thread_idx == LLDB_INVALID_INDEX32)
                     {
                         error.SetErrorStringWithFormat ("Invalid thread index '%s'.\n", option_arg);

Modified: lldb/trunk/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Core/Address.cpp (original)
+++ lldb/trunk/source/Core/Address.cpp Tue Jul 13 19:18:15 2010
@@ -628,7 +628,6 @@
                             if (so_addr.IsSectionOffset())
                             {
                                 lldb_private::SymbolContext pointer_sc;
-                                Target *target = exe_scope->CalculateTarget();
                                 if (target)
                                 {
                                     target->GetImages().ResolveSymbolContextForAddress (so_addr,

Modified: lldb/trunk/source/Core/InputReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/InputReader.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Core/InputReader.cpp (original)
+++ lldb/trunk/source/Core/InputReader.cpp Tue Jul 13 19:18:15 2010
@@ -196,7 +196,6 @@
         {
             const char *line_start = bytes;
             const char *end_line = NULL;
-            const char *end = bytes + bytes_len;
             while (p < end)
             {
                 const char ch = *p;

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Jul 13 19:18:15 2010
@@ -540,7 +540,7 @@
     lldb::Encoding encoding = Type::GetEncoding (GetOpaqueClangQualType(), count);
 
     char *end = NULL;
-    size_t byte_size = GetByteSize();
+    const size_t byte_size = GetByteSize();
     switch (encoding)
     {
     case eEncodingInvalid:
@@ -580,7 +580,6 @@
 
     case eEncodingIEEE754:
         {
-            const size_t byte_size = GetByteSize();
             const off_t byte_offset = GetByteOffset();
             uint8_t *dst = const_cast<uint8_t *>(m_data.PeekData(byte_offset, byte_size));
             if (dst != NULL)

Modified: lldb/trunk/source/Expression/ClangExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpression.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpression.cpp Tue Jul 13 19:18:15 2010
@@ -583,15 +583,15 @@
     // For now I only write functions with no stubs, globals, exception tables,
     // etc.  So I only need to write the functions.
 
-    size_t size = 0;
+    size_t alloc_size = 0;
     std::map<uint8_t *, uint8_t *>::iterator fun_pos, fun_end = m_jit_mm_ptr->m_functions.end();
     for (fun_pos = m_jit_mm_ptr->m_functions.begin(); fun_pos != fun_end; fun_pos++)
     {
-        size += (*fun_pos).second - (*fun_pos).first;
+        alloc_size += (*fun_pos).second - (*fun_pos).first;
     }
 
     Error error;
-    lldb::addr_t target_addr = exc_context.process->AllocateMemory (size, lldb::ePermissionsReadable|lldb::ePermissionsExecutable, error);
+    lldb::addr_t target_addr = exc_context.process->AllocateMemory (alloc_size, lldb::ePermissionsReadable|lldb::ePermissionsExecutable, error);
 
     if (target_addr == LLDB_INVALID_ADDRESS)
         return false;

Modified: lldb/trunk/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangFunction.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangFunction.cpp (original)
+++ lldb/trunk/source/Expression/ClangFunction.cpp Tue Jul 13 19:18:15 2010
@@ -552,7 +552,7 @@
             {
                 timeout_ptr = NULL;
                 
-                lldb::StateType stop_state =  process->WaitForStateChangedEvents (timeout_ptr, event_sp);
+                stop_state =  process->WaitForStateChangedEvents (timeout_ptr, event_sp);
                 if (stop_state == lldb::eStateInvalid)
                 {
                     errors.Printf ("Got an invalid stop state after halt.");

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Tue Jul 13 19:18:15 2010
@@ -454,7 +454,6 @@
 Args::ParseOptions (Options &options)
 {
     StreamString sstr;
-    int i;
     Error error;
     struct option *long_options = options.GetLongOptions();
     if (long_options == NULL)
@@ -463,7 +462,7 @@
         return error;
     }
 
-    for (i=0; long_options[i].name != NULL; ++i)
+    for (int i=0; long_options[i].name != NULL; ++i)
     {
         if (long_options[i].flag == NULL)
         {
@@ -950,7 +949,6 @@
 )
 {
     StreamString sstr;
-    int i;
     struct option *long_options = options.GetLongOptions();
     option_element_vector.clear();
 
@@ -963,7 +961,7 @@
     // to suppress error messages.
 
     sstr << ":";
-    for (i = 0; long_options[i].name != NULL; ++i)
+    for (int i = 0; long_options[i].name != NULL; ++i)
     {
         if (long_options[i].flag == NULL)
         {

Modified: lldb/trunk/source/Interpreter/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Options.cpp (original)
+++ lldb/trunk/source/Interpreter/Options.cpp Tue Jul 13 19:18:15 2010
@@ -570,9 +570,9 @@
                 // within the option group they belong to.
                 char opt_str[3] = {'-', 'a', '\0'};
                 
-                for (int i = 0 ; opt_defs[i].short_option != 0 ; i++)
+                for (int j = 0 ; opt_defs[j].short_option != 0 ; j++)
                 {   
-                    opt_str[1] = opt_defs[i].short_option;
+                    opt_str[1] = opt_defs[j].short_option;
                     matches.AppendString (opt_str);
                 }
                 return true;
@@ -580,10 +580,10 @@
             else if (opt_defs_index == OptionArgElement::eBareDoubleDash)
             {
                 std::string full_name ("--");
-                for (int i = 0 ; opt_defs[i].short_option != 0 ; i++)
+                for (int j = 0 ; opt_defs[j].short_option != 0 ; j++)
                 {   
                     full_name.erase(full_name.begin() + 2, full_name.end());
-                    full_name.append (opt_defs[i].long_option);
+                    full_name.append (opt_defs[j].long_option);
                     matches.AppendString (full_name.c_str());
                 }
                 return true;
@@ -619,18 +619,18 @@
                 if (cur_opt_str && strlen (cur_opt_str) > 2
                     && cur_opt_str[0] == '-' && cur_opt_str[1] == '-')
                 {
-                    for (int i = 0 ; opt_defs[i].short_option != 0 ; i++)
+                    for (int j = 0 ; opt_defs[j].short_option != 0 ; j++)
                     {
-                        if (strstr(opt_defs[i].long_option, cur_opt_str + 2) == opt_defs[i].long_option)
+                        if (strstr(opt_defs[j].long_option, cur_opt_str + 2) == opt_defs[j].long_option)
                         {
                             std::string full_name ("--");
-                            full_name.append (opt_defs[i].long_option);
+                            full_name.append (opt_defs[j].long_option);
                             // The options definitions table has duplicates because of the
                             // way the grouping information is stored, so only add once.
                             bool duplicate = false;
-                            for (int j = 0; j < matches.GetSize(); j++)
+                            for (int k = 0; k < matches.GetSize(); k++)
                             {
-                                if (matches.GetStringAtIndex(j) == full_name)
+                                if (matches.GetStringAtIndex(k) == full_name)
                                 {
                                     duplicate = true;
                                     break;

Modified: lldb/trunk/source/Interpreter/ScriptInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreter.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreter.cpp Tue Jul 13 19:18:15 2010
@@ -54,6 +54,7 @@
 void 
 ScriptInterpreter::CollectDataForBreakpointCommandCallback 
 (
+    CommandInterpreter &interpreter,
     BreakpointOptions *bp_options,
     CommandReturnObject &result
 )

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Jul 13 19:18:15 2010
@@ -505,7 +505,6 @@
     {
         Mutex::Locker locker(m_mutex);
         uint32_t idx;
-        Error error;
         uint32_t i = 0;
         DYLDImageInfo::collection old_dyld_all_image_infos;
         old_dyld_all_image_infos.swap(m_dyld_image_infos);

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/ObjCTrampolineHandler.cpp Tue Jul 13 19:18:15 2010
@@ -245,7 +245,7 @@
             StreamString errors;
             { 
                 // Scope for mutex locker:
-                Mutex::Locker (m_impl_function_mutex);
+                Mutex::Locker locker(m_impl_function_mutex);
                 if (!m_impl_function.get())
                 {
                      m_impl_function.reset(new ClangFunction(process->GetTargetTriple().GetCString(), 
@@ -257,7 +257,6 @@
                     unsigned num_errors = m_impl_function->CompileFunction(errors);
                     if (num_errors)
                     {
-                        Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP);
                         if (log)
                             log->Printf ("Error compiling function: \"%s\".", errors.GetData());
                         return ret_plan_sp;
@@ -266,7 +265,6 @@
                     errors.Clear();
                     if (!m_impl_function->WriteFunctionWrapper(exec_ctx, errors))
                     {
-                        Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP);
                         if (log)
                             log->Printf ("Error Inserting function: \"%s\".", errors.GetData());
                         return ret_plan_sp;

Modified: lldb/trunk/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/libunwind/src/UnwindCursor.hpp Tue Jul 13 19:18:15 2010
@@ -551,12 +551,12 @@
 	const UnwindSectionIndexArray<A> topIndex(fAddressSpace, unwindSectionStart + sectionHeader.indexSectionOffset());
 	uint32_t low = 0;
 	uint32_t high = sectionHeader.indexCount();
-	const uint32_t last = high - 1;
+	const uint32_t last_section_header = high - 1;
 	while ( low < high ) {
 		uint32_t mid = (low + high)/2;
 		//if ( log ) fprintf(stderr, "\tmid=%d, low=%d, high=%d, *mid=0x%08X\n", mid, low, high, topIndex.functionOffset(mid));
 		if ( topIndex.functionOffset(mid) <= targetFunctionOffset ) {
-			if ( (mid == last) || (topIndex.functionOffset(mid+1) > targetFunctionOffset) ) {
+			if ( (mid == last_section_header) || (topIndex.functionOffset(mid+1) > targetFunctionOffset) ) {
 				low = mid;
 				break;
 			}
@@ -589,8 +589,8 @@
 		// binary search looks for entry with e where index[e].offset <= pc < index[e+1].offset
 		if ( log ) fprintf(stderr, "\tbinary search for targetFunctionOffset=0x%08llX in regular page starting at secondLevelAddr=0x%llX\n", 
 			(uint64_t)targetFunctionOffset, (uint64_t)secondLevelAddr);
-		uint32_t low = 0;
-		uint32_t high = pageHeader.entryCount();
+		low = 0;
+		high = pageHeader.entryCount();
 		while ( low < high ) {
 			uint32_t mid = (low + high)/2;
 			if ( pageIndex.functionOffset(mid) <= targetFunctionOffset ) {
@@ -632,13 +632,13 @@
 		const uint32_t targetFunctionPageOffset = targetFunctionOffset - firstLevelFunctionOffset;
 		// binary search looks for entry with e where index[e].offset <= pc < index[e+1].offset
 		if ( log ) fprintf(stderr, "\tbinary search of compressed page starting at secondLevelAddr=0x%llX\n", (uint64_t)secondLevelAddr);
-		uint32_t low = 0;
-		const uint32_t last = pageHeader.entryCount() - 1;
-		uint32_t high = pageHeader.entryCount();
+		low = 0;
+		const uint32_t last_page_header = pageHeader.entryCount() - 1;
+		high = pageHeader.entryCount();
 		while ( low < high ) {
 			uint32_t mid = (low + high)/2;
 			if ( pageIndex.functionOffset(mid) <= targetFunctionPageOffset ) {
-				if ( (mid == last) || (pageIndex.functionOffset(mid+1) > targetFunctionPageOffset) ) {
+				if ( (mid == last_page_header) || (pageIndex.functionOffset(mid+1) > targetFunctionPageOffset) ) {
 					low = mid;
 					break;
 				}
@@ -651,7 +651,7 @@
 			}
 		}
 		funcStart = pageIndex.functionOffset(low) + firstLevelFunctionOffset + mh;
-		if ( low < last )
+		if ( low < last_page_header )
 			funcEnd = pageIndex.functionOffset(low+1) + firstLevelFunctionOffset + mh;
 		else
 			funcEnd = firstLevelNextPageFunctionOffset + mh;
@@ -683,8 +683,8 @@
 	if ( encoding & UNWIND_HAS_LSDA ) {
 		UnwindSectionLsdaArray<A>  lsdaIndex(fAddressSpace, lsdaArrayStartAddr);
 		uint32_t funcStartOffset = funcStart - mh;
-		uint32_t low = 0;
-		uint32_t high = (lsdaArrayEndAddr-lsdaArrayStartAddr)/sizeof(unwind_info_section_header_lsda_index_entry);
+		low = 0;
+		high = (lsdaArrayEndAddr-lsdaArrayStartAddr)/sizeof(unwind_info_section_header_lsda_index_entry);
 		// binary search looks for entry with exact match for functionOffset
 		if ( log ) fprintf(stderr, "\tbinary search of lsda table for targetFunctionOffset=0x%08X\n", funcStartOffset);
 		while ( low < high ) {
@@ -904,6 +904,9 @@
 class RemoteUnwindCursor : UnwindCursor<A,R>
 {
 public:
+    using UnwindCursor<A,R>::getReg;
+    using UnwindCursor<A,R>::getFloatReg;
+
 	typedef typename A::pint_t	pint_t;
                         RemoteUnwindCursor(A& as, unw_context_t* regs, void* arg);
     virtual bool        validReg(int);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Tue Jul 13 19:18:15 2010
@@ -25,8 +25,8 @@
 
 extern int g_verbose;
 
-DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF* m_dwarf2Data) :
-    m_dwarf2Data    ( m_dwarf2Data ),
+DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF* dwarf2Data) :
+    m_dwarf2Data    ( dwarf2Data ),
     m_offset        ( DW_INVALID_OFFSET ),
     m_length        ( 0 ),
     m_version       ( 0 ),
@@ -603,8 +603,6 @@
         if (num_attributes > 0)
         {
             uint32_t i;
-
-            dw_tag_t tag = die.Tag();
             
             is_variable = tag == DW_TAG_variable;
 
@@ -733,8 +731,8 @@
                     bool is_method = false;
                     if (parent)
                     {
-                        dw_tag_t tag = parent->Tag();
-                        if (tag == DW_TAG_class_type || tag == DW_TAG_structure_type)
+                        dw_tag_t parent_tag = parent->Tag();
+                        if (parent_tag == DW_TAG_class_type || parent_tag == DW_TAG_structure_type)
                         {
                             is_method = true;
                         }
@@ -748,9 +746,9 @@
                                     parent = specification_die->GetParent();
                                     if (parent)
                                     {
-                                        tag = parent->Tag();
+                                        parent_tag = parent->Tag();
                                     
-                                        if (tag == DW_TAG_class_type || tag == DW_TAG_structure_type)
+                                        if (parent_tag == DW_TAG_class_type || parent_tag == DW_TAG_structure_type)
                                             is_method = true;
                                     }
                                 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Jul 13 19:18:15 2010
@@ -3192,7 +3192,7 @@
                         void *pointee_clang_type = pointee_type->GetOpaqueClangQualType();
                         void *class_clang_type = class_type->GetOpaqueClangQualType();
 
-                        void *clang_type = type_list->GetClangASTContext().CreateMemberPointerType(pointee_clang_type, class_clang_type);
+                        clang_type = type_list->GetClangASTContext().CreateMemberPointerType(pointee_clang_type, class_clang_type);
 
                         size_t byte_size = ClangASTContext::GetTypeBitSize(type_list->GetClangASTContext().getASTContext(), clang_type) / 8;
 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Jul 13 19:18:15 2010
@@ -1493,7 +1493,6 @@
                                                        decl_name.getAsOpaquePtr(),
                                                        paths))
                     {
-                        uint32_t child_idx;
                         CXXBasePaths::const_paths_iterator path, path_end = paths.end();
                         for (path = paths.begin(); path != path_end; ++path)
                         {

Modified: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp Tue Jul 13 19:18:15 2010
@@ -664,8 +664,7 @@
         while (m_cfi_data.ValidOffsetForDataOfSize(offset, 8))
         {
             const dw_offset_t curr_offset = offset;
-            const uint32_t length = m_cfi_data.GetU32(&offset);
-            const dw_offset_t next_offset = offset + length;
+            const dw_offset_t next_offset = offset + m_cfi_data.GetU32(&offset);
             const dw_offset_t cie_id = m_cfi_data.GetU32(&offset);
 
             bool is_fde = for_eh_frame ?  cie_id != 0 : cie_id != UINT32_MAX;

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Tue Jul 13 19:18:15 2010
@@ -399,7 +399,7 @@
             else
                 buf.resize (256);
 
-            lldb_private::DataExtractor data(buf.data(), buf.size(), exe_ctx->process->GetByteOrder(), 4);
+            lldb_private::DataExtractor cstr_data(buf.data(), buf.size(), exe_ctx->process->GetByteOrder(), 4);
             buf.back() = '\0';
             size_t bytes_read;
             size_t total_cstr_len = 0;
@@ -411,7 +411,7 @@
                     break;
                 if (total_cstr_len == 0)
                     s->PutCString (" \"");
-                data.Dump(s, 0, lldb::eFormatChar, 1, len, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0);
+                cstr_data.Dump(s, 0, lldb::eFormatChar, 1, len, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0);
                 total_cstr_len += len;
                 if (len < buf.size())
                     break;

Modified: lldb/trunk/source/Target/ThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadList.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadList.cpp (original)
+++ lldb/trunk/source/Target/ThreadList.cpp Tue Jul 13 19:18:15 2010
@@ -45,7 +45,7 @@
     {
         // Lock both mutexes to make sure neither side changes anyone on us
         // while the assignement occurs
-        Mutex::Locker locker_this(m_threads_mutex);
+        Mutex::Locker locker_lhs(m_threads_mutex);
         Mutex::Locker locker_rhs(rhs.m_threads_mutex);
         m_process = rhs.m_process;
         m_stop_id = rhs.m_stop_id;

Modified: lldb/trunk/source/Target/ThreadPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlan.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlan.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlan.cpp Tue Jul 13 19:18:15 2010
@@ -66,21 +66,21 @@
 bool
 ThreadPlan::IsPlanComplete ()
 {
-    Mutex::Locker (m_plan_complete_mutex);
+    Mutex::Locker locker(m_plan_complete_mutex);
     return m_plan_complete;
 }
 
 void
 ThreadPlan::SetPlanComplete ()
 {
-    Mutex::Locker (m_plan_complete_mutex);
+    Mutex::Locker locker(m_plan_complete_mutex);
     m_plan_complete = true;
 }
 
 bool
 ThreadPlan::MischiefManaged ()
 {
-    Mutex::Locker (m_plan_complete_mutex);
+    Mutex::Locker locker(m_plan_complete_mutex);
     m_plan_complete = true;
     return true;
 }

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Tue Jul 13 19:18:15 2010
@@ -1220,7 +1220,7 @@
 
             if (!iochannel_thread_exited)
             {
-                SBEvent event;
+                event.Clear();
                 listener.GetNextEventForBroadcasterWithType (*m_io_channel_ap,
                                                              IOChannel::eBroadcastBitThreadDidExit,
                                                              event);

Modified: lldb/trunk/tools/driver/IOChannel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/IOChannel.cpp?rev=108299&r1=108298&r2=108299&view=diff
==============================================================================
--- lldb/trunk/tools/driver/IOChannel.cpp (original)
+++ lldb/trunk/tools/driver/IOChannel.cpp Tue Jul 13 19:18:15 2010
@@ -101,7 +101,7 @@
         {
             for (int i = 1; i < num_elements; i++)
             {
-                const char *completion_str = completions.GetStringAtIndex(i);
+                completion_str = completions.GetStringAtIndex(i);
                 OutWrite("\n\t", 2);
                 OutWrite(completion_str, strlen (completion_str));
             }
@@ -119,7 +119,7 @@
                     endpoint = num_elements;
                 for (; cur_pos < endpoint; cur_pos++)
                 {
-                    const char *completion_str = completions.GetStringAtIndex(cur_pos);
+                    completion_str = completions.GetStringAtIndex(cur_pos);
                     OutWrite("\n\t", 2);
                     OutWrite(completion_str, strlen (completion_str));
                 }





More information about the lldb-commits mailing list