summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CocoaConventions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-16/+16
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* [analyzer] Teach RetainCountChecker about CoreMedia APIsDevin Coughlin2017-11-251-3/+10
| | | | | | | | | | Teach the retain-count checker that CoreMedia reference types use CoreFoundation-style reference counting. This enables the checker to catch leaks and over releases of those types. rdar://problem/33599757 llvm-svn: 318979
* Allow the cf_returns_[not_]retained attributes to appear on out-parameters.Douglas Gregor2015-06-191-1/+1
| | | | | | | | | | | | | | | | Includes a simple static analyzer check and not much else, but we'll also be able to take advantage of this in Swift. This feature can be tested for using __has_feature(cf_returns_on_parameters). This commit also contains two fixes: - Look through non-typedef sugar when deciding whether something is a CF type. - When (cf|ns)_returns(_not)?_retained is applied to invalid properties, refer to "property" instead of "method" in the error message. rdar://problem/18742441 llvm-svn: 240185
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-3/+3
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Add missing cctype includes.Joerg Sonnenberger2012-08-101-0/+2
| | | | llvm-svn: 161660
* Kill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They ↵Jordy Rose2012-03-171-40/+0
| | | | | | | | are now just simple wrappers around method families, and method decls can cache method family lookups. Also, no one is using them right now. The one difference between ObjCMethodDecl::getMethodFamily and Selector::getMethodFamily is that the former will do some additional sanity checking, and since CoreFoundation types don't look like Objective-C objects, an otherwise interesting method will get a method family of OMF_None. Future clients that use method families should consider how they want to handle CF types. llvm-svn: 153000
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-3/+0
| | | | llvm-svn: 148577
* Teach the static analyzer to not treat XPC types as CF types.Ted Kremenek2012-01-041-1/+3
| | | | llvm-svn: 147506
* Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor2011-12-151-1/+1
| | | | | | | | | | declarations and definitions) as ObjCInterfaceDecls within the same redeclaration chain. This new representation matches what we do for C/C++ variables/functions/classes/templates/etc., and makes it possible to answer the query "where are all of the declarations of this class?" llvm-svn: 146679
* Tweak the interface for analyzing the CF conventions for a nameJohn McCall2011-10-011-1/+11
| | | | | | | | | | | | to take a FunctionDecl* instead of an llvm::StringRef. Eventually we might push more logic in there, like using slightly different conventions for C++ methods. Also, fix a bug where 'copy' and 'create' were being caught in non-camel-cased strings. We want copyFoo and CopyFoo and XCopy but not Xcopy or xcopy. llvm-svn: 140911
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-0/+1
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
* Fix else style. No functionality change intended.Chad Rosier2011-08-171-2/+1
| | | | llvm-svn: 137896
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-11/+8
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* [analyzer] Per discussions with the Cocoa team, extend CF naming conventions ↵Ted Kremenek2011-07-161-2/+41
| | | | | | to extend to camel case functions instead of just title case functions. Fixes <rdar://problem/9732321>. llvm-svn: 135350
* [analyzer] Place checking for Core Foundation "Create" rule into a proper ↵Ted Kremenek2011-07-161-6/+11
| | | | | | API. No functionality change. llvm-svn: 135349
* Teach the static analyzer's interpretation of Cocoa conventions toDouglas Gregor2011-07-061-2/+4
| | | | | | | obey the objc_method_family attribute when provided. Fixes <rdar://problem/9726279>. llvm-svn: 134493
* Added a missing case label.Fariborz Jahanian2011-07-061-0/+1
| | | | llvm-svn: 134454
* Finish 2 sentences.Francois Pichet2011-06-161-1/+1
| | | | llvm-svn: 133214
* Implement Objective-C Related Result Type semantics.Douglas Gregor2011-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
* Move some of the logic about classifying Objective-C methods intoJohn McCall2011-03-021-74/+18
| | | | | | | | conventional categories into Basic and AST. Update the self-init checker to use this logic; CFRefCountChecker is complicated enough that I didn't want to touch it. llvm-svn: 126817
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-1/+1
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* [analyzer] Add 'bool ignorePrefix' parameter to ↵Argyrios Kyrtzidis2011-01-111-1/+6
| | | | | | | | | | | cocoa::deriveNamingConvention to control whether the prefix should be ignored. E.g. if ignorePrefix is true, "_init" and "init" selectors will both be result in InitRule, but if ignorePrefix is false, only "init" will return InitRule. llvm-svn: 123262
* Rename static analyzer namespace 'GR' to 'ento'.Ted Kremenek2010-12-231-1/+1
| | | | llvm-svn: 122492
* [analyzer] Refactoring: Move stuff into namespace 'GR'.Argyrios Kyrtzidis2010-12-221-0/+1
| | | | llvm-svn: 122423
* Fix assertion failure in cocoa::deriveNamingConvention()Ted Kremenek2010-12-171-4/+6
| | | | | | when the selector is the string 'mutable'. llvm-svn: 122046
* Move CocoaConventions.[h,cpp] from libCheckerTed Kremenek2010-12-171-0/+172
to libAnalysis. Similar to Format (format string checking), CocoaConventions has the potential to serve clients other than the static analyzer. llvm-svn: 122040
OpenPOWER on IntegriCloud