aboutsummaryrefslogtreecommitdiff
path: root/Analysis/GRConstants.cpp
AgeCommit message (Collapse)Author
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-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-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-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
2008-01-17Added some experimental optimizations to remove dead values from theTed Kremenek
state. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Changed sorting criteria for DSPtr to put sub-expressions first in the valueTed Kremenek
map. This will allow us to quickly prune them from maps without searching the entire map. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Changed sorting criteria for DSPtr to sort Decl* before Expr*, andTed Kremenek
to sort sub-expressions before Block-level expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16IntegerLiterals are no longer evaluated to create separate nodes; theirTed Kremenek
values are determined when evaluating the parent expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Fixed bug where we performed addition instead of subtraction duringTed Kremenek
constant propagation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46095 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Added initial graph visualization support for the GRConstants analysis.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Added support from retrieving stored values to variables.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Added support for assignments in GRConstants.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Fixed bug where GRConstants::AddBindings() did not check for valuesTed Kremenek
that were "not a constant." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Hooked up the GRConstants analysis to the driver.Ted Kremenek
Fixed some compilation errors with GREngine that showed up during template instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16More cleanups in DoStmt. The NodeSets are now vectors instead of sets, sinceTed Kremenek
node caching in GREngine will guarantee that we do not insert a node twice into a nodeset. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46071 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Adjusted DSPtr::Profile method again, since my last patch broke the build.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Changed 'Profile' method for DSPtr to incorporate the flags from theTed Kremenek
variant type, and not just the pointer value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46049 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-16Renamed some internal classes for the GR-Constant Propagation analysis.Ted Kremenek
Cleaned up GRConstants::AddBinding to not directly reference the predecessor node. Now we just manipulate the current state, and a driver function creates nodes as needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46040 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15Added skeleton implementation of new constant-prop. analysis usingTed Kremenek
the graph reachability engine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46036 91177308-0d34-0410-b5e6-96231b3b80d8