<div class="gmail_quote">On Tue, Feb 21, 2012 at 3:15 AM, Enrico Granata <span dir="ltr"><<a href="mailto:granata.enrico@gmail.com">granata.enrico@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi,<div><br></div><div>I have committed your patch with a slight change:</div><div><br></div><div></div><blockquote type="cite"><div>Author: enrico<br>Date: Mon Feb 20 17:06:07 2012<br>New Revision: 150997<br>
<br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=150997&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=150997&view=rev</a><br>Log:<br>committing a patch from Dmitry Vyukov that solves compilation issues with FormatNavigator.h<br>
</div></blockquote><div><br></div><div>I have changed the final varargs (…) with a pointer of the correct type for an exact match. Hopefully this still solves your issue with compiling FormatNavigator.h. Having a vararg there seemed like a potential source for future maintenance issues. This looks cleaner and should get the job done anyway :-)</div>
<div><br></div><div>If you still have issues, please let us know.</div></div></blockquote><div><br></div><div>Thanks!</div><div>Ah, I see, there are just 2 types, I just thought that there are a lot of types and we want to specialize for one of them. I've just successfully build lldb with your changes.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div>
<i>- Enrico Granata</i></div></span>
</div>
<br></font></span><div><div class="im"><div>On Feb 20, 2012, at 5:27 AM, Dmitry Vyukov wrote:</div><br></div><blockquote type="cite"><div><div class="h5"><div class="gmail_quote">On Mon, Feb 20, 2012 at 5:10 PM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">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 style="white-space:pre-wrap"> </span>(revision 150956)</div><div>+++ include/lldb/Core/FormatNavigator.h<span style="white-space:pre-wrap"> </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>
</div></div><div class="im"><span><FormatNavigator.diff></span>_______________________________________________<br>lldb-commits mailing list<br><a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br></div></blockquote></div><br></div></div></blockquote></div><br>