summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update signature of EvalAssume.Ted Kremenek2008-07-171-3/+3
| | | | llvm-svn: 53745
* isRetain() and isRelease() now only returns true if "Retain"/"Release" ↵Ted Kremenek2008-07-151-2/+4
| | | | | | appears in the suffix of a function's name. llvm-svn: 53621
* Support retain/release tracking for CoreGraphics (CGxxxRef) objects.Ted Kremenek2008-07-151-12/+83
| | | | llvm-svn: 53617
* Refactored most of the "Store" piece of ValueState into a Store type. TheTed Kremenek2008-07-101-29/+33
| | | | | | | | | current store implementation is now encapsulated by BasicStore. These changes prompted some long due constification of ValueState. Much of the diffs in this patch include adding "const" qualifiers. llvm-svn: 53423
* Fix PR2519: correctly handle CFDictionaryCreate.Ted Kremenek2008-07-091-9/+31
| | | | llvm-svn: 53334
* Updated clients of ImmutableMap::SlimFind to use ImmutableMap::lookup instead.Ted Kremenek2008-07-071-34/+24
| | | | llvm-svn: 53172
* Use conjured symbols for variables whose values are invalidated whenTed Kremenek2008-07-031-0/+27
| | | | | | | | passed-by-reference to a function. This allows us to build up constraints for their new values and restore some lost path-sensitivity. This addresses a few false positives since in Adium. llvm-svn: 53125
* Refactored some of the BugReporter interface so that data such as the ↵Ted Kremenek2008-07-021-2/+2
| | | | | | | | ASTContext&, PathDiagnosticClient*, can be provided by an external source. Split BugReporter into BugReporter and GRBugReporter so checkers not based on GRExprEngine can still use the BugReporter mechanism. llvm-svn: 53048
* Unlike NSWindow objects, NSPanel objects initially do not have self-ownership.Ted Kremenek2008-07-011-8/+23
| | | | llvm-svn: 52963
* Temporarily treat "Autorelease" as "StopTracking". This is the original ↵Ted Kremenek2008-07-011-1/+1
| | | | | | behavior. llvm-svn: 52940
* Added "Autorelease" ArgEffect to better simulate "autorelease" messages. RightTed Kremenek2008-06-301-4/+4
| | | | | | | now this does the same thing as "MayEscape", but more functionality will go in here shortly. llvm-svn: 52904
* CF ref checker:Ted Kremenek2008-06-251-245/+406
| | | | | | | | | | | | | | Tracked objects now have their type information tracked with them. Enhanced summaries for ObjC methods to include the type information of the receiver. Used the enhanced summaries to support the idiom that NSWindow owns itself (it sends a release message to itself upon close). Added some comments. Did some cleanups with the checker logic using operator overloading (reduced redundant code which I was concerned about being the source of bugs). llvm-svn: 52741
* Remove unneeded method arguments.Ted Kremenek2008-06-241-10/+3
| | | | llvm-svn: 52668
* Cache ObjC summaries by IdentifierInfo*, not by ObjCInterfaceDecl.Ted Kremenek2008-06-241-12/+21
| | | | llvm-svn: 52667
* Added ObjCSummaryCache, a new summary cache object to cache summaries for ↵Ted Kremenek2008-06-231-0/+101
| | | | | | Objective-C methods. Instead of mapping from Selectors -> Summaries, we will now map from (ObjCInterfaceDecl*,Selectors) -> Summaries. This will allow more nuanced summary generation. This patch just swaps in the new data structure; the rest of the code works as before by allowing the ObjCInterfaceDecl* to be null. llvm-svn: 52653
* Rename summary methods for "instance methods" to "class methods" (the names ↵Ted Kremenek2008-06-231-33/+33
| | | | | | got screwed up). No functionality change. llvm-svn: 52650
* The CF retain/release checker now assumes that allocations do not fail. ↵Ted Kremenek2008-06-231-51/+18
| | | | | | Eventually we will add a flag to the driver to enable allocation failures (documented as a FIXME). llvm-svn: 52632
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang as a Release build. The big change is that all AST nodes (subclasses of Stmt) whose children are Expr* store their children as Stmt* or arrays of Stmt*. This is to remove strict-aliasing warnings when using StmtIterator. None of the interfaces of any of the classes have changed (except those with arg_iterators, see below), as the accessor methods introduce the needed casts (via cast<>). While this extra casting may seem cumbersome, it actually adds some important sanity checks throughout the codebase, as clients using StmtIterator can potentially overwrite children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts provide extra sanity checks that are operational in debug builds to catch invariant violations such as these. For classes that have arg_iterators (e.g., CallExpr), the definition of arg_iterator has been replaced. Instead of it being Expr**, it is an actual class (called ExprIterator) that wraps a Stmt**, and provides the necessary operators for iteration. The nice thing about this class is that it also uses cast<> to type-checking, which introduces extra sanity checks throughout the codebase that are useful for debugging. A few of the CodeGen functions that use arg_iterator (especially from OverloadExpr) have been modified to take begin and end iterators instead of a base Expr** and the number of arguments. This matches more with the abstraction of iteration. This still needs to be cleaned up a little bit, as clients expect that ExprIterator is a RandomAccessIterator (which we may or may not wish to allow for efficiency of representation). This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c, which was already broken) on both a Debug and Release build, but it should obviously be reviewed. llvm-svn: 52378
* Teach the CF retain checker about "_init" methods. Fixes: ↵Ted Kremenek2008-06-021-1/+1
| | | | | | <rdar://problem/5956379> llvm-svn: 51872
* Prototyped support in the BugReporter to emit diagnostics of the form "p now ↵Ted Kremenek2008-05-221-0/+4
| | | | | | aliases q". llvm-svn: 51453
* Expand retain/release checker to consider methods/function calls that cause aTed Kremenek2008-05-221-27/+31
| | | | | | | | | | tracked object to "escape": it's reference count might be incremented by the called function, thus causing an object's lifetime to extend beyond when the local reference count is decremented to 0. This addresses: <rdar://problem/5933215> llvm-svn: 51433
* Cache leaks by the allocation site, not the leak location.Ted Kremenek2008-05-161-28/+58
| | | | llvm-svn: 51198
* Rename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary ↵Ted Kremenek2008-05-091-3/+3
| | | | | | to use IsLValType when conjuring symbols for return values (this fixes a bug with an assertion firing in the analyzer when two qualified objective-c types were compared). llvm-svn: 50924
* Added support for "drain".Ted Kremenek2008-05-071-0/+4
| | | | llvm-svn: 50831
* Expand the CF retain checker to allow the Create/Get rule to apply to anyTed Kremenek2008-05-071-52/+57
| | | | | | | | | | | | function that returns a CFxxxRef, not just functions whose name begins with CF. This implements <rdar://problem/5917879>. Added test case for this feature. Updated calls to CStrInCStrNoCase to swap their arguments, per compatibility with strcasestr. llvm-svn: 50829
* Flip order of arguments to CStrInStrNoCase.Ted Kremenek2008-05-071-2/+2
| | | | llvm-svn: 50824
* Use llvm::CStrInCStrNoCase instead of strcasestr, since the latter is not ↵Ted Kremenek2008-05-071-2/+4
| | | | | | | | portable. Correctly check if the result of CStrInCStrNoCase is NULL to generate summaries; before we were inverting the condition. llvm-svn: 50822
* copy-paste: NS types are not typedefs.Ted Kremenek2008-05-071-7/+5
| | | | llvm-svn: 50817
* Do not treat **instance** methods "copyWithZone:" and "mutableCopyWithZone:" ↵Ted Kremenek2008-05-071-18/+1
| | | | | | from NSObject as allocators. llvm-svn: 50802
* Be less promiscuous with generating summaries for "new", "copy", "create".Ted Kremenek2008-05-071-3/+3
| | | | llvm-svn: 50798
* Added auto-summary generation for createXXX, copyXXX, newXXX methods.Ted Kremenek2008-05-071-16/+12
| | | | llvm-svn: 50795
* Don't report leaks for autoreleased objects.Ted Kremenek2008-05-061-42/+21
| | | | llvm-svn: 50777
* More comments.Ted Kremenek2008-05-061-73/+72
| | | | | | "#if 0" out some assumptions when auto-generating method summaries. llvm-svn: 50772
* Experiment with not converting bug names to lower case.Ted Kremenek2008-05-061-11/+38
| | | | llvm-svn: 50753
* Generate "stop" summaries for selectors involving receivers whose type is ↵Ted Kremenek2008-05-061-19/+92
| | | | | | not NSxxxx. llvm-svn: 50721
* Use strncmp correctly.Ted Kremenek2008-05-061-3/+3
| | | | llvm-svn: 50715
* Make string comparison legible and remove buffer overrun introduced by typo.Ted Kremenek2008-05-061-2/+2
| | | | llvm-svn: 50714
* String comparison cleanups.Ted Kremenek2008-05-061-1/+1
| | | | | | Added test case. llvm-svn: 50711
* Fix logic error in string processing.Ted Kremenek2008-05-061-1/+1
| | | | llvm-svn: 50710
* Remove assertion.Ted Kremenek2008-05-061-1/+0
| | | | llvm-svn: 50709
* Use EvalSummary to process message expressions, thereby unifying the checkerTed Kremenek2008-05-061-135/+64
| | | | | | | | | | | | logic for function calls and message expressions. Use the following heuristic to infer "allocating" instance methods: [ClassName classWithXXX] allocates an object Update testcase to reflect this heuristic. llvm-svn: 50708
* Added receiver effects to EvalSummary.Ted Kremenek2008-05-061-7/+43
| | | | llvm-svn: 50700
* Expand summaries to include "Receiver" effects.Ted Kremenek2008-05-061-16/+40
| | | | llvm-svn: 50697
* Added initialization code to generate initial set of ObjC method summaries ↵Ted Kremenek2008-05-061-3/+22
| | | | | | (non-instance methods). llvm-svn: 50690
* Added code to generate initial set of summaries for instance methods.Ted Kremenek2008-05-061-17/+55
| | | | llvm-svn: 50689
* Add summary generation for "initXXX" methods.Ted Kremenek2008-05-051-5/+47
| | | | llvm-svn: 50684
* Make CF retain diagnostics more succinct.Ted Kremenek2008-05-051-4/+5
| | | | | | In a leak's "name", indicate GC or non-GC bugs. llvm-svn: 50680
* Initial work on refactoring the CFRefCount checker so that it is moreTed Kremenek2008-05-051-108/+184
| | | | | | generic and handles reference counts for NSObjects. llvm-svn: 50674
* Improve leak diagnostics to not report a leak on the same line where Ted Kremenek2008-05-051-16/+80
| | | | | | | | | | | | | | | | the object was last used. This can be confusing to users. For example: // 'y' is leaked x = foo(y); instead: x = foo(y); // 'y' is leaked llvm-svn: 50661
* Improved leak diagnostics.Ted Kremenek2008-05-051-23/+63
| | | | llvm-svn: 50657
OpenPOWER on IntegriCloud