On Tue, May 15, 2012 at 3:33 PM, David Blaikie <[email protected]> wrote:

> > - Optimizing based on non-null-ness
>
> Clang doesn't optimize references on the basis of non-null-ness? For
> those things that need to be reassigned, but are guaranteed to never
> be null (I'm not sure we have (m)any of those - mostly if we're
> reassigning them, they start out/may be null for some time)

...

> > - Still able to overwrite the argument within the funciton
>
> That usually seems to be a source of errors (as we've seen with people
> thinking they have an out parameter & assigning to the parameter
> directly, rather than the dereferenced parameter). Are there many
> deliberate uses of this in Clang?


Yes, this is a very common pattern:

void foo(Decl *D) {
  if (Decl *UnderlyingD = D->someWonkyMethod())
    D = UnderlyingD;
  ...
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to