summaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
Commit message (Collapse)AuthorAge
...
* Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the ↵Ted Kremenek2008-04-30
| | | | | | sizeof of a ObjCInterfaceType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50499 91177308-0d34-0410-b5e6-96231b3b80d8
* When creating LVals for array entries, canonicalize entries with a 0 index.Ted Kremenek2008-04-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50497 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach more of the static analyzer about ObjCQualifiedIdType.Ted Kremenek2008-04-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50494 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the static analysis engine about ObjCQualifiedIdType.Ted Kremenek2008-04-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50493 91177308-0d34-0410-b5e6-96231b3b80d8
* Add conjured symbols for decl initializations.Ted Kremenek2008-04-30
| | | | | | | Add db_error as panic function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50489 91177308-0d34-0410-b5e6-96231b3b80d8
* Invalidate old subexpression bindings when binding UnknownVal.Ted Kremenek2008-04-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50466 91177308-0d34-0410-b5e6-96231b3b80d8
* Add lval::ArrayOffset, which represent the locations of entries in an array.Ted Kremenek2008-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50453 91177308-0d34-0410-b5e6-96231b3b80d8
* Added lval::FieldOffset, which represents symbolic lvalues for field offsets ↵Ted Kremenek2008-04-29
| | | | | | | | | 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
* Major rewrite/refactoring of static analysis engine. We now useTed Kremenek2008-04-29
| | | | | | | | | | | | | 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
* Do a better job at computing dead symbols.Ted Kremenek2008-04-25
| | | | | | | | | | 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
* More boilerplate for handling specialized-transfer function logic for dead ↵Ted Kremenek2008-04-24
| | | | | | symbols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50233 91177308-0d34-0410-b5e6-96231b3b80d8
* Added initial boilerplate in GRExprEngine to allow checker-specific transferTed Kremenek2008-04-24
| | | | | | | 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
* Fixed: <rdar://problem/5881148>Ted Kremenek2008-04-23
| | | | | | | | | | | | 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
* Remove false path where the default branch in a switch statement wouldTed Kremenek2008-04-23
| | | | | | | 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
* Added panic function "assfail".Ted Kremenek2008-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50119 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrote VisitDeclStmt to properly handle initializers that can do anything.Ted Kremenek2008-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50112 91177308-0d34-0410-b5e6-96231b3b80d8
* Added lval type (and tracking) for StringLiterals.Ted Kremenek2008-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50109 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "nonlval::LValAsInteger" to represent abstract LVals casted to ↵Ted Kremenek2008-04-22
| | | | | | 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
* Added panic function "dtrace_assfail".Ted Kremenek2008-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50091 91177308-0d34-0410-b5e6-96231b3b80d8
* Hardcode "Assert" as a no-return function (panic).Ted Kremenek2008-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50089 91177308-0d34-0410-b5e6-96231b3b80d8
* Added null-dereference check for ArraySubscriptExpr.Ted Kremenek2008-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50083 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for detected bad dereferences involving MemberExprs, e.g. x->f ↵Ted Kremenek2008-04-21
| | | | | | where "x" is NULL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50071 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed more caching bugs related to the one fixed in r49914. SilenceTed Kremenek2008-04-18
| | | | | | | 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
* Fixed elusive caching bug that led to false positives.Ted Kremenek2008-04-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49914 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "GetErrorNodes()" to BugType so that -trim-egraph can recognize errorsTed Kremenek2008-04-18
| | | | | | | | | 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
* Added "EvalAssume" virtual method to GRTransferFuncs; this is for evaluatingTed Kremenek2008-04-18
| | | | | | | the checker-specific logic of symbolic assumptions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49910 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle ReturnStmts by dispatching to "EvalReturn" in the transfer function ↵Ted Kremenek2008-04-16
| | | | | | object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49826 91177308-0d34-0410-b5e6-96231b3b80d8
* Small tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV toTed Kremenek2008-04-16
| | | | | | | represent possible stores to "Unknown." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49811 91177308-0d34-0410-b5e6-96231b3b80d8
* Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.Ted Kremenek2008-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49804 91177308-0d34-0410-b5e6-96231b3b80d8
* Take first step to migrating handling of "stores" to values from GRExprEngineTed Kremenek2008-04-16
| | | | | | | to the plug-in GRTransferFuncs object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49801 91177308-0d34-0410-b5e6-96231b3b80d8
* Added some comments to GRExprEngine. Reorder some of the method definitionsTed Kremenek2008-04-15
| | | | | | | | | 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
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-15
| | | | | | | | | 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
* Fixed some logic errors in the CF ref count checker; we now can detect simpleTed Kremenek2008-04-10
| | | | | | | use-after-release errors. Added test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49509 91177308-0d34-0410-b5e6-96231b3b80d8
* Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.Ted Kremenek2008-04-09
| | | | | | | | | | | | | | | | 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
* simplify some code by using PointerLikeType.Chris Lattner2008-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49101 91177308-0d34-0410-b5e6-96231b3b80d8
* Added path-sensitive check for return statements that return the addressTed Kremenek2008-03-31
| | | | | | | | 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
* Hooked up initial NSString interface checking to GRSimpleVals.Ted Kremenek2008-03-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48895 91177308-0d34-0410-b5e6-96231b3b80d8
* Added "GRAuditor" and "GRSimpleAPICheck" interface to allow simple stateless ↵Ted Kremenek2008-03-27
| | | | | | | | | | 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
* Bug fix: use GetRVal instead of GetLVal (were getting the value of a ↵Ted Kremenek2008-03-26
| | | | | | DeclRefExpr, not it's address). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48846 91177308-0d34-0410-b5e6-96231b3b80d8
* Bug fix in transfer function for ObjCMessageExpr: Visit the receiver ↵Ted Kremenek2008-03-26
| | | | | | 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
* Tweak to transfer function for ObjCMessageExpr: handle both instance methodsTed Kremenek2008-03-25
| | | | | | | and message expressions with a specified receiver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48773 91177308-0d34-0410-b5e6-96231b3b80d8
* Added logic to check for uninitialized values as the receivers for message ↵Ted Kremenek2008-03-25
| | | | | | | | | 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
* Added initial transfer function support for ObjCMessageExpr.Ted Kremenek2008-03-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48757 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename "Nodify" to "MakeNode"Ted Kremenek2008-03-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48659 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assertion.Ted Kremenek2008-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48470 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix integer overflow bug when processing switch statements.Ted Kremenek2008-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48469 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly hook up inline asm transfer function logic to the main GRExprEngine ↵Ted Kremenek2008-03-17
| | | | | | logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48468 91177308-0d34-0410-b5e6-96231b3b80d8
* Added initial transfer function support for inline asm.Ted Kremenek2008-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48466 91177308-0d34-0410-b5e6-96231b3b80d8
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-15
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