<div class="gmail_quote">On Mon, Feb 20, 2012 at 5:10 PM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com">dvyukov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>I would like to ask you to review and land this patch. Currently I get the following error messages:</div><div><br></div><div><div>lldb/source/API/../../include/lldb/Core/FormatNavigator.h: In member function ‘bool lldb_private::FormatNavigator<KeyType, ValueType>::GetExact(lldb_private::ConstString, typename lldb_private::FormatMap<KeyType, ValueType>::MapType::mapped_type&) [with KeyType = std::tr1::shared_ptr<lldb_private::RegularExpression>, ValueType = lldb_private::TypeFilterImpl]’:</div>

<div>SBTypeCategory.cpp:159:   instantiated from here</div><div>lldb/source/API/../../include/lldb/Core/FormatNavigator.h:318: error: call of overloaded ‘GetExact_Impl(lldb_private::ConstString&, std::tr1::shared_ptr<lldb_private::SyntheticChildren>&, lldb_private::FormatNavigator<std::tr1::shared_ptr<lldb_private::RegularExpression>, lldb_private::TypeFilterImpl>::Types<std::tr1::shared_ptr<lldb_private::RegularExpression>, lldb_private::TypeFilterImpl>)’ is ambiguous</div>

<div>lldb/source/API/../../include/lldb/Core/FormatNavigator.h:411: note: candidates are: bool lldb_private::FormatNavigator<KeyType, ValueType>::GetExact_Impl(lldb_private::ConstString, typename lldb_private::FormatMap<KeyType, ValueType>::MapType::mapped_type&, lldb_private::FormatNavigator<KeyType, ValueType>::Types<K, V>) [with K = std::tr1::shared_ptr<lldb_private::RegularExpression>, V = lldb_private::TypeFilterImpl, KeyType = std::tr1::shared_ptr<lldb_private::RegularExpression>, ValueType = lldb_private::TypeFilterImpl]</div>

<div>lldb/source/API/../../include/lldb/Core/FormatNavigator.h:458: note:                 bool lldb_private::FormatNavigator<KeyType, ValueType>::GetExact_Impl(lldb_private::ConstString, typename lldb_private::FormatMap<KeyType, ValueType>::MapType::mapped_type&, lldb_private::FormatNavigator<KeyType, ValueType>::Types<std::tr1::shared_ptr<lldb_private::RegularExpression>, V>) [with V = lldb_private::TypeFilterImpl, KeyType = std::tr1::shared_ptr<lldb_private::RegularExpression>, ValueType = lldb_private::TypeFilterImpl]</div>
</div></blockquote><div><br></div><div><br></div><div><br></div><div>Sorry, I see that you are using NULL's instead of 0's. Here is an updated patch:</div><div><br></div><div><br></div><div>Index: include/lldb/Core/FormatNavigator.h</div>
<div>===================================================================</div><div>--- include/lldb/Core/FormatNavigator.h<span class="Apple-tab-span" style="white-space:pre">     </span>(revision 150956)</div><div>+++ include/lldb/Core/FormatNavigator.h<span class="Apple-tab-span" style="white-space:pre">     </span>(working copy)</div>
<div>@@ -254,9 +254,6 @@</div><div> protected:</div><div>     typedef FormatMap<KeyType,ValueType> BackEndType;</div><div>     </div><div>-    template<typename, typename></div><div>-    struct Types { };</div>
<div>-</div><div> public:</div><div>     typedef typename BackEndType::MapType MapType;</div><div>     typedef typename MapType::iterator MapIterator;</div><div>@@ -279,13 +276,13 @@</div><div>     void</div><div>     Add (const MapKeyType &type, const MapValueType& entry)</div>
<div>     {</div><div>-        Add_Impl(type, entry, Types<KeyType,ValueType>());</div><div>+        Add_Impl(type, entry, (KeyType*)NULL);</div><div>     }</div><div>     </div><div>     bool</div><div>     Delete (ConstString type)</div>
<div>     {</div><div>-        return Delete_Impl(type, Types<KeyType, ValueType>());</div><div>+        return Delete_Impl(type, (KeyType*)NULL);</div><div>     }</div><div>         </div><div>     bool</div><div>@@ -309,13 +306,13 @@</div>
<div>     bool</div><div>     Get (ConstString type, MapValueType& entry)</div><div>     {</div><div>-        return Get_Impl(type, entry, Types<KeyType,ValueType>());</div><div>+        return Get_Impl(type, entry, (KeyType*)NULL);</div>
<div>     }</div><div>     </div><div>     bool</div><div>     GetExact (ConstString type, MapValueType& entry)</div><div>     {</div><div>-        return GetExact_Impl(type, entry, Types<KeyType,ValueType>());</div>
<div>+        return GetExact_Impl(type, entry, (KeyType*)NULL);</div><div>     }</div><div>     </div><div>     MapValueType</div><div>@@ -327,7 +324,7 @@</div><div>     lldb::TypeNameSpecifierImplSP</div><div>     GetTypeNameSpecifierAtIndex (uint32_t index)</div>
<div>     {</div><div>-        return GetTypeNameSpecifierAtIndex_Impl(index, Types<KeyType,ValueType>());</div><div>+        return GetTypeNameSpecifierAtIndex_Impl(index, (KeyType*)NULL);</div><div>     }</div><div>
     </div><div>     void</div><div>@@ -358,29 +355,25 @@</div><div>     </div><div>     ConstString m_id_cs;</div><div>                            </div><div>-    template<typename K, typename V></div><div>     void</div>
<div>-    Add_Impl (const MapKeyType &type, const MapValueType& entry, Types<K,V>)</div><div>+    Add_Impl (const MapKeyType &type, const MapValueType& entry, ...)</div><div>     {</div><div>        m_format_map.Add(type,entry);</div>
<div>     }</div><div> </div><div>-    template<typename V></div><div>-    void Add_Impl (const ConstString &type, const MapValueType& entry, Types<ConstString,V>)</div><div>+    void Add_Impl (const ConstString &type, const MapValueType& entry, ConstString *dummy)</div>
<div>     {</div><div>        m_format_map.Add(GetValidTypeName_Impl(type), entry);</div><div>     }</div><div> </div><div>-    template<typename K, typename V></div><div>     bool</div><div>-    Delete_Impl (ConstString type, Types<K,V>)</div>
<div>+    Delete_Impl (ConstString type, ...)</div><div>     {</div><div>        return m_format_map.Delete(type);</div><div>     }</div><div> </div><div>-    template<typename V></div><div>     bool</div><div>-    Delete_Impl (ConstString type, Types<lldb::RegularExpressionSP,V>)</div>
<div>+    Delete_Impl (ConstString type, lldb::RegularExpressionSP *dummy)</div><div>     {</div><div>        Mutex& x_mutex = m_format_map.mutex();</div><div>         lldb_private::Mutex::Locker locker(x_mutex);</div>
<div>@@ -399,23 +392,20 @@</div><div>        return false;</div><div>     }    </div><div> </div><div>-    template<typename K, typename V></div><div>     bool</div><div>-    Get_Impl (ConstString type, MapValueType& entry, Types<K,V>)</div>
<div>+    Get_Impl (ConstString type, MapValueType& entry, ...)</div><div>     {</div><div>        return m_format_map.Get(type, entry);</div><div>     }</div><div> </div><div>-    template<typename K, typename V></div>
<div>     bool</div><div>-    GetExact_Impl (ConstString type, MapValueType& entry, Types<K,V> dummy)</div><div>+    GetExact_Impl (ConstString type, MapValueType& entry, ...)</div><div>     {</div><div>-        return Get_Impl(type,entry,dummy);</div>
<div>+        return Get_Impl(type,entry, (KeyType*)0);</div><div>     }</div><div>     </div><div>-    template<typename K, typename V></div><div>     lldb::TypeNameSpecifierImplSP</div><div>-    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, Types<K,V> dummy)</div>
<div>+    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, ...)</div><div>     {</div><div>         ConstString key = m_format_map.GetKeyAtIndex(index);</div><div>         if (key)</div><div>@@ -425,9 +415,8 @@</div><div>
             return lldb::TypeNameSpecifierImplSP();</div><div>     }</div><div>     </div><div>-    template<typename V></div><div>     lldb::TypeNameSpecifierImplSP</div><div>-    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, Types<lldb::RegularExpressionSP,V> dummy)</div>
<div>+    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, lldb::RegularExpressionSP *dummy)</div><div>     {</div><div>         lldb::RegularExpressionSP regex = m_format_map.GetKeyAtIndex(index);</div><div>         if (regex.get() == NULL)</div>
<div>@@ -436,9 +425,8 @@</div><div>                                                                        true));</div><div>     }</div><div> </div><div>-    template<typename V></div><div>     bool</div><div>-    Get_Impl (ConstString key, MapValueType& value, Types<lldb::RegularExpressionSP,V>)</div>
<div>+    Get_Impl (ConstString key, MapValueType& value, lldb::RegularExpressionSP *dummy)</div><div>     {</div><div>        Mutex& x_mutex = m_format_map.mutex();</div><div>        lldb_private::Mutex::Locker locker(x_mutex);</div>
<div>@@ -455,9 +443,8 @@</div><div>        return false;</div><div>     }</div><div>     </div><div>-    template<typename V></div><div>     bool</div><div>-    GetExact_Impl (ConstString key, MapValueType& value, Types<lldb::RegularExpressionSP,V>)</div>
<div>+    GetExact_Impl (ConstString key, MapValueType& value, lldb::RegularExpressionSP *dummy)</div><div>     {</div><div>         Mutex& x_mutex = m_format_map.mutex();</div><div>         lldb_private::Mutex::Locker locker(x_mutex);</div>
<div><br></div><div> </div></div>