[cfe-dev] Objective-C tidy up

David Chisnall csdavec at swansea.ac.uk
Mon Jun 16 07:23:52 PDT 2008

On 8 Jun 2008, at 18:42, Chris Lattner wrote:

> On Jun 8, 2008, at 10:30 AM, David Chisnall wrote:
>>>> It should be working now (does for me, at least...).  Assignments  
>>>> to self were failing because implicit params are not valdecls and  
>>>> I missed a test.
>>> Getting closer!  We now just have the NSString.m failure:
>>> /Users/sabre/llvm/tools/clang/lib/Analysis/../../include/clang/ 
>>> Analysis/Visitors/CFGRecStmtDeclVisitor.h:66: failed assertion  
>>> `false && "Subtype of ScopedDecl not handled."'
>> I think this is fixed, but since this test only runs on OS X I  
>> can't test it...
> Thanks!  This gets it onto the next assertion:
> /Users/sabre/llvm/tools/clang/lib/Analysis/../../include/clang/ 
> Analysis/Support/ExprDeclBitVector.h:41: failed assertion `isValid()'
> Here's a .mi file.  Run with -checker-cfref -verify.
> <NSString.mi.gz>
> It would probably be useful to grep for other uses of VarDecl and  
> ParamVarDecl to see if the code applies to self as well.  There may  
> be other codepaths not being exercised by the testsuite.

I've made ImplicitParamDecl a subclass of VarDecl instead of  
ValueDecl.  It's not the ideal solution, but it does work.  The ideal  
solution would be to rearrange the hierarchy around VarDecl and stop  
implicit or explicit param decls from being subclasses of this, but it  
will require quite invasive changes in a lot of the analyses.

I now get some warnings from clang that this file doesn't appear to be  
expecting but, looking at the code, they all appear to be sensible:

Warnings seen but not expected:
   Line 1596: [CHECKER] Argument to 'NSString' method 'compare:'  
cannot be nil.
   Line 1600: [CHECKER] Argument to 'NSString' method  
'caseInsensitiveCompare:' cannot be nil.
   Line 1604: [CHECKER] Argument to 'NSString' method  
'compare:options:' cannot be nil.
   Line 1608: [CHECKER] Argument to 'NSString' method  
'compare:options:range:' cannot be nil.
   Line 1612: [CHECKER] Argument to 'NSString' method  
'compare:options:range:locale:' cannot be nil.
   Line 1615: [CHECKER] Argument to 'NSString' method  
'componentsSeparatedByCharactersInSet:' cannot be nil.
   Line 1622: [CHECKER] Object allocated on line 1618 and stored into  
's4' is no longer referenced after this point and has a retain count  
of +1 (object leaked).
   Line 1635: [CHECKER] Reference-counted object is used after it is  


-------------- next part --------------
A non-text attachment was scrubbed...
Name: objc.diff
Type: application/octet-stream
Size: 27333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080616/2e1ca82f/attachment.obj>

More information about the cfe-dev mailing list