summaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAge
...
* retain/release checker: Refactor the guts of getClassMethodSummary to not dependTed Kremenek2009-04-29
| | | | | | | | on ObjCMessageExpr. This will enable us to use it elsewhere. This should not change any functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70352 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement ownership attribute 'objc_ownership_make_collectable'. This allows oneTed Kremenek2009-04-28
| | | | | | | to add 'CFMakeCollectable' semantics to a method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70336 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 70293.Ted Kremenek2009-04-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70313 91177308-0d34-0410-b5e6-96231b3b80d8
* Now we can remove the 'blast-through' code.Zhongxing Xu2009-04-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70293 91177308-0d34-0410-b5e6-96231b3b80d8
* Add two new checker-specific attributes: 'objc_ownership_release' andTed Kremenek2009-04-27
| | | | | | | | 'objc_ownership_cfrelease'. These are the 'release' equivalents of 'objc_ownership_retain' and 'objc_ownership_cfretain' respectively. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70235 91177308-0d34-0410-b5e6-96231b3b80d8
* Track objects in GC mode returned by 'alloc', 'new', etc. methods. These areTed Kremenek2009-04-27
| | | | | | | treated as "not owned" objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70232 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new checker-specific attribute 'objc_ownership_cfretain'. This is the sameTed Kremenek2009-04-27
| | | | | | | | | as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead of a [... retain] (important in GC modes). Checker support is wired up, but currently only for Objective-C message expressions (not function calls). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70218 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement function-try-blocks. However, there's a very subtle bug that I ↵Sebastian Redl2009-04-26
| | | | | | can't track down. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
* Hook up attribute 'objc_ownership_retain' to the analyzer. This attribute allowsTed Kremenek2009-04-25
| | | | | | | | users to specify that a method's argument is visibly retained (reference count incremented). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70008 91177308-0d34-0410-b5e6-96231b3b80d8
* Hook up __attribute__((objc_ownership_returns)) to the retain/release checker.Ted Kremenek2009-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70002 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the same false positive reported in PR 2542 and <rdar://problem/6793409>Ted Kremenek2009-04-24
| | | | | | | involving an NSAnimation object delegating its release to a delegate method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69992 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor refactoring: pass selector to getCommonMethodSummary(). No functionalityTed Kremenek2009-04-24
| | | | | | | change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69985 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: more hacks to workaround false positives cause byTed Kremenek2009-04-24
| | | | | | | | delegates. When a reference counted object is passed as to a 'void*' argument to a method stop tracking the reference count. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69984 91177308-0d34-0410-b5e6-96231b3b80d8
* Sentence case bug name.Ted Kremenek2009-04-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69983 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker:Ted Kremenek2009-04-24
| | | | | | | | | | | | - Fix summary lookup for class methods to now use the (optional) ObjCInterfaceDecl associated with a message expression. This removes a long-standing FIXME. - Partial fix for <rdar://problem/6062730> by stop tracking objects that are passed to [NSObject performSelector]. These methods are often used for delegates, which the analyzer doesn't reason about well yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69982 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor common logic in getMethodSummary() and getClassMethodSummary(). NoTed Kremenek2009-04-23
| | | | | | | functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69936 91177308-0d34-0410-b5e6-96231b3b80d8
* Further cleanups to isTrackedObjectType().Ted Kremenek2009-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69929 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: Don't call isTrackedObject() with the canonical type.Ted Kremenek2009-04-23
| | | | | | | This was preventing the checker from tracking return objects referenced by 'id'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69922 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: For class methods, only treat return values that areTed Kremenek2009-04-23
| | | | | | | object references as tracked objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69915 91177308-0d34-0410-b5e6-96231b3b80d8
* Per discussions with Ken Ferry and Paul Marks (<rdar://problem/6815234>) greatlyTed Kremenek2009-04-23
| | | | | | | | | extend the number of objects tracked by the retain/release checker by assuming that all class and instance methods should follow Cocoa object "getter" and "alloc/new" conventions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69908 91177308-0d34-0410-b5e6-96231b3b80d8
* get a CodeTextRegion when visiting FunctionDecl reference.Zhongxing Xu2009-04-20
| | | | | | | get FunctionDecl with more general utility method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69570 91177308-0d34-0410-b5e6-96231b3b80d8
* FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor2009-04-18
| | | | | | | | | lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
* - Move ownership of MemRegionManager into ValueManager.Ted Kremenek2009-04-09
| | | | | | | | - Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly simplifies the calling interface to clients. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68731 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-09
| | | | | | | No functionality change (really). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
* analyzer: Introduce a new class, ValueManager, that serves as an aggregateTed Kremenek2009-04-09
| | | | | | | | | | | | "manager of symbolic values", wrapping BasicValueFactory, SymbolManager, and MemRegionManager. While these individual managers nicely separate functionality in the analyzer, constructing symbolic values can sometimes be cumbersome because it requires using multiple managers at once. The goal of this class is to create some factory methods to create SVals that require the use of these different managers, thus (hopefully) simplifying the analyzer API for clients. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68709 91177308-0d34-0410-b5e6-96231b3b80d8
* stop using loc::SymbolVal.Zhongxing Xu2009-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68696 91177308-0d34-0410-b5e6-96231b3b80d8
* stop using loc::SymbolVal.Zhongxing Xu2009-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68695 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up code with new API.Zhongxing Xu2009-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68694 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up code with new API.Zhongxing Xu2009-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68693 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new method because sometimes the type of the conjured symbol is not theZhongxing Xu2009-04-09
| | | | | | | type of the expression where we create the symbol. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68692 91177308-0d34-0410-b5e6-96231b3b80d8
* make a conjured symbol as the original code.Zhongxing Xu2009-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68691 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up code with new API.Zhongxing Xu2009-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68687 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove GetLeakNode. This isn't the right approach.Ted Kremenek2009-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68502 91177308-0d34-0410-b5e6-96231b3b80d8
* Eagerly compute the leak location when a leak occurs at the end of a path.Ted Kremenek2009-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68496 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: When hunting for the leak location, don't walk theTed Kremenek2009-04-07
| | | | | | | | ExplodedGraph backwards. That may inadvertently result in reverse control-flow edges in the PathDiagostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68477 91177308-0d34-0410-b5e6-96231b3b80d8
* Sentence-case bug type.Ted Kremenek2009-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68406 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: don't track NSPanel until we have better reasoning aboutTed Kremenek2009-04-03
| | | | | | | the subtle ownership issues of such objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68397 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix grammar.Ted Kremenek2009-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68282 91177308-0d34-0410-b5e6-96231b3b80d8
* Title-case the names of bug types.Ted Kremenek2009-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68274 91177308-0d34-0410-b5e6-96231b3b80d8
* - Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocationTed Kremenek2009-04-01
| | | | | | | | | | instead of a FullSourceLoc. This resulted in a bunch of small edits in various clients. - Updated BugReporter to include an alternate PathDiagnostic generation algorithm for PathDiagnosticClients desiring more control-flow pieces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68193 91177308-0d34-0410-b5e6-96231b3b80d8
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-26
| | | | | | | | | | | | | | | | | Zhongxing and I discussed by email. Main changes: - Removed SymIntConstraintVal and SymIntConstraint - Added SymExpr as a parent class to SymbolData, SymSymExpr, SymIntExpr - Added nonloc::SymExprVal to wrap SymExpr - SymbolRef is now just a typedef of 'const SymbolData*' - Bunch of minor code cleanups in how some methods were invoked (no functionality change) This changes are part of a long-term plan to have full symbolic expression trees. This will be useful for lazily evaluating complicated expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67731 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: Tracking autorelease counts for objects. We're still notTed Kremenek2009-03-20
| | | | | | | completely there with accurately modeling autorelease pools. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67384 91177308-0d34-0410-b5e6-96231b3b80d8
* Stub out some code for support for NSDeallocateObject. This is enabled yet untilTed Kremenek2009-03-17
| | | | | | | we resolve the semantics of this function when GC is enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67116 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: Add support for reasoning about -dealloc.Ted Kremenek2009-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67094 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowedTed Kremenek2009-03-13
| | | | | | | to return an owning pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66934 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove '[naming convention]' from bug type.Ted Kremenek2009-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66739 91177308-0d34-0410-b5e6-96231b3b80d8
* retain/release checker: Allow allocations to fail by returning nil.Ted Kremenek2009-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66487 91177308-0d34-0410-b5e6-96231b3b80d8
* Create PathDiagnosticPiece subclasses PathDiagnosticEventPiece andTed Kremenek2009-03-06
| | | | | | | | | PathDiagnosticControlFlowPiece to distinguish (in the class hierarchy) between events and control-flow diagnostic pieces. Clients must now use these directly when constructing PathDiagnosticPieces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66310 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor tweak: Recognize 'CGCF' prefix in addition to 'CF' and 'CG'.Ted Kremenek2009-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66208 91177308-0d34-0410-b5e6-96231b3b80d8
* BasicStore:Ted Kremenek2009-03-05
| | | | | | | | | | | | | | | - Store bindings using a MemRegion -> SVal binding instead of VarDecl -> SVal binding. This mirrors some of the idea of RegionStore, but is far simpler and not nearly as functional. This leads to some code simplification and some potential for some minor precision hacks. Along the way... - constify the use of MemRegion* in a few places - add operator<<(llvm::raw_ostream, const MemRegion*) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66163 91177308-0d34-0410-b5e6-96231b3b80d8