summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Remove TransferFuncs.h, then deal with the fallout.Jordy Rose2011-09-0214-6/+12
| | | | | | And with that, TransferFuncs is gone! llvm-svn: 139003
* [analyzer] Move RetainReleaseChecker to the Checkers library and rename it ↵Jordy Rose2011-09-023-256/+208
| | | | | | to RetainCountChecker...and clean up the file while I'm at it. llvm-svn: 139002
* [analyzer] Remove lingering CFRefCount creation, which would have resulted ↵Jordy Rose2011-09-021-12/+3
| | | | | | in a leak. There's room for improvement here... llvm-svn: 139000
* [analyzer] Fix member initialization order. No functionality change.Jordy Rose2011-09-021-1/+1
| | | | llvm-svn: 138999
* [analyzer] Move the knowledge of whether or not GC is enabled for the ↵Jordy Rose2011-09-024-130/+118
| | | | | | | | | | 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
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-023-3/+4
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* If size was equal to 0, either NULL or a pointer suitable to be passed to Zhongxing Xu2011-09-011-5/+2
| | | | | | | | free() is returned by realloc(). Most code expect NULL. And we only need to transfer one final ProgramState. llvm-svn: 138937
* [analyzer] Fix varargs helper to only use POD types even for named ↵Jordy Rose2011-08-311-4/+4
| | | | | | arguments. Thanks, Joerg. llvm-svn: 138875
* [analyzer] MacOSKeychainAPIChecker: Simplify getSymbolForRegion by using ↵Anna Zaks2011-08-291-7/+3
| | | | | | existing API. Thanks Jordy. llvm-svn: 138765
* Fix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement ↵Anna Zaks2011-08-291-1/+1
| | | | | | on the previous commit.) llvm-svn: 138762
* Fix bug 10797: Crash: "cast<Ty>() argument of incompatible type!" assert ↵Anna Zaks2011-08-291-2/+4
| | | | | | | | when analyzing ICU. Patch by Jean-Daniel Dupas. Thanks for spotting and fixing! llvm-svn: 138757
* [analyzer] Introduce a new callback for checkers, printState, to be used for ↵Jordy Rose2011-08-284-76/+87
| | | | | | | | | | 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] Remove the ProgramState argument from ExprEngine::evalBind; we ↵Jordy Rose2011-08-282-10/+5
| | | | | | were ignoring it anyway. No functionality change. llvm-svn: 138720
* [analyzer] Eliminate almost all uses of TransferFuncs from ExprEngine.Jordy Rose2011-08-283-103/+27
| | | | llvm-svn: 138719
* [analyzer] Migrate argument invalidation from CFRefCount to ExprEngine.Jordy Rose2011-08-285-232/+124
| | | | | | | | 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-278-115/+99
| | | | | | | | | | 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] Rename current PathDiagnosticClient::HandlePathDiagnostic() to ↵Ted Kremenek2011-08-274-6/+13
| | | | | | HandlePathDiagnosticImpl(), and slot in new HandlePathDiagnostic() for potentially handling concurrent access to PathDiagnosticClients (in the future). llvm-svn: 138713
* [analyzer] Pull body of loop in AnalysisConsumer::HandleDeclContext() into ↵Ted Kremenek2011-08-271-45/+52
| | | | | | its own method. No real functionality change. llvm-svn: 138712
* [analyzer] Remove a couple of unnecessary returns after llvm_unreachables.Jordy Rose2011-08-261-2/+0
| | | | llvm-svn: 138649
* Handle CXXTempObjectRegion in StackAddrEscapeChecker.Jeffrey Yasskin2011-08-262-1/+7
| | | | | | | | Also convert stack-addr-ps.cpp to use the analyzer instead of just Sema, now that it doesn't crash, and extract the stack-block test into another file since it errors, and that prevents the analyzer from running. llvm-svn: 138613
* [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] MacOSKeychainAPIChecker: Cleanup AllocationState structure.Anna Zaks2011-08-251-11/+10
| | | | llvm-svn: 138535
* [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] MacOSKeychainAPIChecker: Add the custom BugReport visitor(which ↵Anna Zaks2011-08-251-11/+16
| | | | | | highlights the allocation site) to all the relevant reports within the checker. llvm-svn: 138531
* [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] Do not use references in std::pair.Anna Zaks2011-08-241-4/+4
| | | | llvm-svn: 138497
* [analyzer] Unbreak the release buildbot.Anna Zaks2011-08-241-2/+1
| | | | llvm-svn: 138493
* [analyzer] MacOSKeychainAPIChecker: Provide reacher diagnostic trace by ↵Anna Zaks2011-08-241-18/+73
| | | | | | pointing to the allocation site when reporting a leak. llvm-svn: 138479
* [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] Allow checker writes to specify that no region should be ↵Anna Zaks2011-08-241-0/+4
| | | | | | accosiated with the report. (Useful when we report an error on endOfPath or deadSymbols, when the range of the last expression might have nothing to do with the error.) llvm-svn: 138474
* [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
* [analyzer] MacOSKeychainAPIChecker: Add reasoning about functions which ↵Anna Zaks2011-08-241-18/+59
| | | | | | MIGHT deallocate the memory region allocated with SecKeychain APIs. Specifically, when the buffer is passed to CFStringCreateWithBytesNoCopy along with a custom deallocator, which might potentially correctly release the memory. llvm-svn: 138417
* [analyzer] MacOSKeychainAPIChecker: Retrieve the memory region which we are ↵Anna Zaks2011-08-231-2/+8
| | | | | | tracking even when it's no longer a SymbolicRegion, for example, when it is cast to char*. llvm-svn: 138415
* Move creation of the deallocation mismatch report into a separate function ↵Anna Zaks2011-08-231-15/+32
| | | | | | for future reuse. llvm-svn: 138414
* Constify the result of CFGStmt::getStmt().Ted Kremenek2011-08-231-1/+1
| | | | llvm-svn: 138408
* 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
OpenPOWER on IntegriCloud