[Lldb-commits] [lldb] r217891 - Add a convenience function to FormatManager to setup an empty filter (one that suppresses all children, that is)

Eric Christopher echristo at gmail.com
Tue Sep 16 13:44:50 PDT 2014


On Tue, Sep 16, 2014 at 1:39 PM, Enrico Granata <egranata at apple.com> wrote:

>
> On Sep 16, 2014, at 1:28 PM, Eric Christopher <echristo at gmail.com> wrote:
>
>
>
> On Tue Sep 16 2014 at 1:24:20 PM Enrico Granata <egranata at apple.com>
> wrote:
>
>> On Sep 16, 2014, at 12:32 PM, Eric Christopher <echristo at gmail.com>
>> wrote:
>>
>> This is unused by anything in lldb. Any reason to put it in explicitly?
>> (It's triggering on a Werror build of llvm+lldb).
>>
>>
>> I plan to use this facility on an internal Apple branch, but it is itself
>> general enough to warrant being in trunk
>>
>> With that said, the solution seems to fix whatever is causing the
>> breakage, rather than removing the code.
>>
>>
> The breakage is that it's an unused function :)
>
> /usr/local/google/home/echristo/sources/llvm/tools/lldb/source/DataFormatters/FormatManager.cpp:961:13:
> error: unused
>       function 'AddEmptyFilter' [-Werror,-Wunused-function]
> static void AddEmptyFilter  (TypeCategoryImpl::SharedPointer category_sp,
>             ^
> 1 error generated.
>
> 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?
>
>
> Sending        source/DataFormatters/FormatManager.cpp
> Transmitting file data .
> Committed revision 217900.
>
> I am not sure what this warning is buying us, but who am I to argue with
> the almighty compiler? :)
> Reverted.
>

Thanks!

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.

-eric


>
> Thanks!
>
> -eric
>
>
>>
>> -eric
>>
>> On Tue, Sep 16, 2014 at 10:41 AM, Enrico Granata <egranata at apple.com>
>> wrote:
>>
>>> Author: enrico
>>> Date: Tue Sep 16 12:41:54 2014
>>> New Revision: 217891
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=217891&view=rev
>>> Log:
>>> Add a convenience function to FormatManager to setup an empty filter
>>> (one that suppresses all children, that is)
>>>
>>> Modified:
>>>     lldb/trunk/source/DataFormatters/FormatManager.cpp
>>>
>>> Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=217891&r1=217890&r2=217891&view=diff
>>>
>>> ==============================================================================
>>> --- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
>>> +++ lldb/trunk/source/DataFormatters/FormatManager.cpp Tue Sep 16
>>> 12:41:54 2014
>>> @@ -957,6 +957,15 @@ static void AddFilter  (TypeCategoryImpl
>>>      else
>>>
>>>  category_sp->GetTypeFiltersContainer()->Add(type_name,filter_sp);
>>>  }
>>> +
>>> +static void AddEmptyFilter  (TypeCategoryImpl::SharedPointer
>>> category_sp,
>>> +                             const char* description,
>>> +                             ConstString type_name,
>>> +                             ScriptedSyntheticChildren::Flags flags,
>>> +                             bool regex = false)
>>> +{
>>> +    AddFilter(category_sp, {}, description, type_name, flags, regex);
>>> +}
>>>  #endif
>>>
>>>  void
>>>
>>>
>>> _______________________________________________
>>> lldb-commits mailing list
>>> lldb-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>>>
>>
>>
>> Thanks,
>> *- Enrico*
>> 📩 egranata@.com ☎️ 27683
>>
>>
>>
>>
>>
> Thanks,
> *- Enrico*
> 📩 egranata@.com ☎️ 27683
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140916/63547700/attachment.html>


More information about the lldb-commits mailing list