<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 24, 2013 at 2:57 PM, <a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a> <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@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 class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
</blockquote><div><br></div></div><div>
1) Eric mentioned some concerns that this flag does something else in GCC - implementing subtly different semantics for the same flag might not be ideal<br></div></blockquote><div><br></div><div>It would seem better to tie this flag to the same thing that the vtable is tied to? (key functions?) Or if the only common factor is the vtable itself, just make it do what it says on the tin: -femit-class-debug-info-with-vtable, and it defaults on where we can use this optimization?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>2) a broader flag that expresses the "assume I'm only building this translation unit with debug info" might be a more useful feature - this would encompass -flimit-debug-info as well (sort of bringing us full circle to your original proposal) but potentially renaming it to be more descriptive/actionable for users, and future proof for when we find other reasons to omit debug info because we know it'll be elsewhere. Though I'm still not 100% sure of bundling these two things together. It might be the right thing, but I'm just not sure (mostly I'm not sure if the current -flimit-debug-info behavior is perfectly correct/sane - we'd need to check the GDB 7.5 failures that  occur when this flag is enabled, just to ensure that there aren't any fundamental bugs in the flag that mean even full-debug-builds would want to disable that optimization without disabling the vtable opt)</div>
</blockquote></div><br>I think this potentially makes sense as a nice and descriptive umbrella flag. I like the idea of a best-effort flag that switches the debug info emission to compensate for partial compilation with debug info. I suspect we'll end up with more than 2 specific features we want to toggle for this purpose, and so having an umbrella flag makes a lot of sense to me.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">My 2 cents.</div><div class="gmail_extra">-Chandler</div></div>