<div class="gmail_quote">On Tue, May 15, 2012 at 3:33 PM, David Blaikie <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">> - Optimizing based on non-null-ness<br>
<br>
</div>Clang doesn't optimize references on the basis of non-null-ness? For<br>
those things that need to be reassigned, but are guaranteed to never<br>
be null (I'm not sure we have (m)any of those - mostly if we're<br>
reassigning them, they start out/may be null for some time)</blockquote><div>...</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"></div><div class="im">

> - Still able to overwrite the argument within the funciton<br>
<br>
</div>That usually seems to be a source of errors (as we've seen with people<br>
thinking they have an out parameter & assigning to the parameter<br>
directly, rather than the dereferenced parameter). Are there many<br>
deliberate uses of this in Clang?</blockquote></div><div><br></div>Yes, this is a very common pattern:<div><br><div>void foo(Decl *D) {</div><div>  if (Decl *UnderlyingD = D->someWonkyMethod())</div><div>    D = UnderlyingD;</div>
<div>  ...</div><div>}</div></div>