Index: lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp @@ -110,6 +110,17 @@ const bool has_qualified_name_hash = m_apple_types_up->GetHeader().header_data.ContainsAtom( DWARFMappedHash::eAtomTypeQualNameHash); + + // When searching for "std::vector::const_iterator", reject any + // files without "vector" early, since there will be many other + // "const_iterators". + if (context.GetSize() > 1 && context[1].tag == DW_TAG_class_type) { + DIEArray class_matches; + m_apple_types_up->FindByName(context[1].name, class_matches); + if (class_matches.empty()) + return; + } + const ConstString type_name(context[0].name); const dw_tag_t tag = context[0].tag; if (has_tag && has_qualified_name_hash) {