|
9 | 9 | #include "SymbolFileDWARF.h"
|
10 | 10 |
|
11 | 11 | #include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
|
| 12 | +#include "llvm/DebugInfo/DWARF/DWARFTypePrinter.h" |
12 | 13 | #include "llvm/Support/Casting.h"
|
13 | 14 | #include "llvm/Support/FileUtilities.h"
|
14 | 15 | #include "llvm/Support/Format.h"
|
@@ -2821,33 +2822,14 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
|
2821 | 2822 | return true; // Keep iterating over index types, language mismatch.
|
2822 | 2823 | }
|
2823 | 2824 |
|
2824 |
| - // Check the context matches |
2825 |
| - std::vector<lldb_private::CompilerContext> die_context; |
2826 |
| - if (query.GetModuleSearch()) |
2827 |
| - die_context = die.GetDeclContext(); |
2828 |
| - else |
2829 |
| - die_context = die.GetTypeLookupContext(); |
2830 |
| - assert(!die_context.empty()); |
2831 |
| - if (!query_simple.ContextMatches(die_context)) |
2832 |
| - return true; // Keep iterating over index types, context mismatch. |
2833 |
| - |
2834 |
| - // Try to resolve the type. |
2835 |
| - if (Type *matching_type = ResolveType(die, true, true)) { |
2836 |
| - ConstString name = matching_type->GetQualifiedName(); |
2837 |
| - // We have found a type that still might not match due to template |
2838 |
| - // parameters. If we create a new TypeQuery that uses the new type's |
2839 |
| - // fully qualified name, we can find out if this type matches at all |
2840 |
| - // context levels. We can't use just the "match_simple" context |
2841 |
| - // because all template parameters were stripped off. The fully |
2842 |
| - // qualified name of the type will have the template parameters and |
2843 |
| - // will allow us to make sure it matches correctly. |
2844 |
| - TypeQuery die_query(name.GetStringRef(), |
2845 |
| - TypeQueryOptions::e_exact_match); |
2846 |
| - if (!query.ContextMatches(die_query.GetContextRef())) |
2847 |
| - return true; // Keep iterating over index types, context mismatch. |
2848 |
| - |
2849 |
| - results.InsertUnique(matching_type->shared_from_this()); |
2850 |
| - } |
| 2825 | + std::string qualified_name; |
| 2826 | + llvm::raw_string_ostream os(qualified_name); |
| 2827 | + llvm::DWARFTypePrinter<DWARFDIE> type_printer(os); |
| 2828 | + type_printer.appendQualifiedName(die); |
| 2829 | + TypeQuery die_query(qualified_name, e_exact_match); |
| 2830 | + if (query.ContextMatches(die_query.GetContextRef())) |
| 2831 | + if (Type *matching_type = ResolveType(die, true, true)) |
| 2832 | + results.InsertUnique(matching_type->shared_from_this()); |
2851 | 2833 | return !results.Done(query); // Keep iterating if we aren't done.
|
2852 | 2834 | });
|
2853 | 2835 | if (results.Done(query)) {
|
|
0 commit comments