diff options
| author | Pavel Labath <labath@google.com> | 2018-06-05 12:13:22 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2018-06-05 12:13:22 +0000 |
| commit | 6de9c79e7138dc3b54ff899a69e6b62a5ea376e7 (patch) | |
| tree | b2366b7c23aeebf873a9ac9a84eb6c58bbc7cc86 | |
| parent | 955655f558f71de237732fe3f034e44373aed78a (diff) | |
| download | bcm5719-llvm-6de9c79e7138dc3b54ff899a69e6b62a5ea376e7.tar.gz bcm5719-llvm-6de9c79e7138dc3b54ff899a69e6b62a5ea376e7.zip | |
DWARFIndex: more GetFunctions cleanup
This applies similar simplification as r334004, only it touches the
regex version of the method.
llvm-svn: 334012
7 files changed, 14 insertions, 63 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp index bd04717b300..623719847ed 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp @@ -217,21 +217,14 @@ void AppleDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info, } } -void AppleDWARFIndex::GetFunctions( - const RegularExpression ®ex, DWARFDebugInfo &info, - llvm::function_ref<bool(const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list)> - resolve_function, - bool include_inlines, SymbolContextList &sc_list) { +void AppleDWARFIndex::GetFunctions(const RegularExpression ®ex, + DIEArray &offsets) { if (!m_apple_names_up) return; - DIEArray offsets; DWARFMappedHash::DIEInfoArray hash_data; - if (m_apple_names_up->AppendAllDIEsThatMatchingRegex(regex, hash_data)) { + if (m_apple_names_up->AppendAllDIEsThatMatchingRegex(regex, hash_data)) DWARFMappedHash::ExtractDIEArray(hash_data, offsets); - ParseFunctions(offsets, info, resolve_function, include_inlines, sc_list); - } } void AppleDWARFIndex::ReportInvalidDIEOffset(dw_offset_t offset, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h index 7465b193d52..486de4a9011 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h @@ -47,12 +47,7 @@ public: const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, std::vector<DWARFDIE> &dies) override; - void GetFunctions( - const RegularExpression ®ex, DWARFDebugInfo &info, - llvm::function_ref<bool(const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list)> - resolve_function, - bool include_inlines, SymbolContextList &sc_list) override; + void GetFunctions(const RegularExpression ®ex, DIEArray &offsets) override; void ReportInvalidDIEOffset(dw_offset_t offset, llvm::StringRef name) override; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp index 88b69c3182b..94f9c80c175 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp @@ -15,17 +15,3 @@ using namespace lldb_private; using namespace lldb; DWARFIndex::~DWARFIndex() = default; - -void DWARFIndex::ParseFunctions( - const DIEArray &offsets, DWARFDebugInfo &info, - llvm::function_ref<bool(const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list)> - resolve_function, - bool include_inlines, SymbolContextList &sc_list) { - const size_t num_matches = offsets.size(); - for (size_t i = 0; i < num_matches; ++i) { - DWARFDIE die = info.GetDIE(offsets[i]); - if (die) - resolve_function(die, include_inlines, sc_list); - } -} diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h index 7b5813cc630..882fef95b88 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h @@ -40,12 +40,8 @@ public: const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, std::vector<DWARFDIE> &dies) = 0; - virtual void GetFunctions( - const RegularExpression ®ex, DWARFDebugInfo &info, - llvm::function_ref<bool(const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list)> - resolve_function, - bool include_inlines, SymbolContextList &sc_list) = 0; + virtual void GetFunctions(const RegularExpression ®ex, + DIEArray &offsets) = 0; virtual void ReportInvalidDIEOffset(dw_offset_t offset, llvm::StringRef name) = 0; @@ -53,13 +49,6 @@ public: protected: Module &m_module; - - void ParseFunctions( - const DIEArray &offsets, DWARFDebugInfo &info, - llvm::function_ref<bool(const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list)> - resolve_function, - bool include_inlines, SymbolContextList &sc_list); }; } // namespace lldb_private diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp index 612e4ff7767..e061361cb37 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp @@ -459,18 +459,12 @@ void ManualDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info, } } -void ManualDWARFIndex::GetFunctions( - const RegularExpression ®ex, DWARFDebugInfo &info, - llvm::function_ref<bool(const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list)> - resolve_function, - bool include_inlines, SymbolContextList &sc_list) { +void ManualDWARFIndex::GetFunctions(const RegularExpression ®ex, + DIEArray &offsets) { Index(); - DIEArray offsets; m_set.function_basenames.Find(regex, offsets); m_set.function_fullnames.Find(regex, offsets); - ParseFunctions(offsets, info, resolve_function, include_inlines, sc_list); } void ManualDWARFIndex::Dump(Stream &s) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h index 1966fde1412..c5c55b53802 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h @@ -35,12 +35,7 @@ public: const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, std::vector<DWARFDIE> &dies) override; - void GetFunctions( - const RegularExpression ®ex, DWARFDebugInfo &info, - llvm::function_ref<bool(const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list)> - resolve_function, - bool include_inlines, SymbolContextList &sc_list) override; + void GetFunctions(const RegularExpression ®ex, DIEArray &offsets) override; void ReportInvalidDIEOffset(dw_offset_t offset, llvm::StringRef name) override {} diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index b544d0f40e5..931f624018e 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2278,12 +2278,11 @@ uint32_t SymbolFileDWARF::FindFunctions(const RegularExpression ®ex, // appending the results to a variable list. uint32_t original_size = sc_list.GetSize(); - m_index->GetFunctions(regex, *info, - [this](const DWARFDIE &die, bool include_inlines, - lldb_private::SymbolContextList &sc_list) { - return ResolveFunction(die, include_inlines, sc_list); - }, - include_inlines, sc_list); + DIEArray offsets; + m_index->GetFunctions(regex, offsets); + + for (DIERef ref : offsets) + ResolveFunction(ref, include_inlines, sc_list); // Return the number of variable that were appended to the list return sc_list.GetSize() - original_size; |

