aboutsummaryrefslogtreecommitdiff
path: root/Analysis
AgeCommit message (Collapse)Author
2008-01-31Fixed misspelling of "LLVM" due to some editor+Ted madness.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31Added transfer function support for unary '&' and '*', providing basicTed Kremenek
(local) aliasing support. Modified ExplodedGraph pretty-printer (for GRConstants) to also print out the pointer value of the state associated with a node. This way one can easily see that two states are identical. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31Added 'SymbolicLValue' class to represent LValues whose value is symbolic.Ted Kremenek
Improved pretty-printing of LValues. Parameters whose values are pointers/references are now assigned SymbolicLValues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46584 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30We now delay adding nodes created by GRBranchNodeBuilder to the analysisTed Kremenek
worklist until the dstor of GRBranchNodeBuilderImpl. This way clients can mark creates nodes as "sinks" before they are added to the worklist. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Implemented some branch pruning in GRConstants using != and == forTed Kremenek
constant integers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46581 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30Minor cosmetic cleanups: replaced some integer literals with constants andTed Kremenek
more cleanups with pretty-printing of analysis results. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46564 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Implemented more boilerplate in GREngine for processing branches. NowTed Kremenek
we automatically generate a new successor node along an edge if the checker did not explicitly do so (i.e., we just propagate the current state). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Fixed bit-setting bug for ExplodedNodeImpl::NodeGroup.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Added boilerplate logic in GREngine for processing branches.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Renamed GRNodeBuilder to GRStmtNodeBuilder.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Minor fix in transfer function of '!=' where a 'false' literal shouldTed Kremenek
have been 'true'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Added preliminary transfer function support for '==' and '!='.Ted Kremenek
Made some internal API cleanups with creating ConcreteInt values, which lead to some code reduction in implementing "++", "--". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Added "SymbolManager", which manages the set of symbolic values usedTed Kremenek
for analyzing a function. The initial state for GRConstants now assigns symbolic values to parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Fixed bug where not all dead subexpressions were being pruned from the analysisTed Kremenek
state. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46491 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Modified LiveVariables to perform all of its base initialization in the ctor,Ted Kremenek
and now we require a FunctionDecl* object so that we can also keep track of all of the ParmDecls. Modified clients of LiveVariables to conform to the new interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46490 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Added skeleton code for tracking the values of function parameters.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29Driver now passes the top-level FunctionDecl* to GRConstants.Ted Kremenek
Refactoring: for GREngine and GRConstants, pushed references to CFG, ASTContext, and the top-level FunctionDecl into ExplodedGraphImpl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46475 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28Added RValue class "UninitializedValue".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46471 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28Added transfer function logic for "%=" operator.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28Added transfer function hookups for "modulo" operator.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28Minor tweaking with hierarchy of NonLValue objects: SymbolValue isTed Kremenek
now SymbolicNonLValue. Cleaned up some casts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46467 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28Some additional cleanups with method names.Ted Kremenek
Renamed ExprValue to RValue, as all expression values are RValues, and this keeps with the C terminology (renamed old "RValue" class to "NonLValue"). Introduced "ConcreteInt", a class that represents a concrete, integer constant as an RValue. Temporarily removed classes to represent set of possible constants and set of != constants. Will replace with a more general class representing a set of constraints. Added some foundational code to track "symbolic" values, which are used to accrue constraints on an abstract value that is shared between multiple variables. e.g: x = y; // at this point "x" and "y" share the same "value" if (x > 1) ... // at this point, the value shared by "x" and "y" is "> 1". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26Added back logic in patch r46361 ↵Ted Kremenek
(http://llvm.org/viewvc/llvm-project?rev=46361&view=rev) with the addition of some previously missing NULL pointer checks. Modified the UninitializedValues analysis to not expect that every Expr* at the block-level is a block-level expression (we probably need to change the name of such expressions to something truer to their meaning). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Implemented transfer function for '/='.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46379 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Further refactoring of transfer functions by having APSIntSetOp takeTed Kremenek
a template-template parameter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46378 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Renamed RValueDisjunctiveEqual to RValEqualityORSet. Ted Kremenek
Renamed RValueConjunctiveUnequal to RValInequalityANDSet. Refactored add/subtract/multiple (and now divide) operations for RValEqualityORSet to be based on a single template function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46374 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Fixed 80 col. violation.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Renamed RValueMayEqualSet to RValueDisjunctiveEqual.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Some minor restructuring around LValue and RValue types. The value "kind"Ted Kremenek
information is not separated into a "base" and "sub" type. Eventually the value-tracking logic will know about LValues and RValues, but not about specialized LValues and RValues; separating the "kind" information into bits indicating whether an ExprValue is an LValue or an RValue from the bits that specify the actual value type makes this separation easier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24enum value name change.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46327 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24More cleanups to pretty-printing of states in GraphViz output.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46326 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Added transfer function for DeclStmt.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Adjusted storage of values for Stmt* so that we need only query ifTed Kremenek
a Stmt* is a block-level expression when we INSERT a value into the map, and not also when we QUERY a value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46321 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Fixed a bug where the values of block-level expressions were being recorded inTed Kremenek
the value map as if the expressions were non-block-level expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Minor tweaks in the transfer functions for pre- and post- ++/-- whereTed Kremenek
we falsely constructed an APInt to represent the constant '1' instead of using an APSInt (which has a sign). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Added support for unary operator '-' for equality sets.Ted Kremenek
Added some workarounds for loss of signess information on some APSInt operations. Considering the best route to integrate these into APSInt directly. (FIXME's in GRConstants.cpp). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Added transfer functions for pre- and post- increment/decrement operators.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Added passing "ASTContext" to both GREngine and GRConstants.Ted Kremenek
Added initial support for integer casting operations to GRConstants. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24Minor tweak in GetValue to avoid an extra check for ParenExprs.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23Implemented value tracking support for '*' and '*='.Ted Kremenek
Added "multiplication" support for equality sets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46289 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23Implemented value tracking support for '+=' and '-='.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46288 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23Removed extra GraphViz node attributes for GRConstants, as some of them wereTed Kremenek
causing problems with Dot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46285 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23some prettying of the GraphViz visualization of GRConstants analysis results.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46284 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23Major "architectural" changes to the GRConstants analysis. We now reason aboutTed Kremenek
abstract "L-values" and "R-values" when doing value tracking, and expanding constant tracking to encompass tracking disjunctive sets of possible constants. Further, the tree-walking is more efficient, as we don't blindly recurse the tree if we won't generate new states. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46278 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18Fixed bug in 'GetBinding' when doing the lookup of stored values. We nowTed Kremenek
use ImmutableMap::SlimFind(), which returns the correct value. Added pruning of dead block-level expressions and Decls from our value map using liveness information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46154 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18Fixed bug in 'LiveVariables' analysis where we incorrectly marked a variableTed Kremenek
dead at an assignment without taking into account if the variable was used in the RHS of the assignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46153 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17Modified the notion of "Block-level expressions" in CFGs to include Stmt*. ThisTed Kremenek
is because GNU-style Statement-expressions cause the last statement in the statement-expression to act like an expression. We now have two notions: block-level statements and block-level expressions. The former are all Stmt* that appear in the list of statements in CFGBlocks. The latter is the subset of the former; these block-level statements are used as subexpressions somewhere in the AST. CFG::isBlockExpr() returns true for the latter, not the former (previously isBlockExpr() always returned true for non-Expr Stmt*). Modified the LiveVariables analysis to also track liveness state for block-level expressions (using the updated definition of block-level expressions). Modified the dataflow solver so that when it records values for block-level statements, it records the dataflow value *before* the transfer function for a Stmt* is evaluated (not after). This is more in sync in what clients will want. Modified CFGStmtVisitor to record the current block-level statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17Added support to dataflow solver to (when requested) also record dataflowTed Kremenek
values for the block-level expressions. Modified 'LiveVariables' to provide the option to clients to record liveness information for block-level expressions (using the above feature). Modified 'DeadStores' to conform to the new interface of 'LiveVariables'. Modified 'GRConstants' to compute liveness information for block-level expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17Removed FindDeclRef, and used Expr::IgnoreParens instead (code refactoring).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46133 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17Added method Expr::IgnoreParens(), which returns the first non-ParenExpr Expr*.Ted Kremenek
Refactored the use of this method into both the Sema module and Analysis module, which were using their own static functions that did the same thing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46129 91177308-0d34-0410-b5e6-96231b3b80d8