aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer
AgeCommit message (Collapse)Author
2011-08-27[analyzer] Change the check::RegionChanges callback to include the regions ↵Jordy Rose
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138716 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-27[analyzer] Rename current PathDiagnosticClient::HandlePathDiagnostic() to ↵Ted Kremenek
HandlePathDiagnosticImpl(), and slot in new HandlePathDiagnostic() for potentially handling concurrent access to PathDiagnosticClients (in the future). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138713 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-27[analyzer] Pull body of loop in AnalysisConsumer::HandleDeclContext() into ↵Ted Kremenek
its own method. No real functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138712 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26[analyzer] Remove a couple of unnecessary returns after llvm_unreachables.Jordy Rose
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138649 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26Handle CXXTempObjectRegion in StackAddrEscapeChecker.Jeffrey Yasskin
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138613 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25[analyzer] Move the leak bugs from CFRefCount to RetainReleaseChecker, with ↵Jordy Rose
a level of indirection to handle GC vs. non-GC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25[analyzer] MacOSKeychainAPIChecker: Cleanup AllocationState structure.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138535 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25[analyzer] Move the easy bug types from CFRefCount to RetainReleaseChecker.Jordy Rose
(These bug types may have just been leaked before...!) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25[analyzer] MacOSKeychainAPIChecker: Add the custom BugReport visitor(which ↵Anna Zaks
highlights the allocation site) to all the relevant reports within the checker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138531 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25[analyzer] Move the RetainSummaryManager from CFRefCount to ↵Jordy Rose
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138529 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Better fix for the "missing return" error, from Ted.Jordy Rose
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Silence another incorrect warning ("control reaches end of ↵Jordy Rose
non-void function") git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Remove experimental FIXME that never actually applied to the code ↵Jordy Rose
in trunk. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138508 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] CFRefReport and friends no longer depend on CFRefCount.Jordy Rose
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138506 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Do not use references in std::pair.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138497 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Unbreak the release buildbot.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138493 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] MacOSKeychainAPIChecker: Provide reacher diagnostic trace by ↵Anna Zaks
pointing to the allocation site when reporting a leak. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138479 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Silence an (incorrect) uninitialized variable warning, caught by ↵Jordy Rose
Cameron. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138477 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Copy GC mode setting from CFRefCount to RetainReleaseChecker in ↵Jordy Rose
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138476 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Allow checker writes to specify that no region should be ↵Anna Zaks
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.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138474 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Remove unused DoNothingByRef and the special case for ↵Jordy Rose
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138464 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Slightly clean up the fix in 138432, so that it doesn't depend on ↵Jordy Rose
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138462 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Fix a Heisenbug concerning object lifetimes with a hack. ↵Jordy Rose
Hopefully a better fix coming soon. See comment for more details. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138432 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Reapply 138390 "Clean up unused bits of CFRefCount", reverted in ↵Jordy Rose
138405. Ended up unrelated to any problems. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Fix potential crasher with RAII. No functionality change. (No ↵Jordy Rose
test because this particular circumstance requires an impossible series of events, but this is future-proofing.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138430 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Reapply 138382 and 138388 (reverted in 138419 and 138420). The ↵Jordy Rose
issue seems to have been with the uninitialized variable fixed in 138424; a fix for another Heisencrasher coming soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138426 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] Correctly initialize a variable and hopefully fix crashes.Jordy Rose
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138424 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24Revert "[analyzer] Cleanup: Move temporary declarations of CFRefCount ↵Eric Christopher
variables closer to their uses. No functionality change." This reverts commit d02b4af7bd6ca4a743c7074d64e205d718aa221d. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138420 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24Revert "[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on ↵Eric Christopher
CFRefCount. Unfortunately, CFRefReport still is. No functionality change." This reverts commit e3fb7e428b7ba0d5d902dfe3f165d70e09b03a15. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138419 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24[analyzer] MacOSKeychainAPIChecker: Add reasoning about functions which ↵Anna Zaks
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138417 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] MacOSKeychainAPIChecker: Retrieve the memory region which we are ↵Anna Zaks
tracking even when it's no longer a SymbolicRegion, for example, when it is cast to char*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138415 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23Move creation of the deallocation mismatch report into a separate function ↵Anna Zaks
for future reuse. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23Constify the result of CFGStmt::getStmt().Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23Revert "[analyzer] Clean up unused bits of CFRefCount."Eric Christopher
This reverts commit 6886a92640f5bffc972f67c0a1f302d6c6e7c322. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138405 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Clean up unused bits of CFRefCount.Jordy Rose
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. ↵Jordy Rose
Unfortunately, CFRefReport still is. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138388 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Cleanup: Move temporary declarations of CFRefCount variables ↵Jordy Rose
closer to their uses. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138382 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Move function retain-count effect summary log from CFRefCount to ↵Jordy Rose
RetainReleaseChecker, and then explicitly provide the summary log when creating CFRefReports. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138374 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23Fix regression in -Wuninitialized involving VLAs. It turns out that we were ↵Ted Kremenek
modeling sizeof(VLAs) incorrectly in the CFG, and also the static analyzer. This patch regresses the analyzer a bit, but that needs to be followed up with a better solution. Fixes <rdar://problem/10008112>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138372 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Move helper method Update from CFRefCount to ↵Jordy Rose
RetainReleaseChecker. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Move helper method handleAutoreleaseCounts from CFRefCount to ↵Jordy Rose
RetainReleaseChecker. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138365 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Move ReturnStmt retain-count analysis from CFRefCount to ↵Jordy Rose
RetainReleaseChecker. Tweak CFRefReport to reflect that fact that ReturnStmt checks are pre-statement, not post-statement. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138358 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Move symbol death leak analysis from CFRefCount to ↵Jordy Rose
RetainReleaseChecker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138353 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Only allocate retain summaries for interesting ↵Jordy Rose
functions/messages. This is a minor saving of memory but doesn't seem to cost any performance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138320 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23[analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessage, ↵Jordy Rose
since it no longer, uh, evaluates call summaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138313 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22[analyzer] Migrate the handling of retain-count-related RetEffects and ↵Jordy Rose
ArgEffects from CFRefCount to RetainReleaseChecker. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138309 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22[analyzer] MacOSKeychainAPIChecker: Users of KeyChain API often use free() ↵Anna Zaks
to deallocate the password. Catch this error explicitly and generate the error message at the place where free() is called. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138296 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22Static Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveText, now ↵Anna Zaks
renamed into ExtraText, to the diagnostic without subclassing BugReport. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22Clean up the CFRefBugReport - remove the members, which got moved to the ↵Anna Zaks
CFRefReportVisitors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138259 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-21[analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable ↵Jordy Rose
from CFRefCount to RetainReleaseChecker. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138223 91177308-0d34-0410-b5e6-96231b3b80d8