[cfe-commits] Clang change to detect and warn about unused private members

Daniel Jasper djasper at google.com
Wed May 9 16:24:52 PDT 2012


>
> I didn't put a huge amount of effort into reviewing this, but here are a
> couple things I noticed...
>
> - How about putting a "Used" bit in FieldDecl, rather than keeping a
> separate SetVector? It's not like iterating over all fields is that much of
> a cost later.
>

I like the idea. Anyone against it?

- IsRecordFullyDefined should probably use SmallPtrSetImpl, to avoid
> specifying a size in the function prototype. (Not that it /really/ matters,
> but...)
>

But all the methods in SmallPtrSetImpl are protected!?

- You have an additional "NumArgs > 0" when marking a field used, and the
> for-loop should probably be in an else-case.
>

Changed.


> - Don't use isa<> followed by dyn_cast<>. Just put the dyn_cast<> in the
> condition.


Done.


>
> Jordy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120509/59f1f248/attachment.html>


More information about the cfe-commits mailing list