<div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 7, 2012 at 3:52 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank" class="cremed">baldrick@free.fr</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">On 07/09/12 20:36, Bill Wendling wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sep 7, 2012, at 9:38 AM, Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank" class="cremed">baldrick@free.fr</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Craig,<br>
<br>
On 07/09/12 18:18, Craig Topper wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Wouldn't dead code stripping in the linker have removed these from a released build?<br>
</blockquote>
<br>
good question, but it seems not since I regularly use these when debugging<br>
release build problems on linux (usually buildbot crashes).  (I don't have<br>
time to look into why they aren't removed right now, sorry).  If it was the<br>
case that the linker removes them then Manman's patch wouldn't really be<br>
needed :)<br>
<br>
</blockquote>
If you need them, then we should think of another method for removing them that works for us but doesn't affect your stuff.<br>
<br>
Manman, what do you think of having a flag, say REMOVE_DUMP, instead of using NDEBUG?<br>
</blockquote>
<br></div>
how about removing them when doing a build with no debug symbols, i.e. rather<br>
than conditioning on the presence of checks (NDEBUG), condition on the presence<br>
of debug info.  If there is no debug info then even I am not going to be<br>
calling these guys from the debugger, debugging is just too hard without debug<br>
info!  (The buildbots I get to debug from time to time are built as release-<br>
with-debug-info).<br></blockquote><div><br></div><div>I actually think NDEBUG makes a lot of sense here though... Debugging is also too hard without asserts! ;]</div><div><br></div><div>What makes the most sense to me is this:</div>
<div><br></div><div>1) Have a specific #define which will always enable the dump methods. I'll call it "LLVM_ENABLE_DUMP".</div><div>2) If not defined in the build, default this flag based on NDEBUG -> if !NDEBUG #define it to 1.</div>
<div><br></div><div>This would allow you to configure your buildbots with -DLLVM_ENABLE_DUMP Duncan if you wanted, or allow a normal dev to rebuild with that flag if there is a bug that cannot be reproduced with asserts enabled. It would keep these methods available for typical Release+Asserts builds. It would remove them from typical actual released binaries.</div>
</div></div>