@@ -2726,39 +2726,8 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
27262726 TypeQuery query_full (query);
27272727 bool have_index_match = false ;
27282728 m_index->GetTypesWithQuery (query_full, [&](DWARFDIE die) {
2729- // Check the language, but only if we have a language filter.
2730- if (query.HasLanguage ()) {
2731- if (!query.LanguageMatches (GetLanguageFamily (*die.GetCU ())))
2732- return true ; // Keep iterating over index types, language mismatch.
2733- }
2734-
2735- // Since mangled names are unique, we only need to check if the names are
2736- // the same.
2737- if (query.GetSearchByMangledName ()) {
2738- if (die.GetMangledName (/* substitute_name_allowed=*/ false ) !=
2739- query.GetTypeBasename ().GetStringRef ())
2740- return true ; // Keep iterating over index types, mangled name mismatch.
2741- if (Type *matching_type = ResolveType (die, true , true )) {
2742- results.InsertUnique (matching_type->shared_from_this ());
2743- return !results.Done (query); // Keep iterating if we aren't done.
2744- }
2745- return true ; // Keep iterating over index types, weren't able to resolve
2746- // this type
2747- }
2748-
2749- // Check the context matches
2750- std::vector<lldb_private::CompilerContext> die_context;
2751- if (query.GetModuleSearch ())
2752- die_context = die.GetDeclContext ();
2753- else
2754- die_context = die.GetTypeLookupContext ();
2755- assert (!die_context.empty ());
2756- if (!query.ContextMatches (die_context))
2757- return true ; // Keep iterating over index types, context mismatch.
2758-
2759- // Try to resolve the type.
27602729 if (Type *matching_type = ResolveType (die, true , true )) {
2761- if (matching_type->IsTemplateType ()) {
2730+ if (!query. GetSearchByMangledName () && matching_type->IsTemplateType ()) {
27622731 // We have to watch out for case where we lookup a type by basename and
27632732 // it matches a template with simple template names. Like looking up
27642733 // "Foo" and if we have simple template names then we will match
@@ -2790,7 +2759,7 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
27902759 // With -gsimple-template-names, a templated type's DW_AT_name will not
27912760 // contain the template parameters. Try again stripping '<' and anything
27922761 // after, filtering out entries with template parameters that don't match.
2793- if (!have_index_match) {
2762+ if (!have_index_match && !query. GetSearchByMangledName () ) {
27942763 // Create a type matcher with a compiler context that is tuned for
27952764 // -gsimple-template-names. We will use this for the index lookup and the
27962765 // context matching, but will use the original "match" to insert matches
@@ -2804,23 +2773,6 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
28042773 // Copy our match's context and update the basename we are looking for
28052774 // so we can use this only to compare the context correctly.
28062775 m_index->GetTypesWithQuery (query_simple, [&](DWARFDIE die) {
2807- // Check the language, but only if we have a language filter.
2808- if (query.HasLanguage ()) {
2809- if (!query.LanguageMatches (GetLanguageFamily (*die.GetCU ())))
2810- return true ; // Keep iterating over index types, language mismatch.
2811- }
2812-
2813- // Check the context matches
2814- std::vector<lldb_private::CompilerContext> die_context;
2815- if (query.GetModuleSearch ())
2816- die_context = die.GetDeclContext ();
2817- else
2818- die_context = die.GetTypeLookupContext ();
2819- assert (!die_context.empty ());
2820- if (!query_simple.ContextMatches (die_context))
2821- return true ; // Keep iterating over index types, context mismatch.
2822-
2823- // Try to resolve the type.
28242776 if (Type *matching_type = ResolveType (die, true , true )) {
28252777 ConstString name = matching_type->GetQualifiedName ();
28262778 // We have found a type that still might not match due to template
0 commit comments