diff options
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp')
-rw-r--r-- | lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index a5c9ead55f4c..47b1db16f1e9 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -82,24 +82,30 @@ TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfo( lookup_name.append(class_name.data(), class_name.size()); type_info.SetName(class_name); - const bool exact_match = true; + ConstString const_lookup_name(lookup_name); TypeList class_types; - + ModuleSP module_sp = vtable_info.symbol->CalculateSymbolContextModule(); // First look in the module that the vtable symbol came from and // look for a single exact match. - llvm::DenseSet<SymbolFile *> searched_symbol_files; - ModuleSP module_sp = vtable_info.symbol->CalculateSymbolContextModule(); - if (module_sp) - module_sp->FindTypes(ConstString(lookup_name), exact_match, 1, - searched_symbol_files, class_types); + TypeResults results; + TypeQuery query(const_lookup_name.GetStringRef(), + TypeQueryOptions::e_exact_match | + TypeQueryOptions::e_find_one); + if (module_sp) { + module_sp->FindTypes(query, results); + TypeSP type_sp = results.GetFirstType(); + if (type_sp) + class_types.Insert(type_sp); + } // If we didn't find a symbol, then move on to the entire module // list in the target and get as many unique matches as possible - Target &target = m_process->GetTarget(); - if (class_types.Empty()) - target.GetImages().FindTypes(nullptr, ConstString(lookup_name), - exact_match, UINT32_MAX, - searched_symbol_files, class_types); + if (class_types.Empty()) { + query.SetFindOne(false); + m_process->GetTarget().GetImages().FindTypes(nullptr, query, results); + for (const auto &type_sp : results.GetTypeMap().Types()) + class_types.Insert(type_sp); + } lldb::TypeSP type_sp; if (class_types.Empty()) { @@ -268,7 +274,7 @@ llvm::Expected<LanguageRuntime::VTableInfo> "no symbol found for 0x%" PRIx64, vtable_load_addr); llvm::StringRef name = symbol->GetMangled().GetDemangledName().GetStringRef(); - if (name.startswith(vtable_demangled_prefix)) { + if (name.starts_with(vtable_demangled_prefix)) { VTableInfo info = {vtable_addr, symbol}; std::lock_guard<std::mutex> locker(m_mutex); auto pos = m_vtable_info_map[vtable_addr] = info; @@ -444,7 +450,7 @@ protected: // on behalf of the user. This is the moral equivalent of the -_/-n // options to c++filt auto name = entry.ref(); - if (name.startswith("__Z")) + if (name.starts_with("__Z")) name = name.drop_front(); Mangled mangled(name); |