summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor BugReporter interface to have a new 'BugReporterContext' andTed Kremenek2009-05-061-28/+25
| | | | | | | | | | | 'BugReporterVisitor'. This simplifies callbacks from BugReporter to BugReports (via VisitNode). It also lays the foundation for arbitrary visitor "call backs" that can be registered to a BugReporterContext as a PathDiagnostic is constructed. These call backs can help operate as separate "experts" that can work on constructed pieces of a PathDiagnostic for which they possess special knowledge. llvm-svn: 71121
* Fix analyzer regression reported in PR 4164:Ted Kremenek2009-05-061-1/+23
| | | | | | | | | | - Update the old StoreManager::CastRegion to strip off 'ElementRegions' when casting to void* (Zhongxing: please validate) - Pass-by-reference argument invalidation logic in CFRefCount.cpp: - Strip ElementRegions when the ElementRegion is just a 'raw data' view on top of the underlying typed region. llvm-svn: 71094
* Implement attribute 'ns_autorelease'.Ted Kremenek2009-05-051-20/+27
| | | | llvm-svn: 70990
* Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').Ted Kremenek2009-05-051-0/+6
| | | | llvm-svn: 70952
* Remove experimental attribute 'ns_ownership_make_collectable.'Ted Kremenek2009-05-041-2/+0
| | | | llvm-svn: 70940
* Rename attributes 'objc_ownership...' to 'ns_ownership...'.Ted Kremenek2009-05-041-7/+7
| | | | llvm-svn: 70897
* Rename attributes:Ted Kremenek2009-05-041-2/+2
| | | | | | | | | | | 'objc_ownership_cfretain' -> 'cf_ownership_retain' 'objc_ownership_cfrelease' -> 'cf_ownership_release' Motivation: Core Foundation objects can be used in isolation from Objective-C, and this forces users to reason about the separate semantics of CF objects. More Sema support pending. llvm-svn: 70884
* retain checker: Add checker support for FunctionDecl ownership annotations. ↵Ted Kremenek2009-05-041-0/+29
| | | | | | Need to add Sema support. llvm-svn: 70873
* retain checker: Pull out logic for parameter annotations into aTed Kremenek2009-05-041-12/+21
| | | | | | separate method. llvm-svn: 70870
* retain checker: Don't treat function's declared in macros differently.Ted Kremenek2009-05-041-8/+1
| | | | llvm-svn: 70869
* retain checker:Ted Kremenek2009-05-041-91/+83
| | | | | | | - Fix retain checker test failures. - Update retain checker to have annotations override default summary effects, not completely redefine them. llvm-svn: 70828
* retain checker: RetainSummaryManager now has a 'DefaultSummary' objectTed Kremenek2009-05-041-39/+30
| | | | | | | which is returned instead of a null pointer. This helps centralize the logic concerning "default effects". llvm-svn: 70826
* retain checker: Don't bother using a FoldingSet to unique summaries.Ted Kremenek2009-05-041-24/+3
| | | | | | | We never compare summaries by their pointers, and we create only a handful of them when analyzing a given function. llvm-svn: 70824
* Fix: <rdar://problem/6850275> CF objects returned from methods with "new" or ↵Ted Kremenek2009-05-031-13/+33
| | | | | | | | | "copy" in their name should be treated as owned For methods that follow the "fundamental rule" and return Core Foundation objects, treat those objects as owned by the caller. llvm-svn: 70665
* Convert ArgEffects from an std::vector to an ImmutableMap. This will make ↵Ted Kremenek2009-05-031-117/+59
| | | | | | it much easier to clean up the summary generation logic with annotations. llvm-svn: 70660
* Rename isTrackedObjectType() -> isTrackedObjCObjectType().Ted Kremenek2009-05-031-4/+4
| | | | llvm-svn: 70657
* retain/release checker: Enhance leak description to say that the bugTed Kremenek2009-05-021-1/+5
| | | | | | occurs in GC mode. llvm-svn: 70638
* retain/release checker: Hook up attributes 'objc_ownership_retain' andTed Kremenek2009-04-301-10/+20
| | | | | | 'objc_ownership_release' to the effects on receivers. llvm-svn: 70507
* Handle case in EvalReturn where we cache out in the ExplodedGraph.Ted Kremenek2009-04-301-7/+11
| | | | llvm-svn: 70475
* retain/release checker: Use the ObjCMethodDecl in the @implementation if noTed Kremenek2009-04-301-2/+4
| | | | | | matching ObjCMethodDecl exists in the @interface. llvm-svn: 70474
* retain/release checker: Resolve method decl in @interface after getting theTed Kremenek2009-04-301-3/+4
| | | | | | ObjCInterfaceDecl, not before. llvm-svn: 70473
* retain/release checker: When determining whether an analyzed method can returnTed Kremenek2009-04-291-30/+45
| | | | | | | an owned object, consult its summary instead of inspecting the selector. This picks up annotations, and is just more general. llvm-svn: 70429
* Format cleanup. No functionality change.Ted Kremenek2009-04-291-3/+2
| | | | llvm-svn: 70420
* Reformat long line. No functionality change.Ted Kremenek2009-04-291-3/+2
| | | | llvm-svn: 70412
* retain/release checker: Hoist code for bug reports above transfer function logicTed Kremenek2009-04-291-681/+695
| | | | | | | (those diffs are just code moving) and move the logic for "return of owned object" leak reporting to EvalReturnStmt. llvm-svn: 70399
* Add version of getMethodSummary() that can be used to query the summary for theTed Kremenek2009-04-291-0/+14
| | | | | | method currently being analyzed. llvm-svn: 70388
* Rename getMethodSummary() -> getInstanceMethodSummary().Ted Kremenek2009-04-291-7/+11
| | | | llvm-svn: 70387
* retain/release checker: Refactor getMethodSummary() to not depend on ↵Ted Kremenek2009-04-291-33/+35
| | | | | | ObjCMessageExpr. llvm-svn: 70369
* As discussed with Ted offline, re-apply r70293.Zhongxing Xu2009-04-291-8/+1
| | | | llvm-svn: 70358
* retain/release checker: Refactor the guts of getClassMethodSummary to not dependTed Kremenek2009-04-291-15/+27
| | | | | | | on ObjCMessageExpr. This will enable us to use it elsewhere. This should not change any functionality. llvm-svn: 70352
* Implement ownership attribute 'objc_ownership_make_collectable'. This allows oneTed Kremenek2009-04-281-0/+4
| | | | | | to add 'CFMakeCollectable' semantics to a method. llvm-svn: 70336
* Revert 70293.Ted Kremenek2009-04-281-0/+7
| | | | llvm-svn: 70313
* Now we can remove the 'blast-through' code.Zhongxing Xu2009-04-281-7/+0
| | | | llvm-svn: 70293
* Add two new checker-specific attributes: 'objc_ownership_release' andTed Kremenek2009-04-271-1/+9
| | | | | | | 'objc_ownership_cfrelease'. These are the 'release' equivalents of 'objc_ownership_retain' and 'objc_ownership_cfretain' respectively. llvm-svn: 70235
* Track objects in GC mode returned by 'alloc', 'new', etc. methods. These areTed Kremenek2009-04-271-7/+13
| | | | | | treated as "not owned" objects. llvm-svn: 70232
* Add new checker-specific attribute 'objc_ownership_cfretain'. This is the sameTed Kremenek2009-04-271-1/+5
| | | | | | | | 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). llvm-svn: 70218
* Implement function-try-blocks. However, there's a very subtle bug that I ↵Sebastian Redl2009-04-261-4/+4
| | | | | | can't track down. llvm-svn: 70155
* Hook up attribute 'objc_ownership_retain' to the analyzer. This attribute allowsTed Kremenek2009-04-251-1/+12
| | | | | | | users to specify that a method's argument is visibly retained (reference count incremented). llvm-svn: 70008
* Hook up __attribute__((objc_ownership_returns)) to the retain/release checker.Ted Kremenek2009-04-241-7/+48
| | | | llvm-svn: 70002
* Fix the same false positive reported in PR 2542 and <rdar://problem/6793409>Ted Kremenek2009-04-241-5/+19
| | | | | | involving an NSAnimation object delegating its release to a delegate method. llvm-svn: 69992
* Minor refactoring: pass selector to getCommonMethodSummary(). No functionalityTed Kremenek2009-04-241-9/+7
| | | | | | change. llvm-svn: 69985
* retain/release checker: more hacks to workaround false positives cause byTed Kremenek2009-04-241-2/+21
| | | | | | | delegates. When a reference counted object is passed as to a 'void*' argument to a method stop tracking the reference count. llvm-svn: 69984
* Sentence case bug name.Ted Kremenek2009-04-241-1/+1
| | | | llvm-svn: 69983
* retain/release checker:Ted Kremenek2009-04-241-21/+68
| | | | | | | | | | | - 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. llvm-svn: 69982
* Refactor common logic in getMethodSummary() and getClassMethodSummary(). NoTed Kremenek2009-04-231-30/+24
| | | | | | functionality change. llvm-svn: 69936
* Further cleanups to isTrackedObjectType().Ted Kremenek2009-04-231-6/+10
| | | | llvm-svn: 69929
* retain/release checker: Don't call isTrackedObject() with the canonical type.Ted Kremenek2009-04-231-9/+7
| | | | | | This was preventing the checker from tracking return objects referenced by 'id'. llvm-svn: 69922
* retain/release checker: For class methods, only treat return values that areTed Kremenek2009-04-231-5/+13
| | | | | | object references as tracked objects. llvm-svn: 69915
* Per discussions with Ken Ferry and Paul Marks (<rdar://problem/6815234>) greatlyTed Kremenek2009-04-231-12/+24
| | | | | | | | 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. llvm-svn: 69908
* get a CodeTextRegion when visiting FunctionDecl reference.Zhongxing Xu2009-04-201-10/+10
| | | | | | get FunctionDecl with more general utility method. llvm-svn: 69570
OpenPOWER on IntegriCloud