[cfe-dev] Implementing -Wunused-variables
Douglas Gregor
dgregor at apple.com
Thu Oct 8 14:38:52 PDT 2009
On Oct 6, 2009, at 9:12 AM, Oscar Bonilla wrote:
> On Oct 5, 2009, at 11:37 PM, Oscar Bonilla wrote:
>
>> On Oct 5, 2009, at 9:46 PM, Oscar Bonilla wrote:
>>
>>> Is this any better?
>>
>> Still not quite right:
>
> Ok, this one seems to do the trick:
>
> <ob.patch>
>
> Testcases:
>
> <warn-unused-variables.c><warn-unused-variables.cpp>
>
> I ran "make test" and only got one failure:
>
> FAIL: Clang::Index/c-index-api-test.m (646 of 1636)
>
> which seems unrelated. I also compiled Adium with it and didn't get
> any obvious false positives or false negatives.
Wonderful, thank you! I've committed this patch here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091005/022108.html
along with your suggested micro-optimization. We love optimizations of
all kinds, and moving the isUsed() check first will save a lot of
isa<> checks. Good catch!
- Doug
More information about the cfe-dev
mailing list