aboutsummaryrefslogtreecommitdiff
path: root/Analysis
AgeCommit message (Collapse)Author
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-12Renamed local variable.Ted Kremenek
Added transfer function support for CharacterLiteral. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47014 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-11Consolidated use of BumpPtrAllocator shared by various ImmutableSet/ImmutableMapTed Kremenek
factories. Fixed a horrible bug in lval:DeclVar::classof(RValue* V); we weren't checking V was an LValue, allowing nonlval::ConcereteInts to match isa<lval::DeclVar>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46976 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 "<<" and ">>" when the RValues areTed Kremenek
ConcreteInts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46883 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-07get the tree building againChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46840 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-07Fixed bug in LiveVariables analysis where Block-level exprs appearingTed Kremenek
as the initializers for DeclStmts were not being registered as being live at the start of the DeclStmt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46837 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-06Disabled operator= for ValueStateImpl.Ted Kremenek
ValueState no longer inherits FoldingSetNode (not needed). Removed redundant operator= implementation for ValueState (it simply did the default behavior). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46794 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06Fixed bug when allocating a ValueStateImpl object in getPersistentState()Ted Kremenek
using the bump-pointer allocator and a placed new; we accidentally allocated a ValueStateImpl* instead, causing an overrun when we did a placed new(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46793 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-05Added pretty-printing support for lval::SymIntConstraintVal andTed Kremenek
nonlval::SymIntConstraintVal. Reworked transfer function for '==' and '!=' for LValues to return SymIntConstraintVal when comparing a symbol with a constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46778 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Moved implementation of cast<> for SymbolData closer to SymbolData's definition.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46772 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Added new "NonLValue" class: SymIntConstraintVal. This class represents a binaryTed Kremenek
contraint between a symbol and an integer constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46771 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 "SymIntConstraint", a utility class to represent intermediate values forTed Kremenek
transfer function evaluation that represent constraints between symbolic values and constant integers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46769 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-05Added a "ConstantNotEq" map to ValueState (and added necessary typedefs and ↵Ted Kremenek
factory objects to ValueStateManager). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Added some comments.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46756 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-05Reordered fields/methods in ValueState to make it more aesthetically pleasing.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46754 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-04Added file that should have been in my previous commit.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46722 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-31Added skeleton for new LValue class ConcereteIntLValue.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46624 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