[cfe-commits] r53987 - in /cfe/trunk: lib/Analysis/CheckObjCDealloc.cpp test/Analysis/IBOutlet.m test/Analysis/MissingDealloc_SEL.m

Ted Kremenek kremenek at apple.com
Thu Jul 24 17:00:24 PDT 2008

On Jul 24, 2008, at 2:22 PM, Chris Lattner wrote:

> Hi Ted,
> I don't think this is the right fix.  Won't your checker still warn  
> about other things like "int*" ivars?

Sure.  Without doing more analysis, the question is whether or not in  
the common case an Objective-C object with an int* owns the memory  
referenced by the int*.  In such cases -dealloc should be implemented.

>>    if ((T->isPointerType() || T->isObjCQualifiedIdType()) &&
>> +        (ID->getAttr<IBOutletAttr>() == 0 && // Skip IBOutlets.
>> +         !isSEL(T, SelII))) { // Skip SEL ivars.
>>      containsPointerIvar = true;
> I think the right check should be what Sema::isObjCObjectPointerType  
> does.  I think it would make sense to pull this out and put it on  
> ASTContext or Type.  What do you think?

Agreed.  I moved isObjCObjectPointerType() from Sema to ASTContext.

More information about the cfe-commits mailing list