aboutsummaryrefslogtreecommitdiff
path: root/Analysis/GRConstants.cpp
AgeCommit message (Collapse)Author
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
2008-02-13Renamed class GREngine => GRCoreEngine.Ted Kremenek
Renamed class GRConstants => GRExprEngine. This was done with a Perl script, and will result in 80 col. violations that I will gradually fix up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47070 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Simplify GRIndirectGotoNodeBuilder.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Added support to GREngine/GRConstants for handling computed gotos.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47038 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12Minor (cosmetic) reshuffling of code. Fixed a bug in "Assume" logic whenTed Kremenek
handling Non-Lvalues of the type nonlval::SymbolVal; we were accidentally casting them to lval::SymbolVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12Added transfer function logic for sizeof(expr)/sizeof(type). This currentlyTed Kremenek
doesn't support VLAs. Reordered some cases in the switch statement of GRConstant::Visit() so that they are ordered alphabetically based on AST node type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47021 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12Added GRBlockCounter class, which tracks the number of times blocksTed Kremenek
have been visited in a path. Added GRBlockCounter as an item to be enqueued to the worklist. Modified "ProcessBranch" in GRConstants to prune branches with symbolic conditions that have been already taken. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47010 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11Separate bindings for subexpressions to be in a separate map forTed Kremenek
bindings for block-level expressions. Moved pretty-printing logic (DOT) for ValueStates to ValueState.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46965 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08Split off expression-bindings in ValueState from variable-bindings.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08Changed "GetValue" methods to take anTed Kremenek
Expr* instead of a Stmt*, since we only store bindings for Expr*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08Moved implementation of "RemoveDeadBindings" from the mainTed Kremenek
GRConstants logic to ValueStateManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08Removed ability to create symbol bindingsTed Kremenek
in VarKey and VariableBindingsTy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08Implemented transfer functions for Statement-Expressions and Commas.Ted Kremenek
Fixed bug in dispatching to the correct transfer function for |=, &=, and ^|. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46880 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08More variable renamings.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-08Renamed InvalidValue to UnknownVal.Ted Kremenek
Renamed UninitializedValue to UninitializedVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46874 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Added some more opcode pretty-printing.Ted Kremenek
Minor cleanups with generating nodes for NULL-pointer dereferences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Added proof-of-concept NULL pointer diagnostics to GRConstants.Ted Kremenek
Modified the driver to pass the Diagnostic object to GRConstants. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46847 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Added support to distinguish between both implicit and explicit null ↵Ted Kremenek
dereferences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Added recording of "implicit" NULL dereferences of symbolic pointers.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Added several guards in transfer functions for "InvalidValues".Ted Kremenek
Fixed bug in RemoveDeadBindings by implementing a simple "mark-and-sweep" cleaner over the bindings, starting from the Decls and block-level expressions that are considered "live" by the Liveness analysis. Fixed bug in isa<> implementation for class LValue. Added "VisitDeclRefExpr" to GRConstants so that we explicitly bind the current value of variable to the Block-level Expression (i.e., when the DeclRefExpr is at the CFGBlock level). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46839 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07Added transfer function logic for ReturnStmts.Ted Kremenek
Fixed insidious bug in handling dereferences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Major code refactoring/cleanup with transfer function logic. Now theTed Kremenek
code structure is more suitable for additional symbolic analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Added main transfer function support for unary operator "!".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46815 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Added assumption logic for symbolic non-lvalues when used in conditions such asTed Kremenek
"if(x)". On the true branch we know the value is != 0, and on the false branch we know it is 0. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46814 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Fixed bug in '=' transfer function: RHS does not have to be a non-LValue.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46797 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Fixed signedness bug in cast transfer function when casting integers to ↵Ted Kremenek
pointers. Removed lval::SymIntConstraintVal; wrappers for symbolic constraints are not lvalues (only integers that evaluate to !0 or 0). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Modified state pretty-printing to include the '!=' and '==' constraints onTed Kremenek
symbols (for constant integers). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Added some skeleton code for performing "assume" on symbols: e.g. assume($0 ↵Ted Kremenek
!= 0). This action will add constraints to the possible values of a symbol. Still needs to be debugged. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Moved subclasses of LValue and NonLValue into their own namespaces.Ted Kremenek
This noticeably cleans up the naming of these classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46770 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Added "batch" processing versions of Nodify and SetValue. Created typedefsTed Kremenek
for buffers for RValues and States. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Renamed typedef "iterator" in ValueState to "vb_iterator" (for ↵Ted Kremenek
"VariableBindings"). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Overhauling of "ValueState" so that it represents its own functional dataTed Kremenek
structure that can contain several maps, not just one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05ValueManager now uses the BumpPtrAllocator owned by the ExplodedGraph.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Simplified transfer functions for '++' and '--'Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Implemented initial transfer function support for '&&', '||', '?', andTed Kremenek
__builtin_choose. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04Created ValueStateManager, a full-blown class to manage the statesTed Kremenek
created for GRConstants. Moved instances of ValueManager and SymbolManager inside this class. The goal is to gradually separate more of the state management from the state transformation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46721 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04Implemented transfer function for unary '~'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46708 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01Implemented casts for ConcreteInt and ConcreteIntLValue.Ted Kremenek
Implemented '==' and '!=' for ConcreteIntLValue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46630 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31Moved RValue code in GRConstants.cpp to RValue.[h,cpp].Ted Kremenek
Moved ValueKey/ValueMap declaration to ValueState.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46618 91177308-0d34-0410-b5e6-96231b3b80d8
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-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