summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Move RetainReleaseChecker to the Checkers library and rename it ↵Jordy Rose2011-09-021-3648/+0
| | | | | | to RetainCountChecker...and clean up the file while I'm at it. llvm-svn: 139002
* [analyzer] Move the knowledge of whether or not GC is enabled for the ↵Jordy Rose2011-09-021-86/+87
| | | | | | | | | | current analysis from CFRefCount to ExprEngine. Remove TransferFuncs from ExprEngine and AnalysisConsumer. Demote RetainReleaseChecker to a regular checker, and give it the name osx.cocoa.RetainCount (class name change coming shortly). Update tests accordingly. llvm-svn: 138998
* [analyzer] Introduce a new callback for checkers, printState, to be used for ↵Jordy Rose2011-08-281-57/+60
| | | | | | | | | | debug-printing the contents of a ProgramState. Unlike the other callbacks, this one is a simple virtual method, since it is only to be used for debugging. This new callback replaces the old ProgramState::Printer interface, and allows us to move the printing of refcount bindings from CFRefCount to RetainReleaseChecker. llvm-svn: 138728
* [analyzer] Migrate argument invalidation from CFRefCount to ExprEngine.Jordy Rose2011-08-281-202/+9
| | | | | | | | This is a common path for function and C++ method calls, Objective-C messages and property accesses, and C++ construct-exprs. As support, add message receiver accessors to ObjCMessage and CallOrObjCMessage. llvm-svn: 138718
* [analyzer] Change the check::RegionChanges callback to include the regions ↵Jordy Rose2011-08-271-40/+37
| | | | | | | | | | explicitly requested for invalidation. Also, allow CallOrObjCMessage to wrap a CXXConstructExpr as well. Finally, this allows us to remove the clunky whitelisting system from CFRefCount/RetainReleaseChecker. Slight regression due to CXXNewExprs not yet being handled in post-statement callbacks (PR forthcoming). llvm-svn: 138716
* [analyzer] Remove a couple of unnecessary returns after llvm_unreachables.Jordy Rose2011-08-261-2/+0
| | | | llvm-svn: 138649
* [analyzer] Move the leak bugs from CFRefCount to RetainReleaseChecker, with ↵Jordy Rose2011-08-251-50/+56
| | | | | | a level of indirection to handle GC vs. non-GC. llvm-svn: 138538
* [analyzer] Move the easy bug types from CFRefCount to RetainReleaseChecker.Jordy Rose2011-08-251-41/+28
| | | | | | (These bug types may have just been leaked before...!) llvm-svn: 138532
* [analyzer] Move the RetainSummaryManager from CFRefCount to ↵Jordy Rose2011-08-251-29/+34
| | | | | | | | RetainReleaseChecker. Because Checkers live for an entire translation unit, this persists summary caches across multiple code bodies and avoids repeated initialization (but probably at the cost of memory). This removes the last references from RetainReleaseChecker to CFRefCount. llvm-svn: 138529
* [analyzer] Better fix for the "missing return" error, from Ted.Jordy Rose2011-08-241-3/+3
| | | | llvm-svn: 138526
* [analyzer] Silence another incorrect warning ("control reaches end of ↵Jordy Rose2011-08-241-0/+3
| | | | | | non-void function") llvm-svn: 138510
* [analyzer] Remove experimental FIXME that never actually applied to the code ↵Jordy Rose2011-08-241-2/+0
| | | | | | in trunk. llvm-svn: 138508
* [analyzer] CFRefReport and friends no longer depend on CFRefCount.Jordy Rose2011-08-241-39/+46
| | | | llvm-svn: 138506
* [analyzer] Silence an (incorrect) uninitialized variable warning, caught by ↵Jordy Rose2011-08-241-1/+2
| | | | | | Cameron. llvm-svn: 138477
* [analyzer] Copy GC mode setting from CFRefCount to RetainReleaseChecker in ↵Jordy Rose2011-08-241-20/+46
| | | | | | | | preparation for getting rid of CFRefCount. This is a little hacky for now but will get better once we decide the best way to handle this. llvm-svn: 138476
* [analyzer] Remove unused DoNothingByRef and the special case for ↵Jordy Rose2011-08-241-13/+2
| | | | | | | | CFDictionaryCreate. This is a very small regression (actually introduced in r138309) because it won't catch leaks of objects passed by reference to CFDictionaryCreate (they're considered to have escaped and are ignored). If this is important we can put in a specific eval::Call to restore the functionality. llvm-svn: 138464
* [analyzer] Slightly clean up the fix in 138432, so that it doesn't depend on ↵Jordy Rose2011-08-241-20/+41
| | | | | | the relative ordering of path-sensitive and path-insensitive checks. Still not ideal, but I think a real fix would require infrastructure that doesn't exist yet. llvm-svn: 138462
* [analyzer] Fix a Heisenbug concerning object lifetimes with a hack. ↵Jordy Rose2011-08-241-1/+26
| | | | | | Hopefully a better fix coming soon. See comment for more details. llvm-svn: 138432
* [analyzer] Reapply 138390 "Clean up unused bits of CFRefCount", reverted in ↵Jordy Rose2011-08-241-11/+1
| | | | | | 138405. Ended up unrelated to any problems. llvm-svn: 138431
* [analyzer] Fix potential crasher with RAII. No functionality change. (No ↵Jordy Rose2011-08-241-38/+50
| | | | | | test because this particular circumstance requires an impossible series of events, but this is future-proofing.) llvm-svn: 138430
* [analyzer] Reapply 138382 and 138388 (reverted in 138419 and 138420). The ↵Jordy Rose2011-08-241-102/+80
| | | | | | issue seems to have been with the uninitialized variable fixed in 138424; a fix for another Heisencrasher coming soon. llvm-svn: 138426
* [analyzer] Correctly initialize a variable and hopefully fix crashes.Jordy Rose2011-08-241-1/+1
| | | | llvm-svn: 138424
* Revert "[analyzer] Cleanup: Move temporary declarations of CFRefCount ↵Eric Christopher2011-08-241-11/+13
| | | | | | | | variables closer to their uses. No functionality change." This reverts commit d02b4af7bd6ca4a743c7074d64e205d718aa221d. llvm-svn: 138420
* Revert "[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on ↵Eric Christopher2011-08-241-69/+89
| | | | | | | | CFRefCount. Unfortunately, CFRefReport still is. No functionality change." This reverts commit e3fb7e428b7ba0d5d902dfe3f165d70e09b03a15. llvm-svn: 138419
* Revert "[analyzer] Clean up unused bits of CFRefCount."Eric Christopher2011-08-231-1/+11
| | | | | | This reverts commit 6886a92640f5bffc972f67c0a1f302d6c6e7c322. llvm-svn: 138405
* [analyzer] Clean up unused bits of CFRefCount.Jordy Rose2011-08-231-11/+1
| | | | llvm-svn: 138390
* [analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. ↵Jordy Rose2011-08-231-89/+69
| | | | | | Unfortunately, CFRefReport still is. No functionality change. llvm-svn: 138388
* [analyzer] Cleanup: Move temporary declarations of CFRefCount variables ↵Jordy Rose2011-08-231-13/+11
| | | | | | closer to their uses. No functionality change. llvm-svn: 138382
* [analyzer] Move function retain-count effect summary log from CFRefCount to ↵Jordy Rose2011-08-231-32/+30
| | | | | | RetainReleaseChecker, and then explicitly provide the summary log when creating CFRefReports. No functionality change. llvm-svn: 138374
* [analyzer] Move helper method Update from CFRefCount to ↵Jordy Rose2011-08-231-147/+155
| | | | | | RetainReleaseChecker. No functionality change. llvm-svn: 138370
* [analyzer] Move helper method handleAutoreleaseCounts from CFRefCount to ↵Jordy Rose2011-08-231-104/+84
| | | | | | RetainReleaseChecker. No functionality change. llvm-svn: 138365
* [analyzer] Move ReturnStmt retain-count analysis from CFRefCount to ↵Jordy Rose2011-08-231-186/+182
| | | | | | RetainReleaseChecker. Tweak CFRefReport to reflect that fact that ReturnStmt checks are pre-statement, not post-statement. No intended functionality change. llvm-svn: 138358
* [analyzer] Move symbol death leak analysis from CFRefCount to ↵Jordy Rose2011-08-231-167/+176
| | | | | | RetainReleaseChecker. llvm-svn: 138353
* [analyzer] Only allocate retain summaries for interesting ↵Jordy Rose2011-08-231-43/+71
| | | | | | functions/messages. This is a minor saving of memory but doesn't seem to cost any performance. llvm-svn: 138320
* [analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessage, ↵Jordy Rose2011-08-231-54/+21
| | | | | | since it no longer, uh, evaluates call summaries. llvm-svn: 138313
* [analyzer] Migrate the handling of retain-count-related RetEffects and ↵Jordy Rose2011-08-221-211/+292
| | | | | | ArgEffects from CFRefCount to RetainReleaseChecker. No intended functionality change. llvm-svn: 138309
* Static Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveText, now ↵Anna Zaks2011-08-221-20/+25
| | | | | | renamed into ExtraText, to the diagnostic without subclassing BugReport. llvm-svn: 138272
* Clean up the CFRefBugReport - remove the members, which got moved to the ↵Anna Zaks2011-08-221-13/+5
| | | | | | CFRefReportVisitors. llvm-svn: 138259
* [analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable ↵Jordy Rose2011-08-211-46/+94
| | | | | | from CFRefCount to RetainReleaseChecker. No intended functionality change. llvm-svn: 138223
* [analyzer] Migrate return value handling from CFRefCount to ExprEngine. This ↵Jordy Rose2011-08-211-60/+28
| | | | | | seems to result in a minor performance hit, but I think that will go away again once we eliminate TransferFuncs from function calls entirely. llvm-svn: 138220
* [analyzer] Replace calls to getNameAsString() with StringRef equivalents.Jordy Rose2011-08-211-3/+2
| | | | llvm-svn: 138215
* [analyzer] RetainReleaseChecker always wants region change updates. There's ↵Jordy Rose2011-08-201-6/+2
| | | | | | no need for a flag, at least not right now. llvm-svn: 138212
* Fix indentation.Jordy Rose2011-08-201-17/+17
| | | | llvm-svn: 138211
* [analyzer] Move handling of hardcoded noreturn ("panic") methods from ↵Jordy Rose2011-08-201-37/+6
| | | | | | CFRefCount to NoReturnFunctionChecker. No functionality change intended. llvm-svn: 138210
* Static Analyzer Diagnostics: Move the responsibility for generating the ↵Anna Zaks2011-08-201-21/+34
| | | | | | endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece. llvm-svn: 138184
* Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. ↵Anna Zaks2011-08-191-12/+33
| | | | | | BugReport no longer needs to inherit from BugReporterVisitor. llvm-svn: 138142
* Static Analyzer Diagnostics: Move custom diagnostic visitors from ↵Anna Zaks2011-08-181-2/+4
| | | | | | | | BugReporterContext to BugReport. One API change: I added BugReporter as an additional parameter to the BugReporterVisitor::VisitNode() method to allow visitors register other visitors with the report on the fly (while processing a node). This functionality is used by NilReceiverVisitor, which registers TrackNullOrUndefValue when the receiver is null. llvm-svn: 138001
* Remove EnhancedBugReport and RangedBugReport - pull all the extra ↵Anna Zaks2011-08-171-7/+7
| | | | | | functionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME. llvm-svn: 137894
* [analyzer] Migrate assumption and binding handling from CFRefCount to ↵Jordy Rose2011-08-171-100/+94
| | | | | | RetainReleaseChecker. This is mostly a textual move and required no supporting changes. No functionality change intended. llvm-svn: 137874
* Fix a handful of dead stores found by Clang's static analyzer. There's a ↵Ted Kremenek2011-08-171-3/+2
| | | | | | bunch of others I haven't touched. llvm-svn: 137867
OpenPOWER on IntegriCloud