This revision was automatically updated to reflect the committed changes. Closed by commit rG6b6a779ca8ce: [lldb][NFC] Always update m_cache_{hits/misses} in FormatCache (authored by teemperor). Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76687/new/ https://reviews.llvm.org/D76687 Files: lldb/include/lldb/DataFormatters/FormatCache.h lldb/source/DataFormatters/FormatCache.cpp Index: lldb/source/DataFormatters/FormatCache.cpp =================================================================== --- lldb/source/DataFormatters/FormatCache.cpp +++ lldb/source/DataFormatters/FormatCache.cpp @@ -51,15 +51,6 @@ m_synthetic_sp = synthetic_sp; } -FormatCache::FormatCache() - : m_map(), m_mutex() -#ifdef LLDB_CONFIGURATION_DEBUG - , - m_cache_hits(0), m_cache_misses(0) -#endif -{ -} - FormatCache::Entry &FormatCache::GetEntry(ConstString type) { auto i = m_map.find(type), e = m_map.end(); if (i != e) @@ -87,15 +78,11 @@ std::lock_guard<std::recursive_mutex> guard(m_mutex); auto entry = GetEntry(type); if (entry.IsCached<ImplSP>()) { -#ifdef LLDB_CONFIGURATION_DEBUG m_cache_hits++; -#endif entry.Get(format_impl_sp); return true; } -#ifdef LLDB_CONFIGURATION_DEBUG m_cache_misses++; -#endif format_impl_sp.reset(); return false; } Index: lldb/include/lldb/DataFormatters/FormatCache.h =================================================================== --- lldb/include/lldb/DataFormatters/FormatCache.h +++ lldb/include/lldb/DataFormatters/FormatCache.h @@ -49,13 +49,13 @@ CacheMap m_map; std::recursive_mutex m_mutex; - uint64_t m_cache_hits; - uint64_t m_cache_misses; + uint64_t m_cache_hits = 0; + uint64_t m_cache_misses = 0; Entry &GetEntry(ConstString type); public: - FormatCache(); + FormatCache() = default; template <typename ImplSP> bool Get(ConstString type, ImplSP &format_impl_sp); void Set(ConstString type, lldb::TypeFormatImplSP &format_sp);
Index: lldb/source/DataFormatters/FormatCache.cpp =================================================================== --- lldb/source/DataFormatters/FormatCache.cpp +++ lldb/source/DataFormatters/FormatCache.cpp @@ -51,15 +51,6 @@ m_synthetic_sp = synthetic_sp; } -FormatCache::FormatCache() - : m_map(), m_mutex() -#ifdef LLDB_CONFIGURATION_DEBUG - , - m_cache_hits(0), m_cache_misses(0) -#endif -{ -} - FormatCache::Entry &FormatCache::GetEntry(ConstString type) { auto i = m_map.find(type), e = m_map.end(); if (i != e) @@ -87,15 +78,11 @@ std::lock_guard<std::recursive_mutex> guard(m_mutex); auto entry = GetEntry(type); if (entry.IsCached<ImplSP>()) { -#ifdef LLDB_CONFIGURATION_DEBUG m_cache_hits++; -#endif entry.Get(format_impl_sp); return true; } -#ifdef LLDB_CONFIGURATION_DEBUG m_cache_misses++; -#endif format_impl_sp.reset(); return false; } Index: lldb/include/lldb/DataFormatters/FormatCache.h =================================================================== --- lldb/include/lldb/DataFormatters/FormatCache.h +++ lldb/include/lldb/DataFormatters/FormatCache.h @@ -49,13 +49,13 @@ CacheMap m_map; std::recursive_mutex m_mutex; - uint64_t m_cache_hits; - uint64_t m_cache_misses; + uint64_t m_cache_hits = 0; + uint64_t m_cache_misses = 0; Entry &GetEntry(ConstString type); public: - FormatCache(); + FormatCache() = default; template <typename ImplSP> bool Get(ConstString type, ImplSP &format_impl_sp); void Set(ConstString type, lldb::TypeFormatImplSP &format_sp);
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits