aboutsummaryrefslogtreecommitdiff
path: root/Analysis/GRExprEngine.cpp
AgeCommit message (Collapse)Author
2008-02-26Fix bug when processing '?' operator: invalidate the old "Uninitialized" ↵Ted Kremenek
value of the block-level expression for ?. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Don't emit divide-by-zero errors when we divide by an unknown (notTed Kremenek
uninitialized) value. At this point we're just too imprecise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47636 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Removed static analysis-specific diagnostics from DiagnosticKinds.def.Ted Kremenek
Use custom diagnostics for static analysis checkers. Added warnings for dereferencing uninitialized values and divide-by-zeroes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Small fixes to shore up overhauling of transfer function logic for '&&' and '||.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26optimization: no longer create ExplodedNodes for IntegerLiteral andTed Kremenek
CharacterLiteral expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47617 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Major cleanup of the transfer function logic for '&&', '||', and '?'. WeTed Kremenek
now store in the state essentially which branch we took. This removes a bunch of bogus assumptions (and likely bugs), reduces the complexity of the implementation, and facilitates more optimizations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47613 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Fixed inverted condition.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Added lazy "symbolication" of parameter variables and global variables.Ted Kremenek
Added recording of divide-by-zero and divide-by-uninitialized nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Added FIXME.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47578 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Better handling of calls to functions via function pointers.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47562 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Expanded transfer function support for divide-by-zero checking to includeTed Kremenek
"remainder-by-zero" checking (operator '%'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47549 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Added transfer function support for checking for divide-by-zero errors.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22Added "assumption" logic for lval::FuncVal and lval::GotoLabel, and simplifiedTed Kremenek
assumption logic for lval::DeclVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22Bug fix: For transfer function for unary "!", compare the subexpression valueTed Kremenek
against '0' of the same bit-width. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Added transfer function support for dispatching to functions we don't knowTed Kremenek
about. The default logic is to invalidate the values of all values passed-by-reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Regression fix: Handle pointer arithmetic in unary ++/--.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Removed bogus assertions regard LValues binding to UnknownVal; they canTed Kremenek
do so implicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21FIX: Promote the correct operand.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Simplified and generalized transfer function logic for casts, allowingTed Kremenek
the transfer function to be invoked without an Expr* for the Cast operation. Added implicit promotions to the transfer function logic for compound assignments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Added transfer function support for sizeof(void)Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Major cleanup of path-sensitive analysis engine and the current analysisTed Kremenek
based on constant. prop. and limited symbolics. - Renamed class: RValue -> RVal, LValue -> LVal, etc. - Minor method renamings and interface cleanups. - Tightened the RVal "type system" so that UninitializedVal and UnknownVal cannot be cast to LVal or NonLVal. This forces these corner cases values to be explicitly handled early before being dispatched to plug-in transfer function logic. - Major cleanup in the transfer function logic for binary and unary operators. Still fixing some regressions, but we now explicitly handle Uninitialized and Unknown values in a more rigorous way. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20Implemented transfer function logic for unary '+'Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20Placed transfer function logic for dereferences in its own method, while atTed Kremenek
the same time clearing up some logic of how the unary '*' operator is processed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added special handling for UninitializedVals for the transfer function logicTed Kremenek
for pointer dereferences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Fixed transfer function for casts to always evaluate the effects of theTed Kremenek
cast's subexpression even if the cast itself has no effect. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added transfer function support for casting to "void".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47333 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added back explicit state/node creation when visiting IntegerLiterals andTed Kremenek
CharacterLiterals. This may not be a permanent solution; it doesn't cost that much, however, to create a few additional states, and solves a whole bunch of edge cases when handling ?, ||, and &&. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47299 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added boilerplate transfer function support for CallExprs.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added FIXME for properly handling local arrays using symbolic LValues.Ted Kremenek
For now we just treat their values as "Unknown." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19--grsimple now reports the number of nodes in the ExplodedGraph forTed Kremenek
an analyzed function. GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in the ExplodedGraph). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18Added more assertions and checks in transfer function logic to check forTed Kremenek
UninitializedVals and UnknownVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47288 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Refactored code for transfer functions for binary operators involving two ↵Ted Kremenek
LValues. Fixed bug in transfer functions for sizeof(*); we were incorrectly evaluating to a value of the wrong type. Fixed bug in transfer functions for compound assignments where we did not properly handle assignments involving dereferences of symbolic values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Added transfer function support for conditional branches with a NULL ↵Ted Kremenek
condition (e.g., "for(;;)"). Fixed bug in transfer function for compound assignment operators when both operands where variables but had a non-pointer type (we fired an assertion). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Simplified transfer function logic for ++/-- operators.Ted Kremenek
Added more boilerplate transfer function support for pointer arithmetic. Added more pretty-printing support for symbolic constraints. Added transfer function support for handling enum values. Minor pointer types cleanup in ExplodedGraphImpl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47183 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Remove unnecessary references to VariableArrayType from Analysis.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Added boilerplate transfer function support for pointer arithmetic operations.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14When visualizing ExplodedNodes created by GRExprEngine, color nodes withTed Kremenek
null-dereferences or bad control-flow red. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Renamed GRConstants => GRSimpleVals.Ted Kremenek
Moved driver logic for --grsimple to GRSimpleVals.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14#include cleanups in GRExprEngine.cpp/GRExprEngine.h. Moved GRExprEngine toTed Kremenek
clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Partitioned definition/implementation of GRExperEngine into .h and .cpp.Ted Kremenek
Still some cleanup to do, but this initial checkin compiles and runs correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47135 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Migrated transfer functions for binary operators for simple value trackingTed Kremenek
from RValues to GRTransferFuncs/GRSimpleVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47131 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Migrated transfer functions for unary "~" and "-" to ↵Ted Kremenek
GRTransferFuncs/GRSimpleVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47126 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Started partitioning of transfer function logic (and thus the policy behind Ted Kremenek
these operations) into GRTransferFuncs and its subclasses. Originally all of this logic was handled by the class RValue, but in reality different analyses will want more flexibility on how they evaluate different values. Transfer functions migrated so far: "Cast" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Moved Rvalues.h from "Analysis/" to "include/clang/Analysis/PathSensitive".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Added support to GRCoreEngine/GRExprEngine for processing control-flowTed Kremenek
from switch...case...default statements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Fixed 80 col violations.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47076 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Unbreak the build.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47072 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Renamed files to match class renaming in r47070:Ted Kremenek
http://llvm.org/viewvc/llvm-project?rev=47070&view=rev git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47071 91177308-0d34-0410-b5e6-96231b3b80d8