aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core
AgeCommit message (Collapse)Author
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] 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] 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] 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-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-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
2011-08-21[analyzer] Remove FIXME; Ted reminded me that -init is not guaranteed to ↵Jordy Rose
return its receiver and pretending that it does won't actually buy us anything. (Comment change only.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-21[analyzer] Migrate return value handling from CFRefCount to ExprEngine. This ↵Jordy Rose
seems to result in a minor performance hit, but I think that will go away again once we eliminate TransferFuncs from function calls entirely. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138220 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-21[analyzer] Replace calls to getNameAsString() with StringRef equivalents.Jordy Rose
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138215 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20[analyzer] RetainReleaseChecker always wants region change updates. There's ↵Jordy Rose
no need for a flag, at least not right now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138212 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Fix indentation.Jordy Rose
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138211 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20[analyzer] Move handling of hardcoded noreturn ("panic") methods from ↵Jordy Rose
CFRefCount to NoReturnFunctionChecker. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20[analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. ↵Ted Kremenek
No need to bind an explicit value and create a new node. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20[analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive ↵Ted Kremenek
visit to subexpressions (which is no longer needed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138195 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Start partitioning ExprEngine.cpp into separate .cpp files that handle ↵Ted Kremenek
different parts of the analysis (e.g., analysis of C expressions, analysis of Objective-C expressions, and so on). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138194 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20Static Analyzer Diagnostics: Move the responsibility for generating the ↵Anna Zaks
endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138184 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. ↵Anna Zaks
BugReport no longer needs to inherit from BugReporterVisitor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138142 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) ↵Anna Zaks
API in favor of addVisitor(BugReporterVisitor*). 1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well. 2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor. 3) Modify all the checkers to use the new API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138126 91177308-0d34-0410-b5e6-96231b3b80d8