summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters/FormatManager.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-11-14 05:44:23 +0000
committerEnrico Granata <egranata@apple.com>2015-11-14 05:44:23 +0000
commitb56d01033e524cbf3e6281282cf21950499c3d7f (patch)
tree7e0623d4f97252d07a8898ec094485fa96abf1c6 /lldb/source/DataFormatters/FormatManager.cpp
parentbd9fc28444c256bd1ed1e29a59bd938160c60674 (diff)
downloadbcm5719-llvm-b56d01033e524cbf3e6281282cf21950499c3d7f.tar.gz
bcm5719-llvm-b56d01033e524cbf3e6281282cf21950499c3d7f.zip
The existing logic to loop over formatters is very pre-C++11, using void* batons, and function pointers, and raw memory allocations instead of safer more modern constructs
This is a first pass at a cleanup of that code, modernizing the "type X clear" commands, and providing the basic infrastructure I plan to use all over More cleanup will come over the next few days llvm-svn: 253125
Diffstat (limited to 'lldb/source/DataFormatters/FormatManager.cpp')
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 2362ba52526..3237f73f64e 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -500,6 +500,21 @@ FormatManager::LoopThroughCategories (CategoryCallback callback, void* param)
}
}
+void
+FormatManager::ForEachCategory(TypeCategoryMap::ForEachCallback callback)
+{
+ m_categories_map.ForEach(callback);
+ Mutex::Locker locker(m_language_categories_mutex);
+ for (const auto& entry : m_language_categories_map)
+ {
+ if (auto category_sp = entry.second->GetCategory())
+ {
+ if (!callback(category_sp))
+ break;
+ }
+ }
+}
+
lldb::TypeCategoryImplSP
FormatManager::GetCategory (const ConstString& category_name,
bool can_create)
OpenPOWER on IntegriCloud