[cfe-commits] r97103 - in /cfe/trunk: lib/Sema/SemaDeclAttr.cpp test/SemaObjC/unused.m

Fariborz Jahanian fjahanian at apple.com
Thu Feb 25 10:11:59 PST 2010


On Feb 25, 2010, at 10:01 AM, Ted Kremenek wrote:

> Right now it is only used by the static analyzer, but I think the  
> question is a bit ill-phrased.
>
> By the compiler, are you taking about code generation or warnings?   
> Right now this attribute is only consulted for the purpose of  
> omitting warnings.  In this
I meant warnings. I can't see how code generation can be involved here.

> regards the static analyzer is just a more advanced tool for issuing  
> warnings than the compiler, so there is no reason the compiler  
> couldn't use it for this purpose as well if the need came up.  I'm  
> not being hypothetical here; I'm just saying this was added for the  
> sake of better warnings.

I am not sure how static analyzer can issue warning and not having  
many false positives. You need whole program analysis
to see all implementations (of class and its categories). Also, ivars  
maybe be accessed through properties. Does
static analyzer consider this?

- Fariborz


>
>
> For code generation, I don't think there is any optimization that  
> can be done right now for an ivar declared unused.
>
> On Feb 25, 2010, at 9:15 AM, Fariborz Jahanian wrote:
>
>> Hi Ted,
>>
>> Is the 'unused' attribute for the benefit of static analyzer only  
>> or you are planning on using it
>> in the compiler as well?
>>
>> - Fariborz
>>
>> On Feb 24, 2010, at 7:26 PM, Ted Kremenek wrote:
>>
>>> Author: kremenek
>>> Date: Wed Feb 24 21:26:51 2010
>>> New Revision: 97103
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=97103&view=rev
>>> Log:
>>> Allow __attribute__((unused)) to be applied to ObjC ivars.
>>>
>




More information about the cfe-commits mailing list