<div>Hi, cfe-commits!</div><div><br></div>This patch adds a new Clang compiler flag "-gline-tables-only". It should reduce the amount of emitted debug information:<div>1) DIEs in .debug_info should only have types DW_TAG_compile_unit, DW_TAG_subprogram, DW_TAG_inlined_subroutine (for opt builds), DW_TAG_lexical_block.</div>
<div>2) .debug_str should only contain function names</div><div>3) No debug data for types/namespaces/variables should be emitted.</div><div>4) The data in .debug_line should be enough to produce valid stack traces with function names and line numbers.</div>
<div><br></div><div>This flag can reduce the size of the binary by some factor, but still allow to obtain valid stack traces (both for debug and opt builds, and for inlined functions).</div><div>Results of measurements on SPEC CPU 2006 benchmarks (for Clang r155349):</div>
<div><br></div><div>binary size increase factor for:</div><div>"-O0 -g": average - 2x, max - 5.85x</div><div>"-O0 -gline-tables-only": average - 1.2x, max - 1.44x</div><div>"-O2 -g": average - 3.45x, max - 11x</div>
<div>"-O2 -gline-tables-only": average - 1.47x, max - 2.76x</div><div><br></div><div>Similar patch exists for gcc but is not yet in trunk</div><div><span style>(See this patch at </span><a href="http://old.nabble.com/-patch--Add-new--gmlt-option-for-min.-debug-info-with-line-tables-(issue4440072)-td31482851.html" target="_blank" style="font-family:arial,sans-serif;font-size:13px;color:rgb(17,85,204)">http://old.nabble.com/-patch--Add-new--<span class="il" style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">gmlt</span>-option-for-min.-debug-info-with-line-tables-(issue4440072)-td31482851.html</a></div>
<div><div style>or <a href="http://codereview.appspot.com/4440072" target="_blank" style="color:rgb(17,85,204)">http://codereview.appspot.com/4440072</a>). gcc patch is used in Google for about 2 years already.</div><div>
<br></div><div>You can review the Clang patch at: <a href="http://codereview.appspot.com/6112056/">http://codereview.appspot.com/6112056/</a></div><div><br></div><div>--</div><div><div>Alexey Samsonov, MSK</div><div>Software Engineer, Google</div>
<br>
</div></div>