diff options
author | Jason Molenda <jmolenda@apple.com> | 2017-03-10 06:38:19 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2017-03-10 06:38:19 +0000 |
commit | bc3a47f31d68b6a9ba3a8dc76ba39cb80474d030 (patch) | |
tree | b13621e46231ce4de5745c9ea949aba1791d65cd /lldb | |
parent | 73b76ce563cd3473be66e773efa828eeb3ab7d0a (diff) | |
download | bcm5719-llvm-bc3a47f31d68b6a9ba3a8dc76ba39cb80474d030.tar.gz bcm5719-llvm-bc3a47f31d68b6a9ba3a8dc76ba39cb80474d030.zip |
Add a distinction in an apple accelerator table between IsValid and
HasContent. If we have a valid accelerator table which has no
content, we want to depend on that (empty) table as the authoritative
source instead of reading through all the debug info for lookups.
<rdar://problem/30867462>
llvm-svn: 297441
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/Core/MappedHash.h | 6 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 24 |
2 files changed, 17 insertions, 13 deletions
diff --git a/lldb/include/lldb/Core/MappedHash.h b/lldb/include/lldb/Core/MappedHash.h index 76070761efb..32d8d7ba8e3 100644 --- a/lldb/include/lldb/Core/MappedHash.h +++ b/lldb/include/lldb/Core/MappedHash.h @@ -353,7 +353,11 @@ public: bool IsValid() const { return m_header.version == 1 && m_header.hash_function == eHashFunctionDJB && - m_header.bucket_count > 0 && m_header.hashes_count > 0; + m_header.bucket_count > 0; + } + + bool HasContent() const { + return IsValid() && m_header.hashes_count > 0; } uint32_t GetHashIndex(uint32_t bucket_idx) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 856c371636d..40064de100b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -448,19 +448,19 @@ void SymbolFileDWARF::InitializeObject() { if (m_data_apple_names.m_data.GetByteSize() > 0) { m_apple_names_ap.reset(new DWARFMappedHash::MemoryTable( m_data_apple_names.m_data, get_debug_str_data(), ".apple_names")); - if (m_apple_names_ap->IsValid()) - m_using_apple_tables = true; - else + if (!m_apple_names_ap->IsValid()) m_apple_names_ap.reset(); + if (m_apple_names_ap->HasContent()) + m_using_apple_tables = true; } get_apple_types_data(); if (m_data_apple_types.m_data.GetByteSize() > 0) { m_apple_types_ap.reset(new DWARFMappedHash::MemoryTable( m_data_apple_types.m_data, get_debug_str_data(), ".apple_types")); - if (m_apple_types_ap->IsValid()) - m_using_apple_tables = true; - else + if (!m_apple_types_ap->IsValid()) m_apple_types_ap.reset(); + if (m_apple_types_ap->HasContent()) + m_using_apple_tables = true; } get_apple_namespaces_data(); @@ -468,20 +468,20 @@ void SymbolFileDWARF::InitializeObject() { m_apple_namespaces_ap.reset(new DWARFMappedHash::MemoryTable( m_data_apple_namespaces.m_data, get_debug_str_data(), ".apple_namespaces")); - if (m_apple_namespaces_ap->IsValid()) - m_using_apple_tables = true; - else + if (!m_apple_namespaces_ap->IsValid()) m_apple_namespaces_ap.reset(); + if (m_apple_namespaces_ap->HasContent()) + m_using_apple_tables = true; } get_apple_objc_data(); if (m_data_apple_objc.m_data.GetByteSize() > 0) { m_apple_objc_ap.reset(new DWARFMappedHash::MemoryTable( m_data_apple_objc.m_data, get_debug_str_data(), ".apple_objc")); - if (m_apple_objc_ap->IsValid()) - m_using_apple_tables = true; - else + if (!m_apple_objc_ap->IsValid()) m_apple_objc_ap.reset(); + if (m_apple_objc_ap->HasContent()) + m_using_apple_tables = true; } } |