aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CFRefCount.cpp
AgeCommit message (Collapse)Author
2008-05-02When running the reference count checker twice (GC and non-GC mode), only emitTed Kremenek
basic warnings (dead stores, null dereferences) on the first pass. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50584 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Fix copy-paste bug.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Remove no longer valid assertion.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Added line number diagnostics to indicate the allocation site of the leaked ↵Ted Kremenek
object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Do not highlight bogus ranges for leaks.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50549 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Correctly invalidate reference count state when passing objects by reference ↵Ted Kremenek
in message expressions we don't understand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Renamed static method.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01When processing "release", "retain", and "autorelease" messages return theTed Kremenek
lval passed as an argument. Fix: Inverted diagnostic messages. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01Added support for "autorelease" message in CF ref. count checker.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30added preliminary diagnostics in scan-build results to denote whetherTed Kremenek
a CF memory leak occurred with GC enabled, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30Teach more of the static analyzer about ObjCQualifiedIdType.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50494 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30Teach the static analysis engine about ObjCQualifiedIdType.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50493 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Update typestate logic to support GC-mode.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Implement semantics of CFMakeCollectable for the CF-reference count checker.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50395 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Provide the option to run the CF-retain checker in GC enabled mode.Ted Kremenek
The transfer functions for the checker don't do anything special yet in GC mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25Do a better job at computing dead symbols.Ted Kremenek
Implemented support for better localized leaks in the CF reference count checker. Now leaks should be flagged close to where they occur. This should implement the desired functionality in <rdar://problem/5879592>, although the diagnostics still need to be improved. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50241 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24Add preliminary support for flagging leaks around when they happen (doesn't ↵Ted Kremenek
work yet). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50237 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24CF reference count checker: handle variadic functions that allocate CF objects.Ted Kremenek
This fixes <rdar://problem/5886141>. Part of this change resulted in creating sparser summaries. I also added some more comments and did some minor code cleanups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50214 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23Fixed: <rdar://problem/5881148>Ted Kremenek
Problem: In the recently refactored VisitDeref (which processes dereferences), we were incorrectly skipping the node just generated for the subexpression of the dereference. This was a horrible regression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50176 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22Added lval type (and tracking) for StringLiterals.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Generalize caching mechanism for bugs reports. Now individual BugTypesTed Kremenek
can decide the policy on how to cache related bugs. This allows us to properly to handle warning about multiple leaks in the same location in the ref count checker (not yet done). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49918 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Added "GetErrorNodes()" to BugType so that -trim-egraph can recognize errorsTed Kremenek
from registered BugTypes. This helps with debugging. Add detection of NULL values in ref count checker; this suppresses false positives. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49912 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Fixed bug in GREndPathNodeBuilder: only return a node if it wasn't in the ↵Ted Kremenek
node cache. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18More grammar fixes.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Fix plurality debacle.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49894 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Added path diagnostics for reference counts.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18BugReport::VisitNode now takes BugReporter& instead of ASTContext&.Ted Kremenek
Shuffled around code in CFRefCount to better pair classes with implementation, and started adding subclasses of RangedBugReport to handle better diagnostics for reference count bugs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Simplified internal logic of BugReporter, consolidating EmitWarning andTed Kremenek
EmitPathWarning into one method. We now properly handle emitting warnings without a PathDiagnosticClient when the warning does not involve a particular statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17Hook up reporting reference count memory leaks to the BugReporter mechanism.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49879 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17Added transfer function support for ReturnStmt to support detecting leaksTed Kremenek
involving objects that are returned but have an excessive reference count. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16CF ref. count checker: Register memory leaks at the end of a path.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16Small tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV toTed Kremenek
represent possible stores to "Unknown." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49811 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16Implemented toll-free bridging support for CF Reference count checker.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49771 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Added initial boilerplate to support toll-free bridging in the ref-count ↵Ted Kremenek
checker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14Treat calls to unresolved functions in the CF-ref count checker as callsTed Kremenek
to functions with NULL summaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49660 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14Hooked up the dead-store checker to the BugReporter interface. Now dead-storeTed Kremenek
warnings are emitted as part of the warnings registered by GRSimpleVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Add some boilerplate to report memory leaks at the end of an analyzed function.Ted Kremenek
Still need some boilerplate in BugReporter to report bugs at the end of a function (not associated with a particular statement). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49564 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Added FIXMETed Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49558 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Fix regression introduced by my last commit.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Changed behavior of how we handle "NULL" summaries: just callTed Kremenek
GRSimpleVals::EvalCal(), and don't change reference counts. Remove "getDoNothingSummary()", as a NULL summary does the same thing. Added temporary hack for the "Get" rule for objects that return a pointer type: treat them as non-owned CF objects. Added test case to detect the release of a non-owned object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49555 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Use RangedBugReport to report better ranges for reference count errors.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10Fixed some logic errors in the CF ref count checker; we now can detect simpleTed Kremenek
use-after-release errors. Added test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49509 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10Simplify CF ref. count checker state machine.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10Fix some bonehead bugs in summary generation in CFRefCount.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10Refactored all logic to run the GRSimpleVals and CFRef checker into a commonTed Kremenek
code path in the clang driver. Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10CFRefCount analysis now properly calls "EmitWarnings" after analyzing a ↵Ted Kremenek
function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09Hooked up initial reference-count checks to the BugReporter interface.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.Ted Kremenek
Bugs are now reported using a combination of "BugType" (previously BugDescription) and Bug "BugReport" objects, which are fed to BugReporter (which generates PathDiagnostics). This provides a far more modular way of registering bug types and plugging in diagnostics. GRExprEngine now owns its copy of GRCoreEngine, and is not owned by the ExplodedGraph. ExplodedGraph is no longer templated on the "checker", but instead on the state contained in the nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09Added some boilerplate for emitting warnings from the CF-reference count ↵Ted Kremenek
checker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31Inlined clang/Analysis/Analyses/GRSimpleVals.h into LocalCheckers.h and removedTed Kremenek
GRSimpleVals.h Added a PathDiagnosticClient option to the driver functions for the CFRefCountChecker and the GRSimpleVals analysis. Both analyses now accept a "-o" argument from the driver that specifies where HTML reports should be dumped. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48989 91177308-0d34-0410-b5e6-96231b3b80d8