<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 25, 2016 at 6:04 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 25, 2016 at 5:53 PM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@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"><span><br><div><blockquote type="cite"><div>On Mar 25, 2016, at 5:48 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 25, 2016 at 5:44 PM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
> On Mar 25, 2016, at 12:41 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Fri, Mar 25, 2016 at 12:33 PM, Adrian Prantl via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> aprantl added a comment.<br>
>><br>
>> Digging further through the commit (and radar) history this feature has been added to support dtrace.<br>
>> Instead of having everyone pay for this, I think it would be a more appropriate resolution for this to add something like a -gfull option to clang that retains every type in the compile unit.<br>
><br>
> Possibly - but is that what dtrace needs? It'll be a /lot/ of debug info... but yeah, having some filtering flags (with the default being what you are going for in this patch - if it's referenced by live code, we include it (types, subprograms, etc)).<br>
<br>
</span>Looking at the clang sources I noticed that the clang driver already accepts a -gfull option for gcc compatibility; it translates to -fno-eliminate-unused-debug-symbols and is ignored by cc1.<br>
<br>
I think it would make sense to pass this option through to LLVM and move the collectDeadVariables logic from the DwarfUnit.cpp into GlobalDCE.cpp where dead functions are being deleted. When -fno-eliminate-unused-debug-symbols is present, GlobalDCE can insert the types of all local variables attached to the dead Function’s DISubprogram to the DICompileUnit’s set of retained types, thus preserving the spirit of r107027.<br></blockquote><div><br>Why not just put all the types in the retained types list to begin with? (size could be a factor, but would be interesting to know before having to make sure they're preserved through various optimizations)</div></div></div></div></div></blockquote><br></div></span><div>I’ll definitely do some benchmarking, but the main problem I see is that we then emit debug info for every type defined in a header file regardless of whether it is used or not. </div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I'm not suggesting that - I'm just suggesting every type we already build debug info metadata for, we put in the retained types list. So we can't lose them during optimization. It's not -gfull. -gfull I imagine is what you just described and would be crazy big (granted, I haven't tested GCC's -gfull, not sure what it actually does)<br></div><div> <br>(what Duncan said)<br></div></div></div></div></blockquote><div><br></div><div>It is that big. :)</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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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>Since the dtrace ctfconvert utility is run on the kernel, which is mostly written in C, there is no type uniquing possible and I’m worried about the amount of debug info this generates.</div><span><font color="#888888"><div><br></div><div>-- adrian</div></font></span></div></blockquote></div></div></div></blockquote></div></div>