Ran the static analyzer on the codebase and found a few things.

llvm-svn: 160338
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 3b47453..371343c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -421,16 +421,8 @@
             return 0;
 
         uint64_t debug_abbrev_file_size = 0;
-        uint64_t debug_aranges_file_size = 0;
-        uint64_t debug_frame_file_size = 0;
         uint64_t debug_info_file_size = 0;
         uint64_t debug_line_file_size = 0;
-        uint64_t debug_loc_file_size = 0;
-        uint64_t debug_macinfo_file_size = 0;
-        uint64_t debug_pubnames_file_size = 0;
-        uint64_t debug_pubtypes_file_size = 0;
-        uint64_t debug_ranges_file_size = 0;
-        uint64_t debug_str_file_size = 0;
 
         section = section_list->FindSectionByName(GetDWARFMachOSegmentName ()).get();
         
@@ -449,15 +441,11 @@
                 m_flags.Set (flagsGotDebugAbbrevData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugAranges, true).get();
-            if (section)
-                debug_aranges_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugArangesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugFrame, true).get();
-            if (section)
-                debug_frame_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugFrameData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugLine, true).get();
@@ -467,39 +455,27 @@
                 m_flags.Set (flagsGotDebugLineData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugLoc, true).get();
-            if (section)
-                debug_loc_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugLocData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugMacInfo, true).get();
-            if (section)
-                debug_macinfo_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugMacInfoData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugPubNames, true).get();
-            if (section)
-                debug_pubnames_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugPubNamesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugPubTypes, true).get();
-            if (section)
-                debug_pubtypes_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugPubTypesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugRanges, true).get();
-            if (section)
-                debug_ranges_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugRangesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugStr, true).get();
-            if (section)
-                debug_str_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugStrData);
         }
         else
@@ -1834,7 +1810,7 @@
                     AccessType accessibility = default_accessibility;
                     bool is_virtual = false;
                     bool is_base_of_class = true;
-                    off_t member_offset = 0;
+                    //off_t member_offset = 0;
                     uint32_t i;
                     for (i=0; i<num_attributes; ++i)
                     {
@@ -1848,31 +1824,31 @@
                             case DW_AT_decl_line:   decl.SetLine(form_value.Unsigned()); break;
                             case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
                             case DW_AT_type:        encoding_uid = form_value.Reference(dwarf_cu); break;
-                            case DW_AT_data_member_location:
-                                if (form_value.BlockData())
-                                {
-                                    Value initialValue(0);
-                                    Value memberOffset(0);
-                                    const DataExtractor& debug_info_data = get_debug_info_data();
-                                    uint32_t block_length = form_value.Unsigned();
-                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
-                                    if (DWARFExpression::Evaluate (NULL, 
-                                                                   NULL, 
-                                                                   NULL, 
-                                                                   NULL, 
-                                                                   NULL,
-                                                                   debug_info_data, 
-                                                                   block_offset, 
-                                                                   block_length, 
-                                                                   eRegisterKindDWARF, 
-                                                                   &initialValue, 
-                                                                   memberOffset, 
-                                                                   NULL))
-                                    {
-                                        member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
-                                    }
-                                }
-                                break;
+//                            case DW_AT_data_member_location:
+//                                if (form_value.BlockData())
+//                                {
+//                                    Value initialValue(0);
+//                                    Value memberOffset(0);
+//                                    const DataExtractor& debug_info_data = get_debug_info_data();
+//                                    uint32_t block_length = form_value.Unsigned();
+//                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
+//                                    if (DWARFExpression::Evaluate (NULL, 
+//                                                                   NULL, 
+//                                                                   NULL, 
+//                                                                   NULL, 
+//                                                                   NULL,
+//                                                                   debug_info_data, 
+//                                                                   block_offset, 
+//                                                                   block_length, 
+//                                                                   eRegisterKindDWARF, 
+//                                                                   &initialValue, 
+//                                                                   memberOffset, 
+//                                                                   NULL))
+//                                    {
+//                                        member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
+//                                    }
+//                                }
+//                                break;
 
                             case DW_AT_accessibility:
                                 accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned());
@@ -4011,58 +3987,12 @@
         const dw_tag_t tag = die->Tag();
         switch (tag)
         {
-        case DW_TAG_enumerator:
-            {
-                DWARFDebugInfoEntry::Attributes attributes;
-                const size_t num_child_attributes = die->GetAttributes(this, dwarf_cu, fixed_form_sizes, attributes);
-                if (num_child_attributes > 0)
-                {
-                    const char *name = NULL;
-                    bool got_value = false;
-                    int64_t enum_value = 0;
-
-                    uint32_t i;
-                    for (i=0; i<num_child_attributes; ++i)
-                    {
-                        const dw_attr_t attr = attributes.AttributeAtIndex(i);
-                        DWARFFormValue form_value;
-                        if (attributes.ExtractFormValueAtIndex(this, i, form_value))
-                        {
-                            switch (attr)
-                            {
-                            case DW_AT_const_value:
-                                got_value = true;
-                                enum_value = form_value.Unsigned();
-                                break;
-
-                            case DW_AT_name:
-                                name = form_value.AsCString(&get_debug_str_data());
-                                break;
-
-                            case DW_AT_description:
-                            default:
-                            case DW_AT_decl_file:
-                            case DW_AT_decl_line:
-                            case DW_AT_decl_column:
-                            case DW_AT_sibling:
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-            break;
-
         case DW_TAG_subrange_type:
             {
                 DWARFDebugInfoEntry::Attributes attributes;
                 const size_t num_child_attributes = die->GetAttributes(this, dwarf_cu, fixed_form_sizes, attributes);
                 if (num_child_attributes > 0)
                 {
-                    const char *name = NULL;
-                    bool got_value = false;
-                    uint64_t byte_size = 0;
-                    int64_t enum_value = 0;
                     uint64_t num_elements = 0;
                     uint64_t lower_bound = 0;
                     uint64_t upper_bound = 0;
@@ -4075,13 +4005,7 @@
                         {
                             switch (attr)
                             {
-                            case DW_AT_const_value:
-                                got_value = true;
-                                enum_value = form_value.Unsigned();
-                                break;
-
                             case DW_AT_name:
-                                name = form_value.AsCString(&get_debug_str_data());
                                 break;
 
                             case DW_AT_count:
@@ -4096,10 +4020,6 @@
                                 byte_stride = form_value.Unsigned();
                                 break;
 
-                            case DW_AT_byte_size:
-                                byte_size = form_value.Unsigned();
-                                break;
-
                             case DW_AT_lower_bound:
                                 lower_bound = form_value.Unsigned();
                                 break;
@@ -5152,7 +5072,6 @@
             ConstString type_name_const_str;
             Type::ResolveState resolve_state = Type::eResolveStateUnresolved;
             size_t byte_size = 0;
-            bool byte_size_valid = false;
             Declaration decl;
 
             Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID;
@@ -5206,7 +5125,7 @@
                                     if (type_name_cstr)
                                         type_name_const_str.SetCString(type_name_cstr);
                                     break;
-                                case DW_AT_byte_size:   byte_size = form_value.Unsigned();  byte_size_valid = true; break;
+                                case DW_AT_byte_size:   byte_size = form_value.Unsigned(); break;
                                 case DW_AT_encoding:    encoding = form_value.Unsigned(); break;
                                 case DW_AT_type:        encoding_uid = form_value.Reference(dwarf_cu); break;
                                 default:
@@ -5328,6 +5247,7 @@
                 {
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
+                    bool byte_size_valid = false;
 
                     LanguageType class_language = eLanguageTypeUnknown;
                     bool is_complete_objc_class = false;
@@ -5711,9 +5631,9 @@
                                     type_name_const_str.SetCString(type_name_cstr);
                                     break;
                                 case DW_AT_type:            encoding_uid = form_value.Reference(dwarf_cu); break;
-                                case DW_AT_byte_size:       byte_size = form_value.Unsigned(); byte_size_valid = true; break;
-                                case DW_AT_accessibility:   accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
-                                case DW_AT_declaration:     is_forward_declaration = form_value.Unsigned() != 0; break;
+                                case DW_AT_byte_size:       byte_size = form_value.Unsigned(); break;
+                                case DW_AT_accessibility:   break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+                                case DW_AT_declaration:     break; //is_forward_declaration = form_value.Unsigned() != 0; break;
                                 case DW_AT_allocated:
                                 case DW_AT_associated:
                                 case DW_AT_bit_stride:
@@ -5781,7 +5701,7 @@
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
 
-                    const char *mangled = NULL;
+                    //const char *mangled = NULL;
                     dw_offset_t type_die_offset = DW_INVALID_OFFSET;
                     bool is_variadic = false;
                     bool is_inline = false;
@@ -5816,10 +5736,10 @@
                                     type_name_const_str.SetCString(type_name_cstr);
                                     break;
 
-                                case DW_AT_MIPS_linkage_name:   mangled = form_value.AsCString(&get_debug_str_data()); break;
+                                case DW_AT_MIPS_linkage_name:   break; // mangled = form_value.AsCString(&get_debug_str_data()); break;
                                 case DW_AT_type:                type_die_offset = form_value.Reference(dwarf_cu); break;
                                 case DW_AT_accessibility:       accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
-                                case DW_AT_declaration:         is_forward_declaration = form_value.Unsigned() != 0; break;
+                                case DW_AT_declaration:         break; // is_forward_declaration = form_value.Unsigned() != 0; break;
                                 case DW_AT_inline:              is_inline = form_value.Unsigned() != 0; break;
                                 case DW_AT_virtuality:          is_virtual = form_value.Unsigned() != 0;  break;
                                 case DW_AT_explicit:            is_explicit = form_value.Unsigned() != 0;  break; 
@@ -6214,11 +6134,11 @@
                                     break;
 
                                 case DW_AT_type:            type_die_offset = form_value.Reference(dwarf_cu); break;
-                                case DW_AT_byte_size:       byte_size = form_value.Unsigned(); byte_size_valid = true; break;
+                                case DW_AT_byte_size:       break; // byte_size = form_value.Unsigned(); break;
                                 case DW_AT_byte_stride:     byte_stride = form_value.Unsigned(); break;
                                 case DW_AT_bit_stride:      bit_stride = form_value.Unsigned(); break;
-                                case DW_AT_accessibility:   accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
-                                case DW_AT_declaration:     is_forward_declaration = form_value.Unsigned() != 0; break;
+                                case DW_AT_accessibility:   break; // accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+                                case DW_AT_declaration:     break; // is_forward_declaration = form_value.Unsigned() != 0; break;
                                 case DW_AT_allocated:
                                 case DW_AT_associated:
                                 case DW_AT_data_location:
@@ -6597,7 +6517,7 @@
             bool is_external = false;
             bool is_artificial = false;
             bool location_is_const_value_data = false;
-            AccessType accessibility = eAccessNone;
+            //AccessType accessibility = eAccessNone;
 
             for (i=0; i<num_attributes; ++i)
             {
@@ -6644,7 +6564,7 @@
                         break;
 
                     case DW_AT_artificial:      is_artificial = form_value.Unsigned() != 0; break;
-                    case DW_AT_accessibility:   accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+                    case DW_AT_accessibility:   break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
                     case DW_AT_declaration:
                     case DW_AT_description:
                     case DW_AT_endianity: