r188739 - Revert "Revert "Revert "Revert "DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class""""

Adrian Prantl aprantl at apple.com
Mon Dec 23 11:04:24 PST 2013


On Dec 17, 2013, at 12:15, David Blaikie <dblaikie at gmail.com> wrote:

> 
> 
> 
>> On Mon, Dec 16, 2013 at 8:06 PM, Adrian Prantl <aprantl at apple.com> wrote:
>> 
>> On Dec 16, 2013, at 4:54 PM, Greg Clayton <gclayton at apple.com> wrote:
>> 
>> >
>> > On Dec 16, 2013, at 2:55 PM, David Blaikie <dblaikie at gmail.com> wrote:
>> >
>> >>
>> >>
>> >>
>> >> On Mon, Dec 16, 2013 at 2:44 PM, Adrian Prantl <aprantl at apple.com> wrote:
>> >> Hi Chandler and David,
>> >>
>> >> unfortunately it looks more like case 1. This optimization breaks several assumptions that tools in our software stack depend on.
>> >>
>> >> It's a fairly substantial debug info size savings that seems worth investigating whether you can keep it enabled at least in
>> >>
>> >> - For example, it breaks dtrace, which on Darwin relies on being able to pull the (complete) CTF info (compact C type format) out of the DWARF in the .dSYM for a given module.
>> >>
>> >> I take it you're already using -fno-limit-debug-info for these scenarios, then? (are you using -flimit-debug-info at all?)
>> >
>> > Yes, this is what will need to happen now that clang has changed.
>> 
>> In case this wasn't clear enough: Currently, this optimization is totally orthogonal to limited debug info. Passing -fno-limit-debug-info will not make any of these examples work. This thread is about adding an additional flag to the frontend that controls this optimization.
>> 
>> I guess we could make also it part of -flimit-debug-info, either way will work.
>> 
> Agreed. Though I'd rather separate it from -flimit-debug-info. -flimit-debug-info is more aggressive. But, yes, for this particular kernel scenario, if you do end up needing to disable the vtable-based optimization, you should already be disabling -flimit-debug-info.
> 
> - David 

In an attempt to wrap up this discussion:
- this optimization greatly reduces debug info size.
- but there are scenarios where it is useful for users to disable this optimization, and not just on Darwin (e.g., when linking against C++ libraries that come without debug info)

I hereby propose to go with David’s suggestion above to add an independent -femit-class-debug-always option to clang that controls this behavior. I’m also volunteering to implement it.

David, it seems as if adding the condition to CreateType() in CGDebugInfo.cpp:1473 would do the trick, is that correct?

cheers,
  adrian

*runs for cover :-p*





More information about the cfe-commits mailing list