<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In an attempt to wrap up this discussion:<br>
- this optimization greatly reduces debug info size.<br>
- 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)<br>
<br>
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>
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><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>
<div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
David, it seems as if adding the condition to CreateType() in CGDebugInfo.cpp:1473 would do the trick, is that correct?<br></blockquote><div><br></div><div>I haven't looked yet, but probably... </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
cheers,<br>
  adrian<br>
<br>
*runs for cover :-p*<br>
<br>
</blockquote>