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

Ted Kremenek kremenek at apple.com
Thu Feb 25 10:01:54 PST 2010


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 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.

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