|
38 | 38 | #include "lldb/Interpreter/OptionValueFileSpecList.h"
|
39 | 39 | #include "lldb/Interpreter/OptionValueProperties.h"
|
40 | 40 |
|
| 41 | +#include "llvm/DebugInfo/DWARF/DWARFTypePrinter.h" |
| 42 | + |
41 | 43 | #include "Plugins/ExpressionParser/Clang/ClangUtil.h"
|
42 | 44 | #include "Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h"
|
43 | 45 | #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
|
@@ -2785,33 +2787,15 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
|
2785 | 2787 | return true; // Keep iterating over index types, language mismatch.
|
2786 | 2788 | }
|
2787 | 2789 |
|
2788 |
| - // Check the context matches |
2789 |
| - std::vector<lldb_private::CompilerContext> die_context; |
2790 |
| - if (query.GetModuleSearch()) |
2791 |
| - die_context = die.GetDeclContext(); |
2792 |
| - else |
2793 |
| - die_context = die.GetTypeLookupContext(); |
2794 |
| - assert(!die_context.empty()); |
2795 |
| - if (!query_simple.ContextMatches(die_context)) |
2796 |
| - return true; // Keep iterating over index types, context mismatch. |
2797 |
| - |
2798 |
| - // Try to resolve the type. |
2799 |
| - if (Type *matching_type = ResolveType(die, true, true)) { |
2800 |
| - ConstString name = matching_type->GetQualifiedName(); |
2801 |
| - // We have found a type that still might not match due to template |
2802 |
| - // parameters. If we create a new TypeQuery that uses the new type's |
2803 |
| - // fully qualified name, we can find out if this type matches at all |
2804 |
| - // context levels. We can't use just the "match_simple" context |
2805 |
| - // because all template parameters were stripped off. The fully |
2806 |
| - // qualified name of the type will have the template parameters and |
2807 |
| - // will allow us to make sure it matches correctly. |
2808 |
| - TypeQuery die_query(name.GetStringRef(), |
2809 |
| - TypeQueryOptions::e_exact_match); |
2810 |
| - if (!query.ContextMatches(die_query.GetContextRef())) |
2811 |
| - return true; // Keep iterating over index types, context mismatch. |
2812 |
| - |
2813 |
| - results.InsertUnique(matching_type->shared_from_this()); |
2814 |
| - } |
| 2790 | + std::string R; |
| 2791 | + llvm::raw_string_ostream OS(R); |
| 2792 | + llvm::DWARFTypePrinter<DWARFDIE> p(OS); |
| 2793 | + p.appendQualifiedName(die); |
| 2794 | + |
| 2795 | + TypeQuery die_query(R, TypeQueryOptions::e_exact_match); |
| 2796 | + if (query.ContextMatches(die_query.GetContextRef())) |
| 2797 | + if (Type *matching_type = ResolveType(die, true, true)) |
| 2798 | + results.InsertUnique(matching_type->shared_from_this()); |
2815 | 2799 | return !results.Done(query); // Keep iterating if we aren't done.
|
2816 | 2800 | });
|
2817 | 2801 | if (results.Done(query))
|
|
0 commit comments