summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/retain-release.m
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix PR 4230: Don't flag leaks of NSAutoreleasePools until we know that we ↵Ted Kremenek2009-05-181-0/+12
| | | | | | aren' at the top-most scope of autorelease pools. llvm-svn: 72065
* Fix: <rdar://problem/6893565> False positive: don't flag leaks for return ↵Ted Kremenek2009-05-161-0/+19
| | | | | | types that cannot be determined to be CF types llvm-svn: 71921
* Fix crash when deriving the enclosing summary of a method whose first ↵Ted Kremenek2009-05-151-0/+13
| | | | | | selector slot has a null IdentifierInfo*. This happens when analyzing Growl. llvm-svn: 71857
* Fix <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a ↵Ted Kremenek2009-05-141-0/+26
| | | | | | retained object. llvm-svn: 71797
* Add some basic type checking for attributes ns_returns_retained andTed Kremenek2009-05-131-2/+8
| | | | | | | | | | | | | | cf_returns_retained. Currently this attribute can now be applied to any Objective-C method or C function that returns a pointer or Objective-C object type. Modify the tablegen definition of diagnostic 'warn_attribute_wrong_decl_type' to expect that the diagnostics infrastructure will add quotes around the attribute name when appropriate. Alonq with this change, I modified the places where this warning is issued to passed the attribute's IdentifierInfo* instead of having a hard-coded C constant string. llvm-svn: 71718
* Fix: <rdar://problem/6320065> false positive - init method returns an object ↵Ted Kremenek2009-05-121-0/+43
| | | | | | | | | owned by caller Now 'init' methods are treated by the retain/release checker as claiming their receiver and allocating a new object. llvm-svn: 71579
* Fix <rdar://problem/6877235> Classes typedef-ed to CF objects should get the ↵Ted Kremenek2009-05-121-0/+21
| | | | | | | | same treatment as CF objects This was accomplished by having 'isTypeRef' recursively walk the typedef stack. llvm-svn: 71538
* Fix regression reported in <rdar://problem/6866843>. The analyzer should ↵Ted Kremenek2009-05-111-2/+19
| | | | | | extend the lifetime of an object stored to a container. llvm-svn: 71452
* Add test case for <rdar://problem/6257780>.Ted Kremenek2009-05-111-0/+23
| | | | llvm-svn: 71444
* retain/release checker: Flag a warning for non-owned objects returnedTed Kremenek2009-05-101-0/+13
| | | | | | | | where an owned one is expected. Also add preliminary checking for returning a positive retain count object in GC mode where an owned GC object is expected. llvm-svn: 71388
* analyzer:Ted Kremenek2009-05-101-3/+3
| | | | | | | | - Improve -autorelease diagnostics. - Improve VLA diagnostics. - Use "short description" for bug when outputting to TextDiagnostics llvm-svn: 71383
* Add back test cases for ns_returns_retained and cf_returns_retained.Ted Kremenek2009-05-091-0/+17
| | | | llvm-svn: 71312
* It lives! The retain/release checker now tracks objects that are sentTed Kremenek2009-05-091-1/+23
| | | | | | 'autorelease'. llvm-svn: 71307
* Remove experimental ownership attributes from Clang.Ted Kremenek2009-05-081-133/+0
| | | | llvm-svn: 71216
* More attribute renaming:Ted Kremenek2009-05-071-5/+5
| | | | | | | - Rename 'ns_returns_owned' -> 'ns_returns_retained'. - Rename 'cf_returns_owned' -> 'cf_returns_retained'. llvm-svn: 71182
* Implement attribute 'ns_autorelease'.Ted Kremenek2009-05-051-0/+11
| | | | llvm-svn: 70990
* Enhance ownership attribute tests with functions that use the attributes!Ted Kremenek2009-05-051-0/+16
| | | | llvm-svn: 70984
* Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').Ted Kremenek2009-05-051-0/+11
| | | | llvm-svn: 70952
* Rename ownership attributes:Ted Kremenek2009-05-051-9/+8
| | | | | | | | | | ns_ownership_returns -> ns_returns_owned ns_ownership_retain -> ns_retains ns_ownership_release -> ns_releases cf_ownership_retain -> cf_retains cf_ownership_release -> cf_releases llvm-svn: 70949
* Rename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.Ted Kremenek2009-05-041-2/+2
| | | | llvm-svn: 70941
* Rename attributes 'objc_ownership...' to 'ns_ownership...'.Ted Kremenek2009-05-041-6/+6
| | | | 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
* Remove support for ObjCMethodDecl attributes that appear between theTed Kremenek2009-05-041-5/+1
| | | | | | | | return type and the selector. This is inconsistent with C functions (where such attributes would be placed on the return type, not the the FunctionDecl), and is inconsistent with what people are use to seeing. llvm-svn: 70878
* retain/release checker: Hook up attributes 'objc_ownership_retain' andTed Kremenek2009-04-301-0/+15
| | | | | | 'objc_ownership_release' to the effects on receivers. llvm-svn: 70507
* Allow attributes 'objc_ownership_retain' and 'objc_ownership_release' to beTed Kremenek2009-04-301-0/+3
| | | | | | | applied to ObjCMethodDecls, not just parameters. This allows one to specific side-effects on the receiver of a message expression. No checker support yet. llvm-svn: 70505
* Hook up Sema support for attributes on Objective-C method declarations thatTed Kremenek2009-04-301-5/+4
| | | | | | | | | | | | | appear between the return type and the selector. This is a separate code path from regular attribute processing, as we only want to (a) accept only a specific set of attributes in this place and (b) want to distinguish to clients the context in which an attribute was added to an ObjCMethodDecl. Currently, the attribute 'objc_ownership_returns' is the only attribute that uses this new feature. Shortly I will add a warning for 'objc_ownership_returns' to be placed at the end of a method declaration. llvm-svn: 70504
* Add parsing support in an Objective-C method declaration for attributes betweenTed Kremenek2009-04-301-0/+5
| | | | | | the return type and selector. Haven't hooked this up to Sema yet. llvm-svn: 70501
* retain/release checker: When determining whether an analyzed method can returnTed Kremenek2009-04-291-1/+4
| | | | | | | an owned object, consult its summary instead of inspecting the selector. This picks up annotations, and is just more general. llvm-svn: 70429
* retain/release checker: Hoist code for bug reports above transfer function logicTed Kremenek2009-04-291-0/+11
| | | | | | | (those diffs are just code moving) and move the logic for "return of owned object" leak reporting to EvalReturnStmt. llvm-svn: 70399
* Add regression test case provided by <rdar://problem/6833332>.Ted Kremenek2009-04-291-29/+77
| | | | llvm-svn: 70350
* Improve retain/release test cases for ownership attributes.Ted Kremenek2009-04-281-2/+26
| | | | llvm-svn: 70327
* Add two new checker-specific attributes: 'objc_ownership_release' andTed Kremenek2009-04-271-0/+14
| | | | | | | 'objc_ownership_cfrelease'. These are the 'release' equivalents of 'objc_ownership_retain' and 'objc_ownership_cfretain' respectively. llvm-svn: 70235
* Add new checker-specific attribute 'objc_ownership_cfretain'. This is the sameTed Kremenek2009-04-271-0/+6
| | | | | | | | 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
* Hook up attribute 'objc_ownership_retain' to the analyzer. This attribute allowsTed Kremenek2009-04-251-2/+2
| | | | | | | users to specify that a method's argument is visibly retained (reference count incremented). llvm-svn: 70008
* Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked upTed Kremenek2009-04-251-0/+8
| | | | | | | | to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function increments the reference count of a passed object. llvm-svn: 70005
* Hook up __attribute__((objc_ownership_returns)) to the retain/release checker.Ted Kremenek2009-04-241-1/+1
| | | | llvm-svn: 70002
* Add new checker-specific attribute 'objc_ownership_returns'. This isn't hookedTed Kremenek2009-04-241-0/+12
| | | | | | | up to the checker yet, but essentially it allows a user to specify that an Objective-C method or C function returns an owned an Objective-C object. llvm-svn: 70001
* retain/release checker: Don't call isTrackedObject() with the canonical type.Ted Kremenek2009-04-231-1/+1
| | | | | | This was preventing the checker from tracking return objects referenced by 'id'. llvm-svn: 69922
* Temporarily remove expected warnings.Ted Kremenek2009-04-231-1/+1
| | | | llvm-svn: 69917
* Per discussions with Ken Ferry and Paul Marks (<rdar://problem/6815234>) greatlyTed Kremenek2009-04-231-1/+1
| | | | | | | | 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
* Add test case.Ted Kremenek2009-04-071-0/+11
| | | | llvm-svn: 68505
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-2/+2
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* analyzer: Provide temporary workaround for false positive reported byTed Kremenek2009-03-231-2/+36
| | | | | | | <rdar://problem/6704930> involving SimpleConstraintManager not reasoning well about symbolic constraint values involving arithmetic operators. llvm-svn: 67534
* Add test cases for PR 3820.Ted Kremenek2009-03-191-0/+26
| | | | llvm-svn: 67327
* Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowedTed Kremenek2009-03-131-2/+12
| | | | | | to return an owning pointer. llvm-svn: 66934
* retain/release checker: Allow allocations to fail by returning nil.Ted Kremenek2009-03-091-4/+3
| | | | llvm-svn: 66487
* Add test case for <rdar://problem/6659160>.Ted Kremenek2009-03-091-7/+74
| | | | llvm-svn: 66483
* Update test case: objects stored to self.ivar are not tracked.Ted Kremenek2009-03-051-0/+17
| | | | llvm-svn: 66168
* Update test case to include a leak that occurs at the place of allocation.Ted Kremenek2009-02-191-1/+5
| | | | llvm-svn: 65048
* Static Analyzer driver/options (partial) cleanup:Ted Kremenek2009-02-171-1/+1
| | | | | | | | | | | | | | - Move all analyzer options logic to AnalysisConsumer.cpp. - Unified specification of stores/constraints/output to be: -analyzer-output=... -analyzer-store=... -analyzer-constraints=... instead of -analyzer-range-constraints, -analyzer-store-basic, etc. - Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new interface - Updated test cases to conform to new driver options llvm-svn: 64737
OpenPOWER on IntegriCloud