[cfe-commits] [patch] Warn on self assignment for member variables

Nico Weber thakis at chromium.org
Mon Jun 25 14:43:39 PDT 2012


On Mon, Jun 25, 2012 at 1:14 PM, Ted Kremenek <kremenek at apple.com> wrote:
> On Jun 25, 2012, at 12:42 PM, Nico Weber <thakis at chromium.org> wrote:
>
> Hi Ted,
>
> On Mon, Jun 25, 2012 at 12:40 PM, Ted Kremenek <kremenek at apple.com> wrote:
>
> Hi Nico,
>
> How expensive is this check?  This code makes me nervous:
>
>
> I didn't measure, but note that this is only executed if the lhs and
> rhs are both MemberExprs, and they both refer to the same Decl. This
> isn't true for most assignments.
>
>
> Makes sense.
>
>
> Is it enough to do measure the impact on a full build of chromium, or
> would you like to see more data?
>
>
> Measuring against full build of Chromium seems reasonable to me.

Full build of the 'chrome' target with this warning on my MBP: real	31m41.500s
Same clang binary at the same revision, without the warning: real	31m53.572s

So the compile-time impact of the warning is below noise I'd say.

Nico

>  It would
> be nice for us to establish a common set of representative codebases to do
> this kind of performance measurement on.




More information about the cfe-commits mailing list