diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h --- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h @@ -80,8 +80,7 @@ std::optional ToDIERef(const DebugNames::Entry &entry); bool ProcessEntry(const DebugNames::Entry &entry, - llvm::function_ref callback, - llvm::StringRef name); + llvm::function_ref callback); static void MaybeLogLookupError(llvm::Error error, const DebugNames::NameIndex &ni, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp @@ -62,7 +62,7 @@ bool DebugNamesDWARFIndex::ProcessEntry( const DebugNames::Entry &entry, - llvm::function_ref callback, llvm::StringRef name) { + llvm::function_ref callback) { std::optional ref = ToDIERef(entry); if (!ref) return true; @@ -92,7 +92,7 @@ if (entry.tag() != DW_TAG_variable) continue; - if (!ProcessEntry(entry, callback, basename.GetStringRef())) + if (!ProcessEntry(entry, callback)) return; } @@ -113,8 +113,7 @@ if (entry_or->tag() != DW_TAG_variable) continue; - if (!ProcessEntry(*entry_or, callback, - llvm::StringRef(nte.getString()))) + if (!ProcessEntry(*entry_or, callback)) return; } MaybeLogLookupError(entry_or.takeError(), ni, nte.getString()); @@ -139,8 +138,7 @@ continue; found_entry_for_cu = true; - if (!ProcessEntry(*entry_or, callback, - llvm::StringRef(nte.getString()))) + if (!ProcessEntry(*entry_or, callback)) return; } MaybeLogLookupError(entry_or.takeError(), ni, nte.getString()); @@ -202,7 +200,7 @@ for (const DebugNames::Entry &entry : m_debug_names_up->equal_range(name.GetStringRef())) { if (isType(entry.tag())) { - if (!ProcessEntry(entry, callback, name.GetStringRef())) + if (!ProcessEntry(entry, callback)) return; } } @@ -216,7 +214,7 @@ auto name = context[0].name; for (const DebugNames::Entry &entry : m_debug_names_up->equal_range(name)) { if (entry.tag() == context[0].tag) { - if (!ProcessEntry(entry, callback, name)) + if (!ProcessEntry(entry, callback)) return; } } @@ -229,7 +227,7 @@ for (const DebugNames::Entry &entry : m_debug_names_up->equal_range(name.GetStringRef())) { if (entry.tag() == DW_TAG_namespace) { - if (!ProcessEntry(entry, callback, name.GetStringRef())) + if (!ProcessEntry(entry, callback)) return; } } @@ -278,8 +276,7 @@ if (tag != DW_TAG_subprogram && tag != DW_TAG_inlined_subroutine) continue; - if (!ProcessEntry(*entry_or, callback, - llvm::StringRef(nte.getString()))) + if (!ProcessEntry(*entry_or, callback)) return; } MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());