@@ -2726,39 +2726,8 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
2726
2726
TypeQuery query_full (query);
2727
2727
bool have_index_match = false ;
2728
2728
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.
2760
2729
if (Type *matching_type = ResolveType (die, true , true )) {
2761
- if (matching_type->IsTemplateType ()) {
2730
+ if (!query. GetSearchByMangledName () && matching_type->IsTemplateType ()) {
2762
2731
// We have to watch out for case where we lookup a type by basename and
2763
2732
// it matches a template with simple template names. Like looking up
2764
2733
// "Foo" and if we have simple template names then we will match
@@ -2790,7 +2759,7 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
2790
2759
// With -gsimple-template-names, a templated type's DW_AT_name will not
2791
2760
// contain the template parameters. Try again stripping '<' and anything
2792
2761
// after, filtering out entries with template parameters that don't match.
2793
- if (!have_index_match) {
2762
+ if (!have_index_match && !query. GetSearchByMangledName () ) {
2794
2763
// Create a type matcher with a compiler context that is tuned for
2795
2764
// -gsimple-template-names. We will use this for the index lookup and the
2796
2765
// context matching, but will use the original "match" to insert matches
@@ -2804,23 +2773,6 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
2804
2773
// Copy our match's context and update the basename we are looking for
2805
2774
// so we can use this only to compare the context correctly.
2806
2775
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.
2824
2776
if (Type *matching_type = ResolveType (die, true , true )) {
2825
2777
ConstString name = matching_type->GetQualifiedName ();
2826
2778
// We have found a type that still might not match due to template
0 commit comments