aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
AgeCommit message (Collapse)Author
2008-04-30Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the ↵Ted Kremenek
sizeof of a ObjCInterfaceType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30When creating LVals for array entries, canonicalize entries with a 0 index.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50497 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-30Add conjured symbols for decl initializations.Ted Kremenek
Add db_error as panic function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30Invalidate old subexpression bindings when binding UnknownVal.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Add lval::ArrayOffset, which represent the locations of entries in an array.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Added lval::FieldOffset, which represents symbolic lvalues for field offsets ↵Ted Kremenek
from other Lvalues. This removes the failure in null-deref-ps.c (test suite). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29Major rewrite/refactoring of static analysis engine. We now useTed Kremenek
EvalStore/EvalLoad to handle all loads/stores from symbolic memory, allowing us to do checks for null dereferences, etc., at any arbitrary load/store (these were missed checks before). This also resulted in some major cleanups, some conceptual, and others just in the structure of the code. This temporarily introduces a regression in the test suite (null-deref-ps.c) before I add a new LVal type for structure fields. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50443 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-24More boilerplate for handling specialized-transfer function logic for dead ↵Ted Kremenek
symbols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50233 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24Added initial boilerplate in GRExprEngine to allow checker-specific transferTed Kremenek
function logic to act when symbols become dead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50221 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-23Remove false path where the default branch in a switch statement wouldTed Kremenek
always be taken even if it was not feasible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50132 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23Added panic function "assfail".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22Rewrote VisitDeclStmt to properly handle initializers that can do anything.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50112 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-22Added "nonlval::LValAsInteger" to represent abstract LVals casted to ↵Ted Kremenek
integers, allowing us to track lvals when they are casted back to pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50108 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22Added panic function "dtrace_assfail".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50091 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22Hardcode "Assert" as a no-return function (panic).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22Added null-dereference check for ArraySubscriptExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21Added support for detected bad dereferences involving MemberExprs, e.g. x->f ↵Ted Kremenek
where "x" is NULL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50071 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Fixed more caching bugs related to the one fixed in r49914. SilenceTed Kremenek
compiler warning introduced by a recent patch of mine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-18Fixed elusive caching bug that led to false positives.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49914 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-18Added "EvalAssume" virtual method to GRTransferFuncs; this is for evaluatingTed Kremenek
the checker-specific logic of symbolic assumptions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16Handle ReturnStmts by dispatching to "EvalReturn" in the transfer function ↵Ted Kremenek
object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49826 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-16Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49804 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16Take first step to migrating handling of "stores" to values from GRExprEngineTed Kremenek
to the plug-in GRTransferFuncs object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Added some comments to GRExprEngine. Reorder some of the method definitionsTed Kremenek
to start logically organizing them. Added initial plug-in transfer function support for Objective-C message expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff
VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl(). This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 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-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-02simplify some code by using PointerLikeType.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31Added path-sensitive check for return statements that return the addressTed Kremenek
of a stack variable. This is the path-sensitive version of a check that is already done during semantic analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27Hooked up initial NSString interface checking to GRSimpleVals.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27Added "GRAuditor" and "GRSimpleAPICheck" interface to allow simple stateless ↵Ted Kremenek
checkers to be injected into the analyzer. Added "AnnotatedPath" class to record an annotated path that will be useful for inspecting paths. Added some boilerplate code for simple checks of Apple's Foundation API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26Bug fix: use GetRVal instead of GetLVal (were getting the value of a ↵Ted Kremenek
DeclRefExpr, not it's address). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26Bug fix in transfer function for ObjCMessageExpr: Visit the receiver ↵Ted Kremenek
expression as an ordinary expression, not using VisitLVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25Tweak to transfer function for ObjCMessageExpr: handle both instance methodsTed Kremenek
and message expressions with a specified receiver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48773 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25Added logic to check for uninitialized values as the receivers for message ↵Ted Kremenek
expressions and uninitialized values passed-by-value as arguments to message expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25Added initial transfer function support for ObjCMessageExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21Rename "Nodify" to "MakeNode"Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17Fix assertion.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17Fix integer overflow bug when processing switch statements.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17Properly hook up inline asm transfer function logic to the main GRExprEngine ↵Ted Kremenek
logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17Added initial transfer function support for inline asm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8