<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 1:39 PM, Enrico Granata <span dir="ltr"><<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.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"><br><div><span class=""><blockquote type="cite"><div>On Sep 16, 2014, at 1:28 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:</div><br><div><br><br><div class="gmail_quote">On Tue Sep 16 2014 at 1:24:20 PM Enrico Granata <<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>> 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"><div><blockquote type="cite"><div>On Sep 16, 2014, at 12:32 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:</div><br><div><div dir="ltr">This is unused by anything in lldb. Any reason to put it in explicitly? (It's triggering on a Werror build of llvm+lldb).</div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>I plan to use this facility on an internal Apple branch, but it is itself general enough to warrant being in trunk</div><div><br></div><div>With that said, the solution seems to fix whatever is causing the breakage, rather than removing the code.</div></div></div><div style="word-wrap:break-word"><div><br></div></div></blockquote><div><br></div><div>The breakage is that it's an unused function :)</div><div><br></div><div><div>/usr/local/google/home/echristo/sources/llvm/tools/lldb/source/DataFormatters/FormatManager.cpp:961:13: error: unused</div><div>      function 'AddEmptyFilter' [-Werror,-Wunused-function]</div><div>static void AddEmptyFilter  (TypeCategoryImpl::SharedPointer category_sp,</div><div>            ^</div><div>1 error generated.</div></div><div><br></div><div>So if you wouldn't mind reverting it (since your commit only added this function) until you have some external use of it in lldb?</div><div><br></div></div></div></blockquote><div><br></div></span><div><div style="margin:0px;font-size:16px;font-family:'Perfect DOS VGA 437';color:rgb(41,249,20);background-color:rgb(0,0,0)">Sending        source/DataFormatters/FormatManager.cpp</div><div style="margin:0px;font-size:16px;font-family:'Perfect DOS VGA 437';color:rgb(41,249,20);background-color:rgb(0,0,0)">Transmitting file data .</div><div style="margin:0px;font-size:16px;font-family:'Perfect DOS VGA 437';color:rgb(41,249,20);background-color:rgb(0,0,0)">Committed revision 217900.</div><div><br></div></div><div>I am not sure what this warning is buying us, but who am I to argue with the almighty compiler? :)</div><div>Reverted.</div></div></div></blockquote><div><br></div><div>Thanks!</div><div><br></div><div>FWIW Dead code is additional maintenance and cognitive load (as well as build time/binary size). Basically it'll cause people or machines to do work in cases that they wouldn't have otherwise. Trying to figure out when something is used, updating it when it's unused, but contains an API that needs updating, etc.</div><div><br></div><div>-eric</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><div><div class="h5"><br><blockquote type="cite"><div><div class="gmail_quote"><div>Thanks!</div><div><br></div><div>-eric</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><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>-eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 10:41 AM, Enrico Granata <span dir="ltr"><<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: enrico<br>
Date: Tue Sep 16 12:41:54 2014<br>
New Revision: 217891<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217891&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=217891&view=rev</a><br>
Log:<br>
Add a convenience function to FormatManager to setup an empty filter (one that suppresses all children, that is)<br>
<br>
Modified:<br>
    lldb/trunk/source/DataFormatters/FormatManager.cpp<br>
<br>
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=217891&r1=217890&r2=217891&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=217891&r1=217890&r2=217891&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)<br>
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Sep 16 12:41:54 2014<br>
@@ -957,6 +957,15 @@ static void AddFilter  (TypeCategoryImpl<br>
     else<br>
         category_sp->GetTypeFiltersContainer()->Add(type_name,filter_sp);<br>
 }<br>
+<br>
+static void AddEmptyFilter  (TypeCategoryImpl::SharedPointer category_sp,<br>
+                             const char* description,<br>
+                             ConstString type_name,<br>
+                             ScriptedSyntheticChildren::Flags flags,<br>
+                             bool regex = false)<br>
+{<br>
+    AddFilter(category_sp, {}, description, type_name, flags, regex);<br>
+}<br>
 #endif<br>
<br>
 void<br>
<br>
<br>
_______________________________________________<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>
</blockquote></div><br></div>
</div></blockquote></div></div><div style="word-wrap:break-word"><div></div><br><div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>Thanks,</div><div><i>- Enrico</i><br>📩 egranata@<font color="#ff2600"></font>.com ☎️ 27683</div><div><br></div></div></div></div></div></div><br><br>
</div>
<br></div></blockquote></div>
</div></blockquote></div></div></div><div><div class="h5"><br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div>Thanks,</div><div><i>- Enrico</i><br>📩 egranata@<font color="#ff2600"></font>.com ☎️ 27683</div><div><br></div></div></div></div></div></div><br><br>
</div>
<br></div></div></div></blockquote></div><br></div></div>