From bd5eab8287f1dc173484a1190ac786f74241663f Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Tue, 15 Dec 2015 02:20:48 +0000 Subject: Fix a bug where language categories would hold on to their caches even after changes llvm-svn: 255603 --- lldb/source/DataFormatters/FormatManager.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'lldb/source/DataFormatters/FormatManager.cpp') diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index 8edc8e5ca8b..35a0468306f 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -123,6 +123,19 @@ GetFormatFromFormatName (const char *format_name, bool partial_match_ok, Format return false; } +void +FormatManager::Changed () +{ + ++m_last_revision; + m_format_cache.Clear (); + Mutex::Locker lang_locker(m_language_categories_mutex); + for (auto& iter : m_language_categories_map) + { + if (iter.second) + iter.second->GetFormatCache().Clear(); + } +} + bool FormatManager::GetFormatFromCString (const char *format_cstr, bool partial_match_ok, @@ -1043,12 +1056,12 @@ FormatManager::GetHardcodedValidator (FormattersMatchData& match_data) } FormatManager::FormatManager() : + m_last_revision(0), m_format_cache(), + m_language_categories_mutex(Mutex::eMutexTypeRecursive), + m_language_categories_map(), m_named_summaries_map(this), - m_last_revision(0), m_categories_map(this), - m_language_categories_map(), - m_language_categories_mutex(Mutex::eMutexTypeRecursive), m_default_category_name(ConstString("default")), m_system_category_name(ConstString("system")), m_vectortypes_category_name(ConstString("VectorTypes")) @@ -1063,7 +1076,6 @@ FormatManager::FormatManager() : void FormatManager::LoadSystemFormatters() { - TypeSummaryImpl::Flags string_flags; string_flags.SetCascades(true) .SetSkipPointers(true) -- cgit v1.2.3