[cfe-dev] Objective-C tidy up

Chris Lattner clattner at apple.com
Tue Jun 17 11:06:49 PDT 2008


On Jun 16, 2008, at 7:23 AM, David Chisnall wrote:
>> 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.

Applied, thanks!

Please add some comments above the ImplicitParamDecl class indicating  
what it is used for.  It would also be nice to sink this down the  
class hierarchy, working with Ted as appropriate to identify the  
changes to the checker that are needed.

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

Where are you seeing this?  make test passes for me.  Thanks a lot  
David,

-Chris



More information about the cfe-dev mailing list