summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move GRTransferFunc* into ValueStateManager, and move the assumption logic ↵Ted Kremenek2008-07-171-181/+9
| | | | | | there as well. llvm-svn: 53743
* Remove redundant logic.Ted Kremenek2008-07-171-15/+0
| | | | llvm-svn: 53740
* Begin major changes to EvalXXX methods in GRTransferFuncs. Currently some ↵Ted Kremenek2008-07-171-2/+39
| | | | | | of the methods only return an RVal; we want them to be able to create an arbitrary number of states. llvm-svn: 53739
* Refactored auditor interface within GRExprEngine and GRCoreEngine to use a ↵Ted Kremenek2008-07-111-40/+87
| | | | | | "batch auditor" to dispatch to specialized auditors instead of having a separate vector for each audited Expr*. This not only provides a much cleaner implementation, but also allows us to install auditors for any expression. llvm-svn: 53464
* Refactored most of the "Store" piece of ValueState into a Store type. TheTed Kremenek2008-07-101-63/+70
| | | | | | | | | current store implementation is now encapsulated by BasicStore. These changes prompted some long due constification of ValueState. Much of the diffs in this patch include adding "const" qualifiers. llvm-svn: 53423
* Remove getParentMap() from GRExprEngine.Ted Kremenek2008-07-091-13/+0
| | | | llvm-svn: 53343
* Refactored some of the BugReporter interface so that data such as the ↵Ted Kremenek2008-07-021-4/+4
| | | | | | | | ASTContext&, PathDiagnosticClient*, can be provided by an external source. Split BugReporter into BugReporter and GRBugReporter so checkers not based on GRExprEngine can still use the BugReporter mechanism. llvm-svn: 53048
* GRExprEngine now expects the LiveVariables information to be provided by its ↵Ted Kremenek2008-07-021-8/+4
| | | | | | | | creator. This allows an optimization in AnalysisConsumer where the same LiveVariables information is used between multiple analyses. llvm-svn: 53046
* Modified the dead stores checker to...Ted Kremenek2008-06-201-1/+14
| | | | | | | | | | | | | | | | | 1) Check if a dead store appears as a subexpression. For such cases, we emit a verbose diagnostic so that users aren't confused. This addresses: <rdar://problem/5968508> checker gives misleading report for dead store in loop 2) Don't emit a dead store warning when assigning a null value to a pointer. This is a common form of defensive programming. We may wish to make this an option to the the checker one day. This addresses the feature request in the following email: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-June/001978.html llvm-svn: 52555
* Introduce initial transfer function support for __imag__ and __real__. We don'tTed Kremenek2008-06-191-3/+50
| | | | | | | have complex RValues yet, so this logic is only fully implemented when __imag__ and __real__ are used on non-complex types. llvm-svn: 52501
* Added a new ProgramPoint: PostPurgeDeadSymbols. This new program point ↵Ted Kremenek2008-06-181-2/+12
| | | | | | distinguishes between the cases when we just evaluated the transfer function of a Stmt* (PostStmt) or performed a load (PostLoad). This solves a caching bug observed in a recent bug report. llvm-svn: 52443
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-171-5/+11
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* Fixed bug in the transfer function for dereferences: the loaded value from ↵Ted Kremenek2008-05-211-1/+1
| | | | | | | | | | EvalLoad should bind to the UnaryOperator*, not its subexpression. Added test case to exercise this fix when checking for uses of uninitialized values. Patch by Zhongxing Xu! llvm-svn: 51377
* Micro-optimization when checking for panic functions.Ted Kremenek2008-05-171-1/+4
| | | | llvm-svn: 51214
* Fix 80 col violation.Ted Kremenek2008-05-171-1/+3
| | | | llvm-svn: 51213
* Added panic function _XCAssertionFailureHandler.Ted Kremenek2008-05-171-0/+4
| | | | llvm-svn: 51212
* Rename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary ↵Ted Kremenek2008-05-091-9/+9
| | | | | | to use IsLValType when conjuring symbols for return values (this fixes a bug with an assertion firing in the analyzer when two qualified objective-c types were compared). llvm-svn: 50924
* Really noreturn on exceptions.Ted Kremenek2008-05-021-3/+3
| | | | llvm-svn: 50579
* Added temporary fix for Obj-C exception handling in the static analyzer: ↵Ted Kremenek2008-05-011-4/+72
| | | | | | treat these as panic functions. llvm-svn: 50535
* Added __assert_rtn to list of panic functions.Ted Kremenek2008-05-011-0/+4
| | | | llvm-svn: 50530
* Added ziperr as a panic function. Eventually inter-procedural analysisTed Kremenek2008-05-011-0/+5
| | | | | | should catch this one easily. llvm-svn: 50526
* Add placeholder code in the static analyzer for MemberExprs involving struct ↵Ted Kremenek2008-04-301-10/+45
| | | | | | temporaries. llvm-svn: 50502
* Add workaround for __builtin_offsetof in the static analyzer.Ted Kremenek2008-04-301-0/+6
| | | | llvm-svn: 50500
* Provide SizeOfAlignTypeExpr workaround in the static analyzer for taking the ↵Ted Kremenek2008-04-301-0/+6
| | | | | | sizeof of a ObjCInterfaceType. llvm-svn: 50499
* When creating LVals for array entries, canonicalize entries with a 0 index.Ted Kremenek2008-04-301-1/+9
| | | | llvm-svn: 50497
* Teach more of the static analyzer about ObjCQualifiedIdType.Ted Kremenek2008-04-301-4/+0
| | | | llvm-svn: 50494
* Teach the static analysis engine about ObjCQualifiedIdType.Ted Kremenek2008-04-301-8/+12
| | | | llvm-svn: 50493
* Add conjured symbols for decl initializations.Ted Kremenek2008-04-301-3/+22
| | | | | | Add db_error as panic function. llvm-svn: 50489
* Invalidate old subexpression bindings when binding UnknownVal.Ted Kremenek2008-04-301-3/+7
| | | | llvm-svn: 50466
* Add lval::ArrayOffset, which represent the locations of entries in an array.Ted Kremenek2008-04-291-62/+26
| | | | llvm-svn: 50453
* Added lval::FieldOffset, which represents symbolic lvalues for field offsets ↵Ted Kremenek2008-04-291-16/+11
| | | | | | | | from other Lvalues. This removes the failure in null-deref-ps.c (test suite). llvm-svn: 50449
* Major rewrite/refactoring of static analysis engine. We now useTed Kremenek2008-04-291-559/+542
| | | | | | | | | | | | 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. llvm-svn: 50443
* Do a better job at computing dead symbols.Ted Kremenek2008-04-251-2/+2
| | | | | | | | | 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. llvm-svn: 50241
* More boilerplate for handling specialized-transfer function logic for dead ↵Ted Kremenek2008-04-241-29/+32
| | | | | | symbols. llvm-svn: 50233
* Added initial boilerplate in GRExprEngine to allow checker-specific transferTed Kremenek2008-04-241-4/+25
| | | | | | function logic to act when symbols become dead. llvm-svn: 50221
* Fixed: <rdar://problem/5881148>Ted Kremenek2008-04-231-80/+54
| | | | | | | | | | 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. llvm-svn: 50176
* Remove false path where the default branch in a switch statement wouldTed Kremenek2008-04-231-2/+5
| | | | | | always be taken even if it was not feasible. llvm-svn: 50132
* Added panic function "assfail".Ted Kremenek2008-04-231-0/+4
| | | | llvm-svn: 50119
* Rewrote VisitDeclStmt to properly handle initializers that can do anything.Ted Kremenek2008-04-221-54/+84
| | | | llvm-svn: 50112
* Added lval type (and tracking) for StringLiterals.Ted Kremenek2008-04-221-0/+1
| | | | llvm-svn: 50109
* Added "nonlval::LValAsInteger" to represent abstract LVals casted to ↵Ted Kremenek2008-04-221-5/+51
| | | | | | integers, allowing us to track lvals when they are casted back to pointers. llvm-svn: 50108
* Added panic function "dtrace_assfail".Ted Kremenek2008-04-221-0/+5
| | | | llvm-svn: 50091
* Hardcode "Assert" as a no-return function (panic).Ted Kremenek2008-04-221-0/+4
| | | | llvm-svn: 50089
* Added null-dereference check for ArraySubscriptExpr.Ted Kremenek2008-04-221-1/+35
| | | | llvm-svn: 50083
* Added support for detected bad dereferences involving MemberExprs, e.g. x->f ↵Ted Kremenek2008-04-211-77/+123
| | | | | | where "x" is NULL. llvm-svn: 50071
* Fixed more caching bugs related to the one fixed in r49914. SilenceTed Kremenek2008-04-181-11/+26
| | | | | | compiler warning introduced by a recent patch of mine. llvm-svn: 49917
* Fixed elusive caching bug that led to false positives.Ted Kremenek2008-04-181-1/+2
| | | | llvm-svn: 49914
* Added "GetErrorNodes()" to BugType so that -trim-egraph can recognize errorsTed Kremenek2008-04-181-4/+15
| | | | | | | | from registered BugTypes. This helps with debugging. Add detection of NULL values in ref count checker; this suppresses false positives. llvm-svn: 49912
* Added "EvalAssume" virtual method to GRTransferFuncs; this is for evaluatingTed Kremenek2008-04-181-7/+20
| | | | | | the checker-specific logic of symbolic assumptions. llvm-svn: 49910
* Handle ReturnStmts by dispatching to "EvalReturn" in the transfer function ↵Ted Kremenek2008-04-161-9/+28
| | | | | | object. llvm-svn: 49826
OpenPOWER on IntegriCloud