diff --git a/lldb/include/lldb/Core/Highlighter.h b/lldb/include/lldb/Core/Highlighter.h index 5384309088b8d..db3c02a017ab0 100644 --- a/lldb/include/lldb/Core/Highlighter.h +++ b/lldb/include/lldb/Core/Highlighter.h @@ -156,9 +156,6 @@ namespace llvm { /// DenseMapInfo implementation. /// \{ template <> struct DenseMapInfo { - static inline lldb::LanguageType getEmptyKey() { - return lldb::eNumLanguageTypes; - } static unsigned getHashValue(lldb::LanguageType language_type) { return static_cast(language_type); } diff --git a/lldb/include/lldb/Host/HostThread.h b/lldb/include/lldb/Host/HostThread.h index e3c103ead1f2d..ba219a3b5c6a6 100644 --- a/lldb/include/lldb/Host/HostThread.h +++ b/lldb/include/lldb/Host/HostThread.h @@ -54,10 +54,6 @@ class HostThread { namespace llvm { template <> struct DenseMapInfo { - static inline lldb_private::HostThread getEmptyKey() { - return lldb_private::HostThread( - DenseMapInfo::getEmptyKey()); - } static unsigned getHashValue(const lldb_private::HostThread &val); static bool isEqual(const lldb_private::HostThread &lhs, const lldb_private::HostThread &rhs); diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 786ebe39b0ce8..313b2829a49e9 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -517,12 +517,6 @@ namespace llvm { /// DenseMapInfo implementation. /// \{ template <> struct DenseMapInfo { - static inline lldb_private::SymbolContext getEmptyKey() { - lldb_private::SymbolContext sc; - sc.function = DenseMapInfo::getEmptyKey(); - return sc; - } - static unsigned getHashValue(const lldb_private::SymbolContext &sc) { // Hash all fields EXCEPT symbol, since // CompareConsideringPossiblyNullSymbol ignores it. @@ -541,13 +535,6 @@ template <> struct DenseMapInfo { static bool isEqual(const lldb_private::SymbolContext &lhs, const lldb_private::SymbolContext &rhs) { - // Check for empty keys first, since these are invalid pointers we - // don't want to accidentally dereference them in - // CompareConsideringPossiblyNullSymbol. - if (lhs.function == DenseMapInfo::getEmptyKey() || - rhs.function == DenseMapInfo::getEmptyKey()) - return lhs.function == rhs.function; - return lldb_private::SymbolContext::CompareConsideringPossiblyNullSymbol( lhs, rhs); } diff --git a/lldb/include/lldb/Utility/ConstString.h b/lldb/include/lldb/Utility/ConstString.h index 04008371d1910..3d312d95b45ee 100644 --- a/lldb/include/lldb/Utility/ConstString.h +++ b/lldb/include/lldb/Utility/ConstString.h @@ -427,10 +427,6 @@ template <> struct format_provider { /// DenseMapInfo implementation. /// \{ template <> struct DenseMapInfo { - static inline lldb_private::ConstString getEmptyKey() { - return lldb_private::ConstString::FromStringPoolPointer( - DenseMapInfo::getEmptyKey()); - } static unsigned getHashValue(lldb_private::ConstString val) { return DenseMapInfo::getHashValue(val.m_string); } diff --git a/lldb/include/lldb/Utility/FileSpec.h b/lldb/include/lldb/Utility/FileSpec.h index 56257e0dd91f1..e6a5b113c2131 100644 --- a/lldb/include/lldb/Utility/FileSpec.h +++ b/lldb/include/lldb/Utility/FileSpec.h @@ -470,9 +470,6 @@ template <> struct format_provider { /// DenseMapInfo implementation. /// \{ template <> struct DenseMapInfo { - static inline lldb_private::FileSpec getEmptyKey() { - return lldb_private::FileSpec(); - } static unsigned getHashValue(lldb_private::FileSpec file_spec) { return llvm::hash_combine( DenseMapInfo::getHashValue( diff --git a/lldb/include/lldb/Utility/UUID.h b/lldb/include/lldb/Utility/UUID.h index 9f449ef2a8511..232650a08784d 100644 --- a/lldb/include/lldb/Utility/UUID.h +++ b/lldb/include/lldb/Utility/UUID.h @@ -121,9 +121,6 @@ namespace llvm { /// DenseMapInfo implementation. /// \{ template <> struct DenseMapInfo { - static inline lldb_private::UUID getEmptyKey() { - return lldb_private::UUID(); - } static unsigned getHashValue(lldb_private::UUID uuid) { return DenseMapInfo>::getHashValue(uuid.GetBytes()); } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h index fc19da0ac0f98..ba6a4cbff9b4c 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h @@ -425,7 +425,6 @@ class ObjCLanguageRuntime : public LanguageRuntime { /// Keys are already djbHash values, so use identity as the hash function. struct IdentityHashKeyInfo { - static constexpr uint32_t getEmptyKey() { return ~0U; } static unsigned getHashValue(uint32_t Val) { return Val; } static bool isEqual(uint32_t LHS, uint32_t RHS) { return LHS == RHS; } }; diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index c6d67b3aa5350..2c3dfa9afe286 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -493,12 +493,9 @@ class ProcessGDBRemote : public Process, // KeyInfo for the cached module spec DenseMap. // The invariant is that all real keys will have the file and architecture // set. - // The empty key has an empty file and an empty arch. // The comparison and hash functions take the file name and architecture // triple into account. struct ModuleCacheInfo { - static ModuleCacheKey getEmptyKey() { return ModuleCacheKey(); } - static unsigned getHashValue(const ModuleCacheKey &key) { return llvm::hash_combine(key.first, key.second); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 3b22cfcec633d..217bba8d16dc3 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1124,8 +1124,7 @@ SymbolFileDWARF::GetTypeUnitSupportFiles(DWARFTypeUnit &tu) { static SupportFileList empty_list; dw_offset_t offset = tu.GetLineTableOffset(); - if (offset == DW_INVALID_OFFSET || - offset == llvm::DenseMapInfo::getEmptyKey()) + if (offset == DW_INVALID_OFFSET) return nullptr; // Many type units can share a line table, so parse the support file list