<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">This smells like compiler bug:</div><div class=""><pre style="font-family: 'Courier New', courier, monotype, monospace;" class=""><span class="stdout">trying to match the argument list '(bool (__cdecl *)(lldb_private::ConstString,const lldb_private::TypeFormatImpl::SharedPointer &))'</span></pre><div class="">it fails saying this could be a candidate:</div></div><div class=""><pre style="font-family: 'Courier New', courier, monotype, monospace;" class=""><span class="stdout">        c:\lldbSlave\lldb-win7-android\llvm\tools\lldb\include\lldb/DataFormatters/TypeCategory.h(122): or       'lldb_private::TypeCategoryImpl::ForEachCallbacks<FormatterType> &lldb_private::TypeCategoryImpl::ForEachCallbacks<FormatterType>::Set<lldb_private::TypeFormatImpl>(std::function<bool (KeyType,const std::shared_ptr<lldb_private::TypeFormatImpl> &)>)'
        with
        [
            FormatterType=lldb_private::TypeFormatImpl
,            KeyType=lldb_private::ConstString
        ]
</span></pre></div><div class=""><span class="stdout">(hint: it is)</span></div><div class=""><span class="stdout"><br class=""></span></div><div class=""><span class="stdout">or else this one is also a candidate:</span></div><div class=""><span class="stdout"><pre style="font-family: 'Courier New', courier, monotype, monospace;" class=""><span class="stdout">        c:\lldbSlave\lldb-win7-android\llvm\tools\lldb\include\lldb/DataFormatters/TypeCategory.h(129): could be 'lldb_private::TypeCategoryImpl::ForEachCallbacks<FormatterType> &lldb_private::TypeCategoryImpl::ForEachCallbacks<FormatterType>::Set<lldb_private::TypeFormatImpl>(std::function<bool (KeyType,const std::shared_ptr<lldb_private::TypeFormatImpl> &)>)'
        with
        [
            FormatterType=lldb_private::TypeFormatImpl
,            KeyType=lldb::RegularExpressionSP
        ]
</span></pre><div class="">which seems highly unlikely given that there is nothing in common between ConstString and RegularExpressionSP</div><div class=""><br class=""></div><div class="">With that said, since I do want to get this code in, is it possible to get someone on the Windows side to help me clean up in such a way that it works on MSVC?</div><div class="">I would do the dance myself, but I don’t have a Windows install handy</div></span></div><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 18, 2015, at 4:14 AM, Tamas Berghammer <<a href="mailto:tberghammer@google.com" class="">tberghammer@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Enrico,<div class=""><br class=""></div><div class="">I reverted this CL and the follow-up one (r<span style="font-size:13px;line-height:19.5px" class="">253424) as they are breaking the Windows build. For the error message please see </span><span style="line-height:19.5px" class=""><a href="http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/2781" class="">http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/2781</a></span></div><div class=""><br class=""></div><div class="">Tamas</div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Nov 18, 2015 at 1:40 AM Enrico Granata via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: enrico<br class="">
Date: Tue Nov 17 19:37:49 2015<br class="">
New Revision: 253423<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=253423&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=253423&view=rev</a><br class="">
Log:<br class="">
Cleanup the type X list commands to use the new ForEach goodness<br class="">
<br class="">
<br class="">
Modified:<br class="">
    lldb/trunk/include/lldb/DataFormatters/DataVisualization.h<br class="">
    lldb/trunk/include/lldb/DataFormatters/FormatManager.h<br class="">
    lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h<br class="">
    lldb/trunk/include/lldb/DataFormatters/TypeCategory.h<br class="">
    lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h<br class="">
    lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h<br class="">
    lldb/trunk/source/API/SBTypeCategory.cpp<br class="">
    lldb/trunk/source/Commands/CommandObjectType.cpp<br class="">
    lldb/trunk/source/DataFormatters/DataVisualization.cpp<br class="">
    lldb/trunk/source/DataFormatters/FormatManager.cpp<br class="">
    lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp<br class="">
<br class="">
Modified: lldb/trunk/include/lldb/DataFormatters/DataVisualization.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DataVisualization.h?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DataVisualization.h?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/include/lldb/DataFormatters/DataVisualization.h (original)<br class="">
+++ lldb/trunk/include/lldb/DataFormatters/DataVisualization.h Tue Nov 17 19:37:49 2015<br class="">
@@ -101,7 +101,7 @@ public:<br class="">
         Clear ();<br class="">
<br class="">
         static void<br class="">
-        LoopThrough (TypeSummaryImpl::SummaryCallback callback, void* callback_baton);<br class="">
+        ForEach (std::function<bool(ConstString, const lldb::TypeSummaryImplSP&)> callback);<br class="">
<br class="">
         static uint32_t<br class="">
         GetCount ();<br class="">
@@ -158,9 +158,6 @@ public:<br class="">
         DisableStar ();<br class="">
<br class="">
         static void<br class="">
-        LoopThrough (FormatManager::CategoryCallback callback, void* callback_baton);<br class="">
-<br class="">
-        static void<br class="">
         ForEach (TypeCategoryMap::ForEachCallback callback);<br class="">
<br class="">
         static uint32_t<br class="">
<br class="">
Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)<br class="">
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Tue Nov 17 19:37:49 2015<br class="">
@@ -140,9 +140,6 @@ public:<br class="">
     }<br class="">
<br class="">
     void<br class="">
-    LoopThroughCategories (CategoryCallback callback, void* param);<br class="">
-<br class="">
-    void<br class="">
     ForEachCategory (TypeCategoryMap::ForEachCallback callback);<br class="">
<br class="">
     lldb::TypeCategoryImplSP<br class="">
<br class="">
Modified: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h (original)<br class="">
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h Tue Nov 17 19:37:49 2015<br class="">
@@ -141,22 +141,6 @@ public:<br class="">
     }<br class="">
<br class="">
     void<br class="">
-    LoopThrough (CallbackType callback, void* param)<br class="">
-    {<br class="">
-        if (callback)<br class="">
-        {<br class="">
-            Mutex::Locker locker(m_map_mutex);<br class="">
-            MapIterator pos, end = m_map.end();<br class="">
-            for (pos = m_map.begin(); pos != end; pos++)<br class="">
-            {<br class="">
-                KeyType type = pos->first;<br class="">
-                if (!callback(param, type, pos->second))<br class="">
-                    break;<br class="">
-            }<br class="">
-        }<br class="">
-    }<br class="">
-<br class="">
-    void<br class="">
     ForEach (ForEachCallback callback)<br class="">
     {<br class="">
         if (callback)<br class="">
@@ -316,12 +300,6 @@ public:<br class="">
     }<br class="">
<br class="">
     void<br class="">
-    LoopThrough (CallbackType callback, void* param)<br class="">
-    {<br class="">
-        m_format_map.LoopThrough(callback,param);<br class="">
-    }<br class="">
-<br class="">
-    void<br class="">
     ForEach (ForEachCallback callback)<br class="">
     {<br class="">
         m_format_map.ForEach(callback);<br class="">
<br class="">
Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategory.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/include/lldb/DataFormatters/TypeCategory.h (original)<br class="">
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategory.h Tue Nov 17 19:37:49 2015<br class="">
@@ -67,14 +67,6 @@ namespace lldb_private {<br class="">
             return m_regex_sp;<br class="">
         }<br class="">
<br class="">
-        void<br class="">
-        LoopThrough (typename ExactMatchContainer::CallbackType exact_callback,<br class="">
-                     typename RegexMatchContainer::CallbackType regex_callback)<br class="">
-        {<br class="">
-            GetExactMatch()->LoopThrough(exact_callback);<br class="">
-            GetRegexMatch()->LoopThrough(regex_callback);<br class="">
-        }<br class="">
-<br class="">
         uint32_t<br class="">
         GetCount ()<br class="">
         {<br class="">
@@ -95,7 +87,7 @@ namespace lldb_private {<br class="">
         typedef FormatterContainerPair<TypeValidatorImpl> ValidatorContainer;<br class="">
<br class="">
 #ifndef LLDB_DISABLE_PYTHON<br class="">
-        typedef FormatterContainerPair<ScriptedSyntheticChildren> SynthContainer;<br class="">
+        typedef FormatterContainerPair<SyntheticChildren> SynthContainer;<br class="">
 #endif // LLDB_DISABLE_PYTHON<br class="">
<br class="">
     public:<br class="">
@@ -118,74 +110,84 @@ namespace lldb_private {<br class="">
         typedef ValidatorContainer::ExactMatchContainerSP ValidatorContainerSP;<br class="">
         typedef ValidatorContainer::RegexMatchContainerSP RegexValidatorContainerSP;<br class="">
<br class="">
-        class ForEach<br class="">
+        template <typename T><br class="">
+        class ForEachCallbacks<br class="">
         {<br class="">
         public:<br class="">
-            ForEach () = default;<br class="">
-            ~ForEach () = default;<br class="">
+            ForEachCallbacks () = default;<br class="">
+            ~ForEachCallbacks () = default;<br class="">
<br class="">
-            ForEach&<br class="">
-            SetFormatExactCallback (FormatContainer::ExactMatchForEachCallback callback)<br class="">
+            template<typename U = TypeFormatImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (FormatContainer::ExactMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_format_exact = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
-            ForEach&<br class="">
-            SetFormatRegexCallback (FormatContainer::RegexMatchForEachCallback callback)<br class="">
+            template<typename U = TypeFormatImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (FormatContainer::RegexMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_format_regex = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
<br class="">
-            ForEach&<br class="">
-            SetSummaryExactCallback (SummaryContainer::ExactMatchForEachCallback callback)<br class="">
+            template<typename U = TypeSummaryImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (SummaryContainer::ExactMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_summary_exact = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
-            ForEach&<br class="">
-            SetSummaryRegexCallback (SummaryContainer::RegexMatchForEachCallback callback)<br class="">
+            template<typename U = TypeSummaryImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (SummaryContainer::RegexMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_summary_regex = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
<br class="">
-            ForEach&<br class="">
-            SetFilterExactCallback (FilterContainer::ExactMatchForEachCallback callback)<br class="">
+            template<typename U = TypeFilterImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (FilterContainer::ExactMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_filter_exact = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
-            ForEach&<br class="">
-            SetFilterRegexCallback (FilterContainer::RegexMatchForEachCallback callback)<br class="">
+            template<typename U = TypeFilterImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (FilterContainer::RegexMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_filter_regex = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
<br class="">
 #ifndef LLDB_DISABLE_PYTHON<br class="">
-            ForEach&<br class="">
-            SetSynthExactCallback (SynthContainer::ExactMatchForEachCallback callback)<br class="">
+            template<typename U = SyntheticChildren><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (SynthContainer::ExactMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_synth_exact = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
-            ForEach&<br class="">
-            SetSynthRegexCallback (SynthContainer::RegexMatchForEachCallback callback)<br class="">
+            template<typename U = SyntheticChildren><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (SynthContainer::RegexMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_synth_regex = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
 #endif // LLDB_DISABLE_PYTHON<br class="">
-<br class="">
-            ForEach&<br class="">
-            SetValidatorExactCallback (ValidatorContainer::ExactMatchForEachCallback callback)<br class="">
+            template<typename U = TypeValidatorImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (ValidatorContainer::ExactMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_validator_exact = callback;<br class="">
                 return *this;<br class="">
             }<br class="">
-            ForEach&<br class="">
-            SetValidatorRegexCallback (ValidatorContainer::RegexMatchForEachCallback callback)<br class="">
+            template<typename U = TypeValidatorImpl><br class="">
+            typename std::enable_if<std::is_same<U,T>::value, ForEachCallbacks&>::type<br class="">
+            Set (ValidatorContainer::RegexMatchForEachCallback callback)<br class="">
             {<br class="">
                 m_validator_regex = callback;<br class="">
                 return *this;<br class="">
@@ -271,8 +273,9 @@ namespace lldb_private {<br class="">
                           ConstString name,<br class="">
                           std::initializer_list<lldb::LanguageType> langs = {});<br class="">
<br class="">
+        template <typename T><br class="">
         void<br class="">
-        ForEach (const ForEach &foreach)<br class="">
+        ForEach (const ForEachCallbacks<T> &foreach)<br class="">
         {<br class="">
             GetTypeFormatsContainer()->ForEach(foreach.GetFormatExactCallback());<br class="">
             GetRegexTypeFormatsContainer()->ForEach(foreach.GetFormatRegexCallback());<br class="">
<br class="">
Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h (original)<br class="">
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h Tue Nov 17 19:37:49 2015<br class="">
@@ -88,9 +88,6 @@ namespace lldb_private {<br class="">
              ValueSP& entry);<br class="">
<br class="">
         void<br class="">
-        LoopThrough (CallbackType callback, void* param);<br class="">
-<br class="">
-        void<br class="">
         ForEach (ForEachCallback callback);<br class="">
<br class="">
         lldb::TypeCategoryImplSP<br class="">
<br class="">
Modified: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h (original)<br class="">
+++ lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h Tue Nov 17 19:37:49 2015<br class="">
@@ -479,6 +479,8 @@ namespace lldb_private {<br class="">
             return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));<br class="">
         }<br class="">
<br class="">
+        typedef std::shared_ptr<TypeFilterImpl> SharedPointer;<br class="">
+<br class="">
     private:<br class="">
         DISALLOW_COPY_AND_ASSIGN(TypeFilterImpl);<br class="">
     };<br class="">
<br class="">
Modified: lldb/trunk/source/API/SBTypeCategory.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeCategory.cpp?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeCategory.cpp?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/source/API/SBTypeCategory.cpp (original)<br class="">
+++ lldb/trunk/source/API/SBTypeCategory.cpp Tue Nov 17 19:37:49 2015<br class="">
@@ -180,7 +180,7 @@ SBTypeCategory::GetFilterForType (SBType<br class="">
     if (!spec.IsValid())<br class="">
         return SBTypeFilter();<br class="">
<br class="">
-    lldb::SyntheticChildrenSP children_sp;<br class="">
+    lldb::TypeFilterImplSP children_sp;<br class="">
<br class="">
     if (spec.IsRegex())<br class="">
         m_opaque_sp->GetRegexTypeFiltersContainer()->GetExact(ConstString(spec.GetName()), children_sp);<br class="">
<br class="">
Modified: lldb/trunk/source/Commands/CommandObjectType.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)<br class="">
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Tue Nov 17 19:37:49 2015<br class="">
@@ -1089,13 +1089,6 @@ CommandObjectTypeFormatterDelete::Comman<br class="">
     { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }<br class="">
 };<br class="">
<br class="">
-<br class="">
-<br class="">
-<br class="">
-<br class="">
-<br class="">
-<br class="">
-<br class="">
 class CommandObjectTypeFormatterClear : public CommandObjectParsed<br class="">
 {<br class="">
 private:<br class="">
@@ -1224,10 +1217,6 @@ CommandObjectTypeFormatterClear::Command<br class="">
     { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }<br class="">
 };<br class="">
<br class="">
-<br class="">
-<br class="">
-<br class="">
-<br class="">
 //-------------------------------------------------------------------------<br class="">
 // CommandObjectTypeFormatDelete<br class="">
 //-------------------------------------------------------------------------<br class="">
@@ -1264,25 +1253,8 @@ public:<br class="">
     }<br class="">
 };<br class="">
<br class="">
-//-------------------------------------------------------------------------<br class="">
-// CommandObjectTypeFormatList<br class="">
-//-------------------------------------------------------------------------<br class="">
-<br class="">
-bool CommandObjectTypeFormatList_LoopCallback(void* pt2self, ConstString type, const lldb::TypeFormatImplSP& entry);<br class="">
-bool CommandObjectTypeRXFormatList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const lldb::TypeFormatImplSP& entry);<br class="">
-<br class="">
-class CommandObjectTypeFormatList;<br class="">
-<br class="">
-struct CommandObjectTypeFormatList_LoopCallbackParam {<br class="">
-    CommandObjectTypeFormatList* self;<br class="">
-    CommandReturnObject* result;<br class="">
-    RegularExpression* regex;<br class="">
-    RegularExpression* cate_regex;<br class="">
-    CommandObjectTypeFormatList_LoopCallbackParam(CommandObjectTypeFormatList* S, CommandReturnObject* R,<br class="">
-                                            RegularExpression* X = NULL, RegularExpression* CX = NULL) : self(S), result(R), regex(X), cate_regex(CX) {}<br class="">
-};<br class="">
-<br class="">
-class CommandObjectTypeFormatList : public CommandObjectParsed<br class="">
+template <typename FormatterType><br class="">
+class CommandObjectTypeFormatterList : public CommandObjectParsed<br class="">
 {<br class="">
     class CommandOptions : public Options<br class="">
     {<br class="">
@@ -1323,6 +1295,12 @@ class CommandObjectTypeFormatList : publ<br class="">
         const OptionDefinition*<br class="">
         GetDefinitions () override<br class="">
         {<br class="">
+            static OptionDefinition g_option_table[] =<br class="">
+            {<br class="">
+                { LLDB_OPT_SET_ALL, false, "category-regex", 'w', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeName,  "Only show categories matching this filter."},<br class="">
+                { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }<br class="">
+            };<br class="">
+<br class="">
             return g_option_table;<br class="">
         }<br class="">
<br class="">
@@ -1345,10 +1323,12 @@ class CommandObjectTypeFormatList : publ<br class="">
     }<br class="">
<br class="">
 public:<br class="">
-    CommandObjectTypeFormatList (CommandInterpreter &interpreter) :<br class="">
+    CommandObjectTypeFormatterList (CommandInterpreter &interpreter,<br class="">
+                                    const char* name,<br class="">
+                                    const char* help) :<br class="">
         CommandObjectParsed (interpreter,<br class="">
-                             "type format list",<br class="">
-                             "Show a list of current formatting styles.",<br class="">
+                             name,<br class="">
+                             help,<br class="">
                              NULL),<br class="">
     m_options(interpreter)<br class="">
     {<br class="">
@@ -1363,115 +1343,137 @@ public:<br class="">
         m_arguments.push_back (type_arg);<br class="">
     }<br class="">
<br class="">
-    ~CommandObjectTypeFormatList () override<br class="">
+    ~CommandObjectTypeFormatterList () override<br class="">
     {<br class="">
     }<br class="">
<br class="">
 protected:<br class="">
+    virtual void<br class="">
+    FormatterSpecificList (CommandReturnObject &result)<br class="">
+    {<br class="">
+    }<br class="">
+<br class="">
     bool<br class="">
     DoExecute (Args& command, CommandReturnObject &result) override<br class="">
     {<br class="">
         const size_t argc = command.GetArgumentCount();<br class="">
<br class="">
-        CommandObjectTypeFormatList_LoopCallbackParam *param;<br class="">
-        RegularExpression* cate_regex =<br class="">
-        m_options.m_category_regex.empty() ? NULL :<br class="">
-        new RegularExpression(m_options.m_category_regex.c_str());<br class="">
+        std::unique_ptr<RegularExpression> category_regex;<br class="">
+        std::unique_ptr<RegularExpression> formatter_regex;<br class="">
+<br class="">
+        if (m_options.m_category_regex.size() > 0)<br class="">
+        {<br class="">
+            category_regex.reset(new RegularExpression());<br class="">
+            if (!category_regex->Compile(m_options.m_category_regex.c_str()))<br class="">
+            {<br class="">
+                result.AppendErrorWithFormat("syntax error in category regular expression '%s'", m_options.m_category_regex.c_str());<br class="">
+                result.SetStatus(eReturnStatusFailed);<br class="">
+                return false;<br class="">
+            }<br class="">
+        }<br class="">
<br class="">
         if (argc == 1)<br class="">
         {<br class="">
-            RegularExpression* regex = new RegularExpression(command.GetArgumentAtIndex(0));<br class="">
-            regex->Compile(command.GetArgumentAtIndex(0));<br class="">
-            param = new CommandObjectTypeFormatList_LoopCallbackParam(this,&result,regex,cate_regex);<br class="">
+            const char* arg = command.GetArgumentAtIndex(1);<br class="">
+            formatter_regex.reset(new RegularExpression());<br class="">
+            if (!formatter_regex->Compile(arg))<br class="">
+            {<br class="">
+                result.AppendErrorWithFormat("syntax error in regular expression '%s'", arg);<br class="">
+                result.SetStatus(eReturnStatusFailed);<br class="">
+                return false;<br class="">
+            }<br class="">
         }<br class="">
-        else<br class="">
-            param = new CommandObjectTypeFormatList_LoopCallbackParam(this,&result,NULL,cate_regex);<br class="">
<br class="">
-        DataVisualization::Categories::LoopThrough(PerCategoryCallback,param);<br class="">
-        delete param;<br class="">
+        DataVisualization::Categories::ForEach( [this, &command, &result, &category_regex, &formatter_regex] (const lldb::TypeCategoryImplSP& category) -> bool {<br class="">
+            if (category_regex)<br class="">
+            {<br class="">
+                bool escape = true;<br class="">
+                if (0 == strcmp(category->GetName(), category_regex->GetText()))<br class="">
+                {<br class="">
+                    escape = false;<br class="">
+                }<br class="">
+                else if (category_regex->Execute(category->GetName()))<br class="">
+                {<br class="">
+                    escape = false;<br class="">
+                }<br class="">
+<br class="">
+                if (escape)<br class="">
+                    return true;<br class="">
+            }<br class="">
+<br class="">
+            result.GetOutputStream().Printf("-----------------------\nCategory: %s\n-----------------------\n", category->GetName());<br class="">
+<br class="">
+            TypeCategoryImpl::ForEachCallbacks<FormatterType> foreach;<br class="">
+            foreach.Set( [&result, &formatter_regex] (ConstString name, const typename FormatterType::SharedPointer& format_sp) -> bool {<br class="">
+                if (formatter_regex)<br class="">
+                {<br class="">
+                    bool escape = true;<br class="">
+                    if (0 == strcmp(name.AsCString(), formatter_regex->GetText()))<br class="">
+                    {<br class="">
+                        escape = false;<br class="">
+                    }<br class="">
+                    else if (formatter_regex->Execute(name.AsCString()))<br class="">
+                    {<br class="">
+                        escape = false;<br class="">
+                    }<br class="">
+<br class="">
+                    if (escape)<br class="">
+                        return true;<br class="">
+                }<br class="">
+<br class="">
+                result.GetOutputStream().Printf ("%s: %s\n", name.AsCString(), format_sp->GetDescription().c_str());<br class="">
+<br class="">
+                return true;<br class="">
+            });<br class="">
+<br class="">
+            foreach.Set( [&result, &formatter_regex] (RegularExpressionSP regex_sp, const typename FormatterType::SharedPointer& format_sp) -> bool {<br class="">
+                if (formatter_regex)<br class="">
+                {<br class="">
+                    bool escape = true;<br class="">
+                    if (0 == strcmp(regex_sp->GetText(), formatter_regex->GetText()))<br class="">
+                    {<br class="">
+                        escape = false;<br class="">
+                    }<br class="">
+                    else if (formatter_regex->Execute(regex_sp->GetText()))<br class="">
+                    {<br class="">
+                        escape = false;<br class="">
+                    }<br class="">
+<br class="">
+                    if (escape)<br class="">
+                        return true;<br class="">
+                }<br class="">
+<br class="">
+                result.GetOutputStream().Printf ("%s: %s\n", regex_sp->GetText(), format_sp->GetDescription().c_str());<br class="">
+<br class="">
+                return true;<br class="">
+            });<br class="">
<br class="">
-        if (cate_regex)<br class="">
-            delete cate_regex;<br class="">
+            category->ForEach(foreach);<br class="">
+<br class="">
+            return true;<br class="">
+        });<br class="">
<br class="">
+        FormatterSpecificList(result);<br class="">
+<br class="">
         result.SetStatus(eReturnStatusSuccessFinishResult);<br class="">
         return result.Succeeded();<br class="">
     }<br class="">
-<br class="">
-private:<br class="">
-<br class="">
-    static bool<br class="">
-    PerCategoryCallback(void* param_vp,<br class="">
-                        const lldb::TypeCategoryImplSP& cate)<br class="">
-    {<br class="">
-<br class="">
-        CommandObjectTypeFormatList_LoopCallbackParam* param =<br class="">
-        (CommandObjectTypeFormatList_LoopCallbackParam*)param_vp;<br class="">
-        CommandReturnObject* result = param->result;<br class="">
-<br class="">
-        const char* cate_name = cate->GetName();<br class="">
-<br class="">
-        // if the category is disabled or empty and there is no regex, just skip it<br class="">
-        if ((cate->IsEnabled() == false || cate->GetCount(eFormatCategoryItemValue | eFormatCategoryItemRegexValue) == 0) && param->cate_regex == NULL)<br class="">
-            return true;<br class="">
-<br class="">
-        // if we have a regex and this category does not match it, just skip it<br class="">
-        if(param->cate_regex != NULL && strcmp(cate_name,param->cate_regex->GetText()) != 0 && param->cate_regex->Execute(cate_name) == false)<br class="">
-            return true;<br class="">
-<br class="">
-        result->GetOutputStream().Printf("-----------------------\nCategory: %s\n-----------------------\n", cate->GetDescription().c_str());<br class="">
-<br class="">
-        cate->GetTypeFormatsContainer()->LoopThrough(CommandObjectTypeFormatList_LoopCallback, param_vp);<br class="">
-<br class="">
-        if (cate->GetRegexTypeFormatsContainer()->GetCount() > 0)<br class="">
-        {<br class="">
-            result->GetOutputStream().Printf("Regex-based formats (slower):\n");<br class="">
-            cate->GetRegexTypeFormatsContainer()->LoopThrough(CommandObjectTypeRXFormatList_LoopCallback, param_vp);<br class="">
-        }<br class="">
-        return true;<br class="">
-    }<br class="">
-<br class="">
-<br class="">
-    bool<br class="">
-    LoopCallback (const char* type,<br class="">
-                  const lldb::TypeFormatImplSP& entry,<br class="">
-                  RegularExpression* regex,<br class="">
-                  CommandReturnObject *result)<br class="">
-    {<br class="">
-        if (regex == NULL || strcmp(type,regex->GetText()) == 0 || regex->Execute(type))<br class="">
-            result->GetOutputStream().Printf ("%s: %s\n", type, entry->GetDescription().c_str());<br class="">
-        return true;<br class="">
-    }<br class="">
-<br class="">
-    friend bool CommandObjectTypeFormatList_LoopCallback(void* pt2self, ConstString type, const lldb::TypeFormatImplSP& entry);<br class="">
-    friend bool CommandObjectTypeRXFormatList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const lldb::TypeFormatImplSP& entry);<br class="">
-<br class="">
 };<br class="">
<br class="">
-bool<br class="">
-CommandObjectTypeFormatList_LoopCallback (<br class="">
-                                    void* pt2self,<br class="">
-                                    ConstString type,<br class="">
-                                    const lldb::TypeFormatImplSP& entry)<br class="">
-{<br class="">
-    CommandObjectTypeFormatList_LoopCallbackParam* param = (CommandObjectTypeFormatList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(type.AsCString(), entry, param->regex, param->result);<br class="">
-}<br class="">
-<br class="">
-bool<br class="">
-CommandObjectTypeRXFormatList_LoopCallback (<br class="">
-                                             void* pt2self,<br class="">
-                                             lldb::RegularExpressionSP regex,<br class="">
-                                             const lldb::TypeFormatImplSP& entry)<br class="">
-{<br class="">
-    CommandObjectTypeFormatList_LoopCallbackParam* param = (CommandObjectTypeFormatList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(regex->GetText(), entry, param->regex, param->result);<br class="">
-}<br class="">
+//-------------------------------------------------------------------------<br class="">
+// CommandObjectTypeFormatList<br class="">
+//-------------------------------------------------------------------------<br class="">
<br class="">
-OptionDefinition<br class="">
-CommandObjectTypeFormatList::CommandOptions::g_option_table[] =<br class="">
+class CommandObjectTypeFormatList : public CommandObjectTypeFormatterList<TypeFormatImpl><br class="">
 {<br class="">
-    { LLDB_OPT_SET_ALL, false, "category-regex", 'w', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeName,  "Only show categories matching this filter."},<br class="">
-    { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }<br class="">
+public:<br class="">
+<br class="">
+    CommandObjectTypeFormatList (CommandInterpreter &interpreter) :<br class="">
+        CommandObjectTypeFormatterList(interpreter,<br class="">
+                                       "type format list",<br class="">
+                                       "Show a list of current formats.")<br class="">
+    {<br class="">
+    }<br class="">
 };<br class="">
<br class="">
 #ifndef LLDB_DISABLE_PYTHON<br class="">
@@ -2046,226 +2048,30 @@ protected:<br class="">
 // CommandObjectTypeSummaryList<br class="">
 //-------------------------------------------------------------------------<br class="">
<br class="">
-bool CommandObjectTypeSummaryList_LoopCallback(void* pt2self, ConstString type, const StringSummaryFormat::SharedPointer& entry);<br class="">
-bool CommandObjectTypeRXSummaryList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const StringSummaryFormat::SharedPointer& entry);<br class="">
-<br class="">
-class CommandObjectTypeSummaryList;<br class="">
-<br class="">
-struct CommandObjectTypeSummaryList_LoopCallbackParam {<br class="">
-    CommandObjectTypeSummaryList* self;<br class="">
-    CommandReturnObject* result;<br class="">
-    RegularExpression* regex;<br class="">
-    RegularExpression* cate_regex;<br class="">
-    CommandObjectTypeSummaryList_LoopCallbackParam(CommandObjectTypeSummaryList* S, CommandReturnObject* R,<br class="">
-                                                  RegularExpression* X = NULL,<br class="">
-                                                  RegularExpression* CX = NULL) : self(S), result(R), regex(X), cate_regex(CX) {}<br class="">
-};<br class="">
-<br class="">
-class CommandObjectTypeSummaryList : public CommandObjectParsed<br class="">
+class CommandObjectTypeSummaryList : public CommandObjectTypeFormatterList<TypeSummaryImpl><br class="">
 {<br class="">
-<br class="">
-    class CommandOptions : public Options<br class="">
-    {<br class="">
-    public:<br class="">
-<br class="">
-        CommandOptions (CommandInterpreter &interpreter) :<br class="">
-        Options (interpreter)<br class="">
-        {<br class="">
-        }<br class="">
-<br class="">
-        ~CommandOptions () override {}<br class="">
-<br class="">
-        Error<br class="">
-        SetOptionValue (uint32_t option_idx, const char *option_arg) override<br class="">
-        {<br class="">
-            Error error;<br class="">
-            const int short_option = m_getopt_table[option_idx].val;<br class="">
-<br class="">
-            switch (short_option)<br class="">
-            {<br class="">
-                case 'w':<br class="">
-                    m_category_regex = std::string(option_arg);<br class="">
-                    break;<br class="">
-                default:<br class="">
-                    error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);<br class="">
-                    break;<br class="">
-            }<br class="">
-<br class="">
-            return error;<br class="">
-        }<br class="">
-<br class="">
-        void<br class="">
-        OptionParsingStarting () override<br class="">
-        {<br class="">
-            m_category_regex = "";<br class="">
-        }<br class="">
-<br class="">
-        const OptionDefinition*<br class="">
-        GetDefinitions () override<br class="">
-        {<br class="">
-            return g_option_table;<br class="">
-        }<br class="">
-<br class="">
-        // Options table: Required for subclasses of Options.<br class="">
-<br class="">
-        static OptionDefinition g_option_table[];<br class="">
-<br class="">
-        // Instance variables to hold the values for command options.<br class="">
-<br class="">
-        std::string m_category_regex;<br class="">
-<br class="">
-    };<br class="">
-<br class="">
-    CommandOptions m_options;<br class="">
-<br class="">
-    Options *<br class="">
-    GetOptions () override<br class="">
-    {<br class="">
-        return &m_options;<br class="">
-    }<br class="">
-<br class="">
 public:<br class="">
-    CommandObjectTypeSummaryList (CommandInterpreter &interpreter) :<br class="">
-        CommandObjectParsed (interpreter,<br class="">
-                             "type summary list",<br class="">
-                             "Show a list of current summary styles.",<br class="">
-                             NULL),<br class="">
-        m_options(interpreter)<br class="">
-    {<br class="">
-        CommandArgumentEntry type_arg;<br class="">
-        CommandArgumentData type_style_arg;<br class="">
-<br class="">
-        type_style_arg.arg_type = eArgTypeName;<br class="">
-        type_style_arg.arg_repetition = eArgRepeatOptional;<br class="">
-<br class="">
-        type_arg.push_back (type_style_arg);<br class="">
-<br class="">
-        m_arguments.push_back (type_arg);<br class="">
-    }<br class="">
<br class="">
-    ~CommandObjectTypeSummaryList () override<br class="">
+    CommandObjectTypeSummaryList (CommandInterpreter &interpreter) :<br class="">
+    CommandObjectTypeFormatterList(interpreter,<br class="">
+                                   "type summary list",<br class="">
+                                   "Show a list of current summaries.")<br class="">
     {<br class="">
     }<br class="">
<br class="">
 protected:<br class="">
-    bool<br class="">
-    DoExecute (Args& command, CommandReturnObject &result) override<br class="">
+    void<br class="">
+    FormatterSpecificList (CommandReturnObject &result) override<br class="">
     {<br class="">
-        const size_t argc = command.GetArgumentCount();<br class="">
-<br class="">
-        CommandObjectTypeSummaryList_LoopCallbackParam *param;<br class="">
-        RegularExpression* cate_regex =<br class="">
-        m_options.m_category_regex.empty() ? NULL :<br class="">
-        new RegularExpression(m_options.m_category_regex.c_str());<br class="">
-<br class="">
-        if (argc == 1)<br class="">
-        {<br class="">
-            RegularExpression* regex = new RegularExpression(command.GetArgumentAtIndex(0));<br class="">
-            regex->Compile(command.GetArgumentAtIndex(0));<br class="">
-            param = new CommandObjectTypeSummaryList_LoopCallbackParam(this,&result,regex,cate_regex);<br class="">
-        }<br class="">
-        else<br class="">
-            param = new CommandObjectTypeSummaryList_LoopCallbackParam(this,&result,NULL,cate_regex);<br class="">
-<br class="">
-        DataVisualization::Categories::LoopThrough(PerCategoryCallback,param);<br class="">
-        delete param;<br class="">
-<br class="">
         if (DataVisualization::NamedSummaryFormats::GetCount() > 0)<br class="">
         {<br class="">
             result.GetOutputStream().Printf("Named summaries:\n");<br class="">
-            if (argc == 1)<br class="">
-            {<br class="">
-                RegularExpression* regex = new RegularExpression(command.GetArgumentAtIndex(0));<br class="">
-                regex->Compile(command.GetArgumentAtIndex(0));<br class="">
-                param = new CommandObjectTypeSummaryList_LoopCallbackParam(this,&result,regex);<br class="">
-            }<br class="">
-            else<br class="">
-                param = new CommandObjectTypeSummaryList_LoopCallbackParam(this,&result);<br class="">
-            DataVisualization::NamedSummaryFormats::LoopThrough(CommandObjectTypeSummaryList_LoopCallback, param);<br class="">
-            delete param;<br class="">
-        }<br class="">
-<br class="">
-        if (cate_regex)<br class="">
-            delete cate_regex;<br class="">
-<br class="">
-        result.SetStatus(eReturnStatusSuccessFinishResult);<br class="">
-        return result.Succeeded();<br class="">
-    }<br class="">
-<br class="">
-private:<br class="">
-<br class="">
-    static bool<br class="">
-    PerCategoryCallback(void* param_vp,<br class="">
-                        const lldb::TypeCategoryImplSP& cate)<br class="">
-    {<br class="">
-<br class="">
-        CommandObjectTypeSummaryList_LoopCallbackParam* param =<br class="">
-            (CommandObjectTypeSummaryList_LoopCallbackParam*)param_vp;<br class="">
-        CommandReturnObject* result = param->result;<br class="">
-<br class="">
-        const char* cate_name = cate->GetName();<br class="">
-<br class="">
-        // if the category is disabled or empty and there is no regex, just skip it<br class="">
-        if ((cate->IsEnabled() == false || cate->GetCount(eFormatCategoryItemSummary | eFormatCategoryItemRegexSummary) == 0) && param->cate_regex == NULL)<br class="">
-            return true;<br class="">
-<br class="">
-        // if we have a regex and this category does not match it, just skip it<br class="">
-        if(param->cate_regex != NULL && strcmp(cate_name,param->cate_regex->GetText()) != 0 && param->cate_regex->Execute(cate_name) == false)<br class="">
-            return true;<br class="">
-<br class="">
-        result->GetOutputStream().Printf("-----------------------\nCategory: %s\n-----------------------\n", cate->GetDescription().c_str());<br class="">
-<br class="">
-        cate->GetTypeSummariesContainer()->LoopThrough(CommandObjectTypeSummaryList_LoopCallback, param_vp);<br class="">
-<br class="">
-        if (cate->GetRegexTypeSummariesContainer()->GetCount() > 0)<br class="">
-        {<br class="">
-            result->GetOutputStream().Printf("Regex-based summaries (slower):\n");<br class="">
-            cate->GetRegexTypeSummariesContainer()->LoopThrough(CommandObjectTypeRXSummaryList_LoopCallback, param_vp);<br class="">
+            DataVisualization::NamedSummaryFormats::ForEach( [&result] (ConstString name, const TypeSummaryImplSP& summary_sp) -> bool {<br class="">
+                result.GetOutputStream().Printf ("%s: %s\n", name.AsCString(), summary_sp->GetDescription().c_str());<br class="">
+                return true;<br class="">
+            });<br class="">
         }<br class="">
-        return true;<br class="">
-    }<br class="">
-<br class="">
-<br class="">
-    bool<br class="">
-    LoopCallback (const char* type,<br class="">
-                  const lldb::TypeSummaryImplSP& entry,<br class="">
-                  RegularExpression* regex,<br class="">
-                  CommandReturnObject *result)<br class="">
-    {<br class="">
-        if (regex == NULL || strcmp(type,regex->GetText()) == 0 || regex->Execute(type))<br class="">
-                result->GetOutputStream().Printf ("%s: %s\n", type, entry->GetDescription().c_str());<br class="">
-        return true;<br class="">
     }<br class="">
-<br class="">
-    friend bool CommandObjectTypeSummaryList_LoopCallback(void* pt2self, ConstString type, const lldb::TypeSummaryImplSP& entry);<br class="">
-    friend bool CommandObjectTypeRXSummaryList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const lldb::TypeSummaryImplSP& entry);<br class="">
-};<br class="">
-<br class="">
-bool<br class="">
-CommandObjectTypeSummaryList_LoopCallback (<br class="">
-                                          void* pt2self,<br class="">
-                                          ConstString type,<br class="">
-                                          const lldb::TypeSummaryImplSP& entry)<br class="">
-{<br class="">
-    CommandObjectTypeSummaryList_LoopCallbackParam* param = (CommandObjectTypeSummaryList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(type.AsCString(), entry, param->regex, param->result);<br class="">
-}<br class="">
-<br class="">
-bool<br class="">
-CommandObjectTypeRXSummaryList_LoopCallback (<br class="">
-                                           void* pt2self,<br class="">
-                                           lldb::RegularExpressionSP regex,<br class="">
-                                           const lldb::TypeSummaryImplSP& entry)<br class="">
-{<br class="">
-    CommandObjectTypeSummaryList_LoopCallbackParam* param = (CommandObjectTypeSummaryList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(regex->GetText(), entry, param->regex, param->result);<br class="">
-}<br class="">
-<br class="">
-OptionDefinition<br class="">
-CommandObjectTypeSummaryList::CommandOptions::g_option_table[] =<br class="">
-{<br class="">
-    { LLDB_OPT_SET_ALL, false, "category-regex", 'w', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeName,  "Only show categories matching this filter."},<br class="">
-    { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }<br class="">
 };<br class="">
<br class="">
 //-------------------------------------------------------------------------<br class="">
@@ -2786,37 +2592,6 @@ CommandObjectTypeCategoryDisable::Comman<br class="">
<br class="">
 class CommandObjectTypeCategoryList : public CommandObjectParsed<br class="">
 {<br class="">
-private:<br class="">
-<br class="">
-    struct CommandObjectTypeCategoryList_CallbackParam<br class="">
-    {<br class="">
-        CommandReturnObject* result;<br class="">
-        RegularExpression* regex;<br class="">
-<br class="">
-        CommandObjectTypeCategoryList_CallbackParam(CommandReturnObject* res,<br class="">
-                                                    RegularExpression* rex = NULL) :<br class="">
-        result(res),<br class="">
-        regex(rex)<br class="">
-        {<br class="">
-        }<br class="">
-<br class="">
-    };<br class="">
-<br class="">
-    static bool<br class="">
-    PerCategoryCallback(void* param_vp,<br class="">
-                        const lldb::TypeCategoryImplSP& cate)<br class="">
-    {<br class="">
-        CommandObjectTypeCategoryList_CallbackParam* param =<br class="">
-            (CommandObjectTypeCategoryList_CallbackParam*)param_vp;<br class="">
-        CommandReturnObject* result = param->result;<br class="">
-        RegularExpression* regex = param->regex;<br class="">
-<br class="">
-        const char* cate_name = cate->GetName();<br class="">
-<br class="">
-        if (regex == NULL || strcmp(cate_name, regex->GetText()) == 0 || regex->Execute(cate_name))<br class="">
-            result->GetOutputStream().Printf("Category: %s\n", cate->GetDescription().c_str());<br class="">
-        return true;<br class="">
-    }<br class="">
 public:<br class="">
     CommandObjectTypeCategoryList (CommandInterpreter &interpreter) :<br class="">
         CommandObjectParsed (interpreter,<br class="">
@@ -2844,26 +2619,48 @@ protected:<br class="">
     DoExecute (Args& command, CommandReturnObject &result) override<br class="">
     {<br class="">
         const size_t argc = command.GetArgumentCount();<br class="">
-        RegularExpression* regex = NULL;<br class="">
+<br class="">
+        std::unique_ptr<RegularExpression> regex;<br class="">
<br class="">
-        if (argc == 0)<br class="">
-            ;<br class="">
-        else if (argc == 1)<br class="">
-            regex = new RegularExpression(command.GetArgumentAtIndex(0));<br class="">
-        else<br class="">
+        if (argc == 1)<br class="">
+        {<br class="">
+            regex.reset(new RegularExpression());<br class="">
+            const char* arg = command.GetArgumentAtIndex(0);<br class="">
+            if (!regex->Compile(arg))<br class="">
+            {<br class="">
+                result.AppendErrorWithFormat("syntax error in category regular expression '%s'", arg);<br class="">
+                result.SetStatus(eReturnStatusFailed);<br class="">
+                return false;<br class="">
+            }<br class="">
+        }<br class="">
+        else if (argc != 0)<br class="">
         {<br class="">
             result.AppendErrorWithFormat ("%s takes 0 or one arg.\n", m_cmd_name.c_str());<br class="">
             result.SetStatus(eReturnStatusFailed);<br class="">
             return false;<br class="">
         }<br class="">
<br class="">
-        CommandObjectTypeCategoryList_CallbackParam param(&result,<br class="">
-                                                          regex);<br class="">
-<br class="">
-        DataVisualization::Categories::LoopThrough(PerCategoryCallback, &param);<br class="">
-<br class="">
-        if (regex)<br class="">
-            delete regex;<br class="">
+        DataVisualization::Categories::ForEach( [&regex, &result] (const lldb::TypeCategoryImplSP& category_sp) -> bool {<br class="">
+            if (regex)<br class="">
+            {<br class="">
+                bool escape = true;<br class="">
+                if (0 == strcmp(category_sp->GetName(), regex->GetText()))<br class="">
+                {<br class="">
+                    escape = false;<br class="">
+                }<br class="">
+                else if (regex->Execute(category_sp->GetName()))<br class="">
+                {<br class="">
+                    escape = false;<br class="">
+                }<br class="">
+<br class="">
+                if (escape)<br class="">
+                    return true;<br class="">
+            }<br class="">
+<br class="">
+            result.GetOutputStream().Printf("Category: %s\n", category_sp->GetDescription().c_str());<br class="">
+<br class="">
+            return true;<br class="">
+        });<br class="">
<br class="">
         result.SetStatus(eReturnStatusSuccessFinishResult);<br class="">
         return result.Succeeded();<br class="">
@@ -2875,210 +2672,16 @@ protected:<br class="">
 // CommandObjectTypeFilterList<br class="">
 //-------------------------------------------------------------------------<br class="">
<br class="">
-bool CommandObjectTypeFilterList_LoopCallback(void* pt2self, ConstString type, const SyntheticChildren::SharedPointer& entry);<br class="">
-bool CommandObjectTypeFilterRXList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const SyntheticChildren::SharedPointer& entry);<br class="">
-<br class="">
-class CommandObjectTypeFilterList;<br class="">
-<br class="">
-struct CommandObjectTypeFilterList_LoopCallbackParam {<br class="">
-    CommandObjectTypeFilterList* self;<br class="">
-    CommandReturnObject* result;<br class="">
-    RegularExpression* regex;<br class="">
-    RegularExpression* cate_regex;<br class="">
-    CommandObjectTypeFilterList_LoopCallbackParam(CommandObjectTypeFilterList* S, CommandReturnObject* R,<br class="">
-                                                  RegularExpression* X = NULL,<br class="">
-                                                  RegularExpression* CX = NULL) : self(S), result(R), regex(X), cate_regex(CX) {}<br class="">
-};<br class="">
-<br class="">
-class CommandObjectTypeFilterList : public CommandObjectParsed<br class="">
+class CommandObjectTypeFilterList : public CommandObjectTypeFormatterList<TypeFilterImpl><br class="">
 {<br class="">
-<br class="">
-    class CommandOptions : public Options<br class="">
-    {<br class="">
-    public:<br class="">
-<br class="">
-        CommandOptions (CommandInterpreter &interpreter) :<br class="">
-        Options (interpreter)<br class="">
-        {<br class="">
-        }<br class="">
-<br class="">
-        ~CommandOptions () override {}<br class="">
-<br class="">
-        Error<br class="">
-        SetOptionValue (uint32_t option_idx, const char *option_arg) override<br class="">
-        {<br class="">
-            Error error;<br class="">
-            const int short_option = m_getopt_table[option_idx].val;<br class="">
-<br class="">
-            switch (short_option)<br class="">
-            {<br class="">
-                case 'w':<br class="">
-                    m_category_regex = std::string(option_arg);<br class="">
-                    break;<br class="">
-                default:<br class="">
-                    error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);<br class="">
-                    break;<br class="">
-            }<br class="">
-<br class="">
-            return error;<br class="">
-        }<br class="">
-<br class="">
-        void<br class="">
-        OptionParsingStarting () override<br class="">
-        {<br class="">
-            m_category_regex = "";<br class="">
-        }<br class="">
-<br class="">
-        const OptionDefinition*<br class="">
-        GetDefinitions () override<br class="">
-        {<br class="">
-            return g_option_table;<br class="">
-        }<br class="">
-<br class="">
-        // Options table: Required for subclasses of Options.<br class="">
-<br class="">
-        static OptionDefinition g_option_table[];<br class="">
-<br class="">
-        // Instance variables to hold the values for command options.<br class="">
-<br class="">
-        std::string m_category_regex;<br class="">
-<br class="">
-    };<br class="">
-<br class="">
-    CommandOptions m_options;<br class="">
-<br class="">
-    Options *<br class="">
-    GetOptions () override<br class="">
-    {<br class="">
-        return &m_options;<br class="">
-    }<br class="">
-<br class="">
 public:<br class="">
-    CommandObjectTypeFilterList (CommandInterpreter &interpreter) :<br class="">
-        CommandObjectParsed (interpreter,<br class="">
-                             "type filter list",<br class="">
-                             "Show a list of current filters.",<br class="">
-                             NULL),<br class="">
-        m_options(interpreter)<br class="">
-    {<br class="">
-        CommandArgumentEntry type_arg;<br class="">
-        CommandArgumentData type_style_arg;<br class="">
-<br class="">
-        type_style_arg.arg_type = eArgTypeName;<br class="">
-        type_style_arg.arg_repetition = eArgRepeatOptional;<br class="">
-<br class="">
-        type_arg.push_back (type_style_arg);<br class="">
-<br class="">
-        m_arguments.push_back (type_arg);<br class="">
-    }<br class="">
-<br class="">
-    ~CommandObjectTypeFilterList () override<br class="">
-    {<br class="">
-    }<br class="">
-<br class="">
-protected:<br class="">
-    bool<br class="">
-    DoExecute (Args& command, CommandReturnObject &result) override<br class="">
-    {<br class="">
-        const size_t argc = command.GetArgumentCount();<br class="">
-<br class="">
-        CommandObjectTypeFilterList_LoopCallbackParam *param;<br class="">
-        RegularExpression* cate_regex =<br class="">
-        m_options.m_category_regex.empty() ? NULL :<br class="">
-        new RegularExpression(m_options.m_category_regex.c_str());<br class="">
-<br class="">
-        if (argc == 1)<br class="">
-        {<br class="">
-            RegularExpression* regex = new RegularExpression(command.GetArgumentAtIndex(0));<br class="">
-            regex->Compile(command.GetArgumentAtIndex(0));<br class="">
-            param = new CommandObjectTypeFilterList_LoopCallbackParam(this,&result,regex,cate_regex);<br class="">
-        }<br class="">
-        else<br class="">
-            param = new CommandObjectTypeFilterList_LoopCallbackParam(this,&result,NULL,cate_regex);<br class="">
-<br class="">
-        DataVisualization::Categories::LoopThrough(PerCategoryCallback,param);<br class="">
-        delete param;<br class="">
-<br class="">
-        if (cate_regex)<br class="">
-            delete cate_regex;<br class="">
-<br class="">
-        result.SetStatus(eReturnStatusSuccessFinishResult);<br class="">
-        return result.Succeeded();<br class="">
-    }<br class="">
<br class="">
-private:<br class="">
-<br class="">
-    static bool<br class="">
-    PerCategoryCallback(void* param_vp,<br class="">
-                        const lldb::TypeCategoryImplSP& cate)<br class="">
-    {<br class="">
-<br class="">
-        const char* cate_name = cate->GetName();<br class="">
-<br class="">
-        CommandObjectTypeFilterList_LoopCallbackParam* param =<br class="">
-        (CommandObjectTypeFilterList_LoopCallbackParam*)param_vp;<br class="">
-        CommandReturnObject* result = param->result;<br class="">
-<br class="">
-        // if the category is disabled or empty and there is no regex, just skip it<br class="">
-        if ((cate->IsEnabled() == false || cate->GetCount(eFormatCategoryItemFilter | eFormatCategoryItemRegexFilter) == 0) && param->cate_regex == NULL)<br class="">
-            return true;<br class="">
-<br class="">
-        // if we have a regex and this category does not match it, just skip it<br class="">
-        if(param->cate_regex != NULL && strcmp(cate_name,param->cate_regex->GetText()) != 0 && param->cate_regex->Execute(cate_name) == false)<br class="">
-            return true;<br class="">
-<br class="">
-        result->GetOutputStream().Printf("-----------------------\nCategory: %s\n-----------------------\n", cate->GetDescription().c_str());<br class="">
-<br class="">
-        cate->GetTypeFiltersContainer()->LoopThrough(CommandObjectTypeFilterList_LoopCallback, param_vp);<br class="">
-<br class="">
-        if (cate->GetRegexTypeFiltersContainer()->GetCount() > 0)<br class="">
-        {<br class="">
-            result->GetOutputStream().Printf("Regex-based filters (slower):\n");<br class="">
-            cate->GetRegexTypeFiltersContainer()->LoopThrough(CommandObjectTypeFilterRXList_LoopCallback, param_vp);<br class="">
-        }<br class="">
-<br class="">
-        return true;<br class="">
-    }<br class="">
-<br class="">
-    bool<br class="">
-    LoopCallback (const char* type,<br class="">
-                  const SyntheticChildren::SharedPointer& entry,<br class="">
-                  RegularExpression* regex,<br class="">
-                  CommandReturnObject *result)<br class="">
+    CommandObjectTypeFilterList (CommandInterpreter &interpreter) :<br class="">
+    CommandObjectTypeFormatterList(interpreter,<br class="">
+                                   "type filter list",<br class="">
+                                   "Show a list of current filters.")<br class="">
     {<br class="">
-        if (regex == NULL || regex->Execute(type))<br class="">
-            result->GetOutputStream().Printf ("%s: %s\n", type, entry->GetDescription().c_str());<br class="">
-        return true;<br class="">
     }<br class="">
-<br class="">
-    friend bool CommandObjectTypeFilterList_LoopCallback(void* pt2self, ConstString type, const SyntheticChildren::SharedPointer& entry);<br class="">
-    friend bool CommandObjectTypeFilterRXList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const SyntheticChildren::SharedPointer& entry);<br class="">
-};<br class="">
-<br class="">
-bool<br class="">
-CommandObjectTypeFilterList_LoopCallback (void* pt2self,<br class="">
-                                         ConstString type,<br class="">
-                                         const SyntheticChildren::SharedPointer& entry)<br class="">
-{<br class="">
-    CommandObjectTypeFilterList_LoopCallbackParam* param = (CommandObjectTypeFilterList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(type.AsCString(), entry, param->regex, param->result);<br class="">
-}<br class="">
-<br class="">
-bool<br class="">
-CommandObjectTypeFilterRXList_LoopCallback (void* pt2self,<br class="">
-                                           lldb::RegularExpressionSP regex,<br class="">
-                                           const SyntheticChildren::SharedPointer& entry)<br class="">
-{<br class="">
-    CommandObjectTypeFilterList_LoopCallbackParam* param = (CommandObjectTypeFilterList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(regex->GetText(), entry, param->regex, param->result);<br class="">
-}<br class="">
-<br class="">
-<br class="">
-OptionDefinition<br class="">
-CommandObjectTypeFilterList::CommandOptions::g_option_table[] =<br class="">
-{<br class="">
-    { LLDB_OPT_SET_ALL, false, "category-regex", 'w', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeName,  "Only show categories matching this filter."},<br class="">
-    { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }<br class="">
 };<br class="">
<br class="">
 #ifndef LLDB_DISABLE_PYTHON<br class="">
@@ -3087,210 +2690,16 @@ CommandObjectTypeFilterList::CommandOpti<br class="">
 // CommandObjectTypeSynthList<br class="">
 //-------------------------------------------------------------------------<br class="">
<br class="">
-bool CommandObjectTypeSynthList_LoopCallback(void* pt2self, ConstString type, const SyntheticChildren::SharedPointer& entry);<br class="">
-bool CommandObjectTypeSynthRXList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const SyntheticChildren::SharedPointer& entry);<br class="">
-<br class="">
-class CommandObjectTypeSynthList;<br class="">
-<br class="">
-struct CommandObjectTypeSynthList_LoopCallbackParam {<br class="">
-    CommandObjectTypeSynthList* self;<br class="">
-    CommandReturnObject* result;<br class="">
-    RegularExpression* regex;<br class="">
-    RegularExpression* cate_regex;<br class="">
-    CommandObjectTypeSynthList_LoopCallbackParam(CommandObjectTypeSynthList* S, CommandReturnObject* R,<br class="">
-                                                 RegularExpression* X = NULL,<br class="">
-                                                 RegularExpression* CX = NULL) : self(S), result(R), regex(X), cate_regex(CX) {}<br class="">
-};<br class="">
-<br class="">
-class CommandObjectTypeSynthList : public CommandObjectParsed<br class="">
+class CommandObjectTypeSynthList : public CommandObjectTypeFormatterList<SyntheticChildren><br class="">
 {<br class="">
-<br class="">
-    class CommandOptions : public Options<br class="">
-    {<br class="">
-    public:<br class="">
-<br class="">
-        CommandOptions (CommandInterpreter &interpreter) :<br class="">
-        Options (interpreter)<br class="">
-        {<br class="">
-        }<br class="">
-<br class="">
-        ~CommandOptions () override {}<br class="">
-<br class="">
-        Error<br class="">
-        SetOptionValue (uint32_t option_idx, const char *option_arg) override<br class="">
-        {<br class="">
-            Error error;<br class="">
-            const int short_option = m_getopt_table[option_idx].val;<br class="">
-<br class="">
-            switch (short_option)<br class="">
-            {<br class="">
-                case 'w':<br class="">
-                    m_category_regex = std::string(option_arg);<br class="">
-                    break;<br class="">
-                default:<br class="">
-                    error.SetErrorStringWithFormat ("unrecognized option '%c'", short_option);<br class="">
-                    break;<br class="">
-            }<br class="">
-<br class="">
-            return error;<br class="">
-        }<br class="">
-<br class="">
-        void<br class="">
-        OptionParsingStarting () override<br class="">
-        {<br class="">
-            m_category_regex = "";<br class="">
-        }<br class="">
-<br class="">
-        const OptionDefinition*<br class="">
-        GetDefinitions () override<br class="">
-        {<br class="">
-            return g_option_table;<br class="">
-        }<br class="">
-<br class="">
-        // Options table: Required for subclasses of Options.<br class="">
-<br class="">
-        static OptionDefinition g_option_table[];<br class="">
-<br class="">
-        // Instance variables to hold the values for command options.<br class="">
-<br class="">
-        std::string m_category_regex;<br class="">
-<br class="">
-    };<br class="">
-<br class="">
-    CommandOptions m_options;<br class="">
-<br class="">
-    Options *<br class="">
-    GetOptions () override<br class="">
-    {<br class="">
-        return &m_options;<br class="">
-    }<br class="">
-<br class="">
 public:<br class="">
-    CommandObjectTypeSynthList (CommandInterpreter &interpreter) :<br class="">
-        CommandObjectParsed (interpreter,<br class="">
-                             "type synthetic list",<br class="">
-                             "Show a list of current synthetic providers.",<br class="">
-                             NULL),<br class="">
-        m_options(interpreter)<br class="">
-    {<br class="">
-        CommandArgumentEntry type_arg;<br class="">
-        CommandArgumentData type_style_arg;<br class="">
-<br class="">
-        type_style_arg.arg_type = eArgTypeName;<br class="">
-        type_style_arg.arg_repetition = eArgRepeatOptional;<br class="">
-<br class="">
-        type_arg.push_back (type_style_arg);<br class="">
-<br class="">
-        m_arguments.push_back (type_arg);<br class="">
-    }<br class="">
-<br class="">
-    ~CommandObjectTypeSynthList () override<br class="">
-    {<br class="">
-    }<br class="">
-<br class="">
-protected:<br class="">
-    bool<br class="">
-    DoExecute (Args& command, CommandReturnObject &result) override<br class="">
-    {<br class="">
-        const size_t argc = command.GetArgumentCount();<br class="">
-<br class="">
-        CommandObjectTypeSynthList_LoopCallbackParam *param;<br class="">
-        RegularExpression* cate_regex =<br class="">
-        m_options.m_category_regex.empty() ? NULL :<br class="">
-        new RegularExpression(m_options.m_category_regex.c_str());<br class="">
-<br class="">
-        if (argc == 1)<br class="">
-        {<br class="">
-            RegularExpression* regex = new RegularExpression(command.GetArgumentAtIndex(0));<br class="">
-            regex->Compile(command.GetArgumentAtIndex(0));<br class="">
-            param = new CommandObjectTypeSynthList_LoopCallbackParam(this,&result,regex,cate_regex);<br class="">
-        }<br class="">
-        else<br class="">
-            param = new CommandObjectTypeSynthList_LoopCallbackParam(this,&result,NULL,cate_regex);<br class="">
-<br class="">
-        DataVisualization::Categories::LoopThrough(PerCategoryCallback,param);<br class="">
-        delete param;<br class="">
-<br class="">
-        if (cate_regex)<br class="">
-            delete cate_regex;<br class="">
-<br class="">
-        result.SetStatus(eReturnStatusSuccessFinishResult);<br class="">
-        return result.Succeeded();<br class="">
-    }<br class="">
-<br class="">
-private:<br class="">
<br class="">
-    static bool<br class="">
-    PerCategoryCallback(void* param_vp,<br class="">
-                        const lldb::TypeCategoryImplSP& cate)<br class="">
-    {<br class="">
-<br class="">
-        CommandObjectTypeSynthList_LoopCallbackParam* param =<br class="">
-        (CommandObjectTypeSynthList_LoopCallbackParam*)param_vp;<br class="">
-        CommandReturnObject* result = param->result;<br class="">
-<br class="">
-        const char* cate_name = cate->GetName();<br class="">
-<br class="">
-        // if the category is disabled or empty and there is no regex, just skip it<br class="">
-        if ((cate->IsEnabled() == false || cate->GetCount(eFormatCategoryItemSynth | eFormatCategoryItemRegexSynth) == 0) && param->cate_regex == NULL)<br class="">
-            return true;<br class="">
-<br class="">
-        // if we have a regex and this category does not match it, just skip it<br class="">
-        if(param->cate_regex != NULL && strcmp(cate_name,param->cate_regex->GetText()) != 0 && param->cate_regex->Execute(cate_name) == false)<br class="">
-            return true;<br class="">
-<br class="">
-        result->GetOutputStream().Printf("-----------------------\nCategory: %s\n-----------------------\n", cate->GetDescription().c_str());<br class="">
-<br class="">
-        cate->GetTypeSyntheticsContainer()->LoopThrough(CommandObjectTypeSynthList_LoopCallback, param_vp);<br class="">
-<br class="">
-        if (cate->GetRegexTypeSyntheticsContainer()->GetCount() > 0)<br class="">
-        {<br class="">
-            result->GetOutputStream().Printf("Regex-based synthetic providers (slower):\n");<br class="">
-            cate->GetRegexTypeSyntheticsContainer()->LoopThrough(CommandObjectTypeSynthRXList_LoopCallback, param_vp);<br class="">
-        }<br class="">
-<br class="">
-        return true;<br class="">
-    }<br class="">
-<br class="">
-    bool<br class="">
-    LoopCallback (const char* type,<br class="">
-                  const SyntheticChildren::SharedPointer& entry,<br class="">
-                  RegularExpression* regex,<br class="">
-                  CommandReturnObject *result)<br class="">
+    CommandObjectTypeSynthList (CommandInterpreter &interpreter) :<br class="">
+    CommandObjectTypeFormatterList(interpreter,<br class="">
+                                   "type synthetic list",<br class="">
+                                   "Show a list of current synthetic providers.")<br class="">
     {<br class="">
-        if (regex == NULL || regex->Execute(type))<br class="">
-            result->GetOutputStream().Printf ("%s: %s\n", type, entry->GetDescription().c_str());<br class="">
-        return true;<br class="">
     }<br class="">
-<br class="">
-    friend bool CommandObjectTypeSynthList_LoopCallback(void* pt2self, ConstString type, const SyntheticChildren::SharedPointer& entry);<br class="">
-    friend bool CommandObjectTypeSynthRXList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const SyntheticChildren::SharedPointer& entry);<br class="">
-};<br class="">
-<br class="">
-bool<br class="">
-CommandObjectTypeSynthList_LoopCallback (void* pt2self,<br class="">
-                                         ConstString type,<br class="">
-                                         const SyntheticChildren::SharedPointer& entry)<br class="">
-{<br class="">
-    CommandObjectTypeSynthList_LoopCallbackParam* param = (CommandObjectTypeSynthList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(type.AsCString(), entry, param->regex, param->result);<br class="">
-}<br class="">
-<br class="">
-bool<br class="">
-CommandObjectTypeSynthRXList_LoopCallback (void* pt2self,<br class="">
-                                         lldb::RegularExpressionSP regex,<br class="">
-                                         const SyntheticChildren::SharedPointer& entry)<br class="">
-{<br class="">
-    CommandObjectTypeSynthList_LoopCallbackParam* param = (CommandObjectTypeSynthList_LoopCallbackParam*)pt2self;<br class="">
-    return param->self->LoopCallback(regex->GetText(), entry, param->regex, param->result);<br class="">
-}<br class="">
-<br class="">
-<br class="">
-OptionDefinition<br class="">
-CommandObjectTypeSynthList::CommandOptions::g_option_table[] =<br class="">
-{<br class="">
-    { LLDB_OPT_SET_ALL, false, "category-regex", 'w', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeName,  "Only show categories matching this filter."},<br class="">
-    { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }<br class="">
 };<br class="">
<br class="">
 #endif // #ifndef LLDB_DISABLE_PYTHON<br class="">
@@ -3664,7 +3073,7 @@ private:<br class="">
<br class="">
     bool<br class="">
     AddFilter(ConstString type_name,<br class="">
-              SyntheticChildrenSP entry,<br class="">
+              TypeFilterImplSP entry,<br class="">
               FilterFormatType type,<br class="">
               std::string category_name,<br class="">
               Error* error)<br class="">
@@ -3787,19 +3196,15 @@ protected:<br class="">
             return false;<br class="">
         }<br class="">
<br class="">
-        SyntheticChildrenSP entry;<br class="">
-<br class="">
-        TypeFilterImpl* impl = new TypeFilterImpl(SyntheticChildren::Flags().SetCascades(m_options.m_cascade).<br class="">
-                                                    SetSkipPointers(m_options.m_skip_pointers).<br class="">
-                                                    SetSkipReferences(m_options.m_skip_references));<br class="">
-<br class="">
-        entry.reset(impl);<br class="">
+        TypeFilterImplSP entry(new TypeFilterImpl(SyntheticChildren::Flags().SetCascades(m_options.m_cascade).<br class="">
+                                       SetSkipPointers(m_options.m_skip_pointers).<br class="">
+                                                  SetSkipReferences(m_options.m_skip_references)));<br class="">
<br class="">
         // go through the expression paths<br class="">
         CommandOptions::ExpressionPathsIterator begin, end = m_options.m_expr_paths.end();<br class="">
<br class="">
         for (begin = m_options.m_expr_paths.begin(); begin != end; begin++)<br class="">
-            impl->AddExpressionPath(*begin);<br class="">
+            entry->AddExpressionPath(*begin);<br class="">
<br class="">
<br class="">
         // now I have a valid provider, let's add it to every type<br class="">
@@ -4289,5 +3694,3 @@ CommandObjectType::CommandObjectType (Co<br class="">
 CommandObjectType::~CommandObjectType ()<br class="">
 {<br class="">
 }<br class="">
-<br class="">
-<br class="">
<br class="">
Modified: lldb/trunk/source/DataFormatters/DataVisualization.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/DataVisualization.cpp?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/DataVisualization.cpp?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/source/DataFormatters/DataVisualization.cpp (original)<br class="">
+++ lldb/trunk/source/DataFormatters/DataVisualization.cpp Tue Nov 17 19:37:49 2015<br class="">
@@ -226,12 +226,6 @@ DataVisualization::Categories::DisableSt<br class="">
 }<br class="">
<br class="">
 void<br class="">
-DataVisualization::Categories::LoopThrough (FormatManager::CategoryCallback callback, void* callback_baton)<br class="">
-{<br class="">
-    GetFormatManager().LoopThroughCategories(callback, callback_baton);<br class="">
-}<br class="">
-<br class="">
-void<br class="">
 DataVisualization::Categories::ForEach (TypeCategoryMap::ForEachCallback callback)<br class="">
 {<br class="">
     GetFormatManager().ForEachCategory(callback);<br class="">
@@ -274,9 +268,9 @@ DataVisualization::NamedSummaryFormats::<br class="">
 }<br class="">
<br class="">
 void<br class="">
-DataVisualization::NamedSummaryFormats::LoopThrough (TypeSummaryImpl::SummaryCallback callback, void* callback_baton)<br class="">
+DataVisualization::NamedSummaryFormats::ForEach (std::function<bool(ConstString, const lldb::TypeSummaryImplSP&)> callback)<br class="">
 {<br class="">
-    GetFormatManager().GetNamedSummaryContainer().LoopThrough(callback, callback_baton);<br class="">
+    GetFormatManager().GetNamedSummaryContainer().ForEach(callback);<br class="">
 }<br class="">
<br class="">
 uint32_t<br class="">
<br class="">
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=253423&r1=253422&r2=253423&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=253423&r1=253422&r2=253423&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)<br class="">
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Nov 17 19:37:49 2015<br class="">
@@ -486,21 +486,6 @@ FormatManager::GetValidatorForType (lldb<br class="">
 }<br class="">
<br class="">
 void<br class="">
-FormatManager::LoopThroughCategories (CategoryCallback callback, void* param)<br class="">
-{<br class="">
-    m_categories_map.LoopThrough(callback, param);<br class="">
-    Mutex::Locker locker(m_language_categories_mutex);<br class="">
-    for (const auto& entry : m_language_categories_map)<br class="">
-    {<br class="">
-        if (auto category_sp = entry.second->GetCategory())<br class="">
-        {<br class="">
-            if (!callback(param, category_sp))<br class="">
-                break;<br class="">
-        }<br class="">
-    }<br class="">
-}<br class="">
-<br class="">
-void<br class="">
 FormatManager::ForEachCategory(TypeCategoryMap::ForEachCallback callback)<br class="">
 {<br class="">
     m_categories_map.ForEach(callback);<br class="">
<br class="">
Modified: lldb/trunk/so</blockquote></div></div>
</div></blockquote></div><br class=""><div class="">
<div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">Thanks,</div><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div>
</div>
<br class=""></body></html>