summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix: <rdar://problem/6945561> -[CIContext createCGLayerWithSize:info:] ↵Ted Kremenek2009-06-151-2/+5
| | | | | | misinterpreted by clang scan-build llvm-svn: 73415
* Fix: <rdar://problem/6961230> add knowledge of IOKit functions to ↵Ted Kremenek2009-06-151-3/+57
| | | | | | retain/release checker llvm-svn: 73411
* Add summary lookup for IOServiceGetMatchingService.Ted Kremenek2009-06-111-37/+48
| | | | | | Convert tabs to spaces. llvm-svn: 73198
* Refactor some function name -> summary lookup using a switch statement.Ted Kremenek2009-06-111-18/+25
| | | | llvm-svn: 73197
* Fix:Ted Kremenek2009-06-051-5/+9
| | | | | | <rdar://problem/6948053> False positive: object substitution during -init* methods warns about returning +0 when using -fobjc-gc-only llvm-svn: 72971
* Enhance attribute cf_returns_retained to also work (in the analyzer)Ted Kremenek2009-06-051-2/+9
| | | | | | | for non-Objctive-C pointer types. This implicitly documents that the return type is a CF object reference. llvm-svn: 72968
* Add special cases to retain checker for 'create' methods in QCView, ↵Ted Kremenek2009-05-201-4/+16
| | | | | | | | | | QCRenderer, and CIContext (Apple APIs). This fixes: <rdar://problem/6902710> clang: false positives w/QC and CoreImage methods. llvm-svn: 72187
* Fix PR 4230: Don't flag leaks of NSAutoreleasePools until we know that we ↵Ted Kremenek2009-05-181-0/+4
| | | | | | 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-19/+28
| | | | | | 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-12/+16
| | | | | | selector slot has a null IdentifierInfo*. This happens when analyzing Growl. llvm-svn: 71857
* Remove extra whitespace character in string literal. Purely cosmetic.Ted Kremenek2009-05-151-1/+1
| | | | llvm-svn: 71847
* Fix <rdar://problem/6859457> [NSData dataWithBytesNoCopy] does not return a ↵Ted Kremenek2009-05-141-0/+9
| | | | | | retained object. llvm-svn: 71797
* Fix crasher reported in PR 4209 caused by an invalid summaryTed Kremenek2009-05-131-4/+16
| | | | | | | | generation when EvalObjCMessageExpr() did not resolve the ObjCInterfaceDecl* for a receiver when the receiver's symbolic value wasn't being explicitly tracked. llvm-svn: 71685
* Fix crasher in CFRefCount.cpp reported by Nikita Zhuk due to recently added ↵Ted Kremenek2009-05-131-2/+5
| | | | | | autorelease tracking. llvm-svn: 71647
* Fix: <rdar://problem/6320065> false positive - init method returns an object ↵Ted Kremenek2009-05-121-22/+46
| | | | | | | | | 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
* Add logic for invalidating array region to CFRefCount.cpp. When invalidatingZhongxing Xu2009-05-121-11/+19
| | | | | | | | | array region, set its default value to conjured symbol. When retrieving its element, create new region value symbol for the element. Also fix some 80 columns violations. llvm-svn: 71548
* Fix <rdar://problem/6877235> Classes typedef-ed to CF objects should get the ↵Ted Kremenek2009-05-121-3/+11
| | | | | | | | same treatment as CF objects This was accomplished by having 'isTypeRef' recursively walk the typedef stack. llvm-svn: 71538
* When stripping element regions for invalidating region values, treat ↵Ted Kremenek2009-05-111-4/+7
| | | | | | FieldRegions and ObjCIvarRegions as "base" regions in addition to VarRegions. llvm-svn: 71488
* Fix regression reported in <rdar://problem/6866843>. The analyzer should ↵Ted Kremenek2009-05-111-2/+2
| | | | | | extend the lifetime of an object stored to a container. llvm-svn: 71452
* Fix a bug found by Thomas Clement where 'return [[[NSString alloc] init] ↵Ted Kremenek2009-05-111-2/+10
| | | | | | autorelease]' would emit a false 'too many overreleases' error. llvm-svn: 71432
* TypedRegion is a too general assumption. Usually we only want to invalidateZhongxing Xu2009-05-111-3/+3
| | | | | | the VarRegion as a super region of an ElementRegion. llvm-svn: 71431
* Add special warning about returning a retained object where a GC'ed object ↵Ted Kremenek2009-05-101-5/+7
| | | | | | is expected. llvm-svn: 71397
* retain/release checker: Flag a warning for non-owned objects returnedTed Kremenek2009-05-101-13/+85
| | | | | | | | 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-33/+48
| | | | | | | | - Improve -autorelease diagnostics. - Improve VLA diagnostics. - Use "short description" for bug when outputting to TextDiagnostics llvm-svn: 71383
* As discussed with Ted, rename TypedRegion::getObjectType() to Zhongxing Xu2009-05-091-1/+1
| | | | | | TypedRegion::getValueType(). llvm-svn: 71321
* Add back analyzer support for ns_returns_retained and cf_returns_retained.Ted Kremenek2009-05-091-1/+51
| | | | llvm-svn: 71309
* It lives! The retain/release checker now tracks objects that are sentTed Kremenek2009-05-091-4/+5
| | | | | | 'autorelease'. llvm-svn: 71307
* rename: MemRegion:Zhongxing Xu2009-05-091-1/+1
| | | | | | | | | RValueType => ObjectType LValueType => LocationType No functionality change. llvm-svn: 71304
* More hacking on autorelease errors. We now can emit basic errors (disabled forTed Kremenek2009-05-091-3/+14
| | | | | | now until ready). llvm-svn: 71303
* Put most of the boilerplate logic in place for reporting autorelease errors.Ted Kremenek2009-05-091-19/+82
| | | | llvm-svn: 71301
* retain/release checker: Add stub for HandleAutoreleaseCounts.Ted Kremenek2009-05-081-9/+56
| | | | llvm-svn: 71290
* retain/release checker: Refactor error-reporting code in EvalDeadSymbols andTed Kremenek2009-05-081-108/+98
| | | | | | EvalEndPath. This sets the stage for handling autorelease counts. llvm-svn: 71283
* retain checker: Track the number of times a tracked object is sentTed Kremenek2009-05-081-15/+37
| | | | | | 'autorelease'. This isn't used yet to flag errors. llvm-svn: 71244
* Remove experimental ownership attributes from Clang.Ted Kremenek2009-05-081-93/+0
| | | | llvm-svn: 71216
* Minor code cleanup in retain/release checker in preparation for someTed Kremenek2009-05-071-22/+14
| | | | | | | other changes. Instead of repeatedly checking for GC mode when getting the return effect, just do this computation once. llvm-svn: 71193
* 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
OpenPOWER on IntegriCloud