<div class="gmail_quote">On 9 January 2012 15:27, Trass3r <span dir="ltr"><<a href="mailto:un@known.com">un@known.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">
static this() seems to be a problem. Unless there's powerful<br>
whole-program-optimisation, how can it strip out any data that might be<br>
initialised/touched in static this()?<br>
</blockquote></div>
It probably can't.</blockquote><div><br></div><div>I'm sure it's possible, but it would need some pretty powerful global expression analysis.</div><div>Ie, if data initialised in static this() is only touched in one function lets say, and that function is never referenced, then it should surely be able to safely eliminate that function and associated data?</div>
<div><br></div><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">
Why wouldn't dead code be eliminated effectively already?<br>
</blockquote></div>
Cause 1 section is created for each module. So if you use just 1 function the whole module is pulled in.<br>
</blockquote></div><br><div>Why would it pull the whole module if only one function is used? And why can't a post-link strip process clean it up?</div>