summaryrefslogtreecommitdiffstats
path: root/clang/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Added transfer function logic for sizeof(expr)/sizeof(type). This currentlyTed Kremenek2008-02-121-36/+88
| | | | | | | | | 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. llvm-svn: 47021
* Renamed local variable.Ted Kremenek2008-02-121-11/+19
| | | | | | Added transfer function support for CharacterLiteral. llvm-svn: 47014
* Added GRBlockCounter class, which tracks the number of times blocksTed Kremenek2008-02-123-15/+105
| | | | | | | | | | 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. llvm-svn: 47010
* Consolidated use of BumpPtrAllocator shared by various ImmutableSet/ImmutableMapTed Kremenek2008-02-113-5/+9
| | | | | | | | | 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>. llvm-svn: 46976
* Separate bindings for subexpressions to be in a separate map forTed Kremenek2008-02-113-219/+261
| | | | | | | | bindings for block-level expressions. Moved pretty-printing logic (DOT) for ValueStates to ValueState.cpp. llvm-svn: 46965
* Split off expression-bindings in ValueState from variable-bindings.Ted Kremenek2008-02-083-127/+135
| | | | llvm-svn: 46892
* Changed "GetValue" methods to take anTed Kremenek2008-02-083-65/+72
| | | | | | | Expr* instead of a Stmt*, since we only store bindings for Expr*. llvm-svn: 46891
* Moved implementation of "RemoveDeadBindings" from the mainTed Kremenek2008-02-083-74/+82
| | | | | | GRConstants logic to ValueStateManager. llvm-svn: 46888
* Removed ability to create symbol bindingsTed Kremenek2008-02-082-23/+3
| | | | | | in VarKey and VariableBindingsTy. llvm-svn: 46887
* Implemented transfer functions for "<<" and ">>" when the RValues areTed Kremenek2008-02-081-4/+2
| | | | | | ConcreteInts. llvm-svn: 46883
* Implemented transfer functions for Statement-Expressions and Commas.Ted Kremenek2008-02-081-2/+17
| | | | | | Fixed bug in dispatching to the correct transfer function for |=, &=, and ^|. llvm-svn: 46880
* More variable renamings.Ted Kremenek2008-02-084-23/+23
| | | | llvm-svn: 46875
* Renamed InvalidValue to UnknownVal.Ted Kremenek2008-02-084-35/+35
| | | | | | Renamed UninitializedValue to UninitializedVal. llvm-svn: 46874
* Added some more opcode pretty-printing.Ted Kremenek2008-02-072-7/+10
| | | | | | Minor cleanups with generating nodes for NULL-pointer dereferences. llvm-svn: 46851
* Added proof-of-concept NULL pointer diagnostics to GRConstants.Ted Kremenek2008-02-071-5/+27
| | | | | | Modified the driver to pass the Diagnostic object to GRConstants. llvm-svn: 46847
* Added support to distinguish between both implicit and explicit null ↵Ted Kremenek2008-02-071-19/+36
| | | | | | dereferences. llvm-svn: 46846
* Added recording of "implicit" NULL dereferences of symbolic pointers.Ted Kremenek2008-02-075-47/+154
| | | | llvm-svn: 46843
* get the tree building againChris Lattner2008-02-071-1/+2
| | | | llvm-svn: 46840
* Added several guards in transfer functions for "InvalidValues".Ted Kremenek2008-02-073-21/+113
| | | | | | | | | | | | | | 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). llvm-svn: 46839
* Fixed bug in LiveVariables analysis where Block-level exprs appearingTed Kremenek2008-02-071-1/+6
| | | | | | | as the initializers for DeclStmts were not being registered as being live at the start of the DeclStmt. llvm-svn: 46837
* Added transfer function logic for ReturnStmts.Ted Kremenek2008-02-074-5/+46
| | | | | | Fixed insidious bug in handling dereferences. llvm-svn: 46835
* Major code refactoring/cleanup with transfer function logic. Now theTed Kremenek2008-02-063-300/+331
| | | | | | code structure is more suitable for additional symbolic analysis. llvm-svn: 46831
* Added main transfer function support for unary operator "!".Ted Kremenek2008-02-061-0/+22
| | | | llvm-svn: 46815
* Added assumption logic for symbolic non-lvalues when used in conditions such asTed Kremenek2008-02-063-5/+34
| | | | | | | "if(x)". On the true branch we know the value is != 0, and on the false branch we know it is 0. llvm-svn: 46814
* Fixed bug in '=' transfer function: RHS does not have to be a non-LValue.Ted Kremenek2008-02-061-2/+1
| | | | llvm-svn: 46797
* Fixed signedness bug in cast transfer function when casting integers to ↵Ted Kremenek2008-02-063-27/+35
| | | | | | | | pointers. Removed lval::SymIntConstraintVal; wrappers for symbolic constraints are not lvalues (only integers that evaluate to !0 or 0). llvm-svn: 46796
* Modified state pretty-printing to include the '!=' and '==' constraints onTed Kremenek2008-02-061-0/+40
| | | | | | symbols (for constant integers). llvm-svn: 46795
* Disabled operator= for ValueStateImpl.Ted Kremenek2008-02-061-4/+9
| | | | | | | ValueState no longer inherits FoldingSetNode (not needed). Removed redundant operator= implementation for ValueState (it simply did the default behavior). llvm-svn: 46794
* Fixed bug when allocating a ValueStateImpl object in getPersistentState()Ted Kremenek2008-02-061-1/+1
| | | | | | | using the bump-pointer allocator and a placed new; we accidentally allocated a ValueStateImpl* instead, causing an overrun when we did a placed new(). llvm-svn: 46793
* Added some skeleton code for performing "assume" on symbols: e.g. assume($0 ↵Ted Kremenek2008-02-064-10/+144
| | | | | | | | | != 0). This action will add constraints to the possible values of a symbol. Still needs to be debugged. llvm-svn: 46789
* Added pretty-printing support for lval::SymIntConstraintVal andTed Kremenek2008-02-052-29/+133
| | | | | | | | | nonlval::SymIntConstraintVal. Reworked transfer function for '==' and '!=' for LValues to return SymIntConstraintVal when comparing a symbol with a constant. llvm-svn: 46778
* Moved implementation of cast<> for SymbolData closer to SymbolData's definition.Ted Kremenek2008-02-051-24/+28
| | | | llvm-svn: 46772
* Added new "NonLValue" class: SymIntConstraintVal. This class represents a binaryTed Kremenek2008-02-051-4/+18
| | | | | | contraint between a symbol and an integer constant. llvm-svn: 46771
* Moved subclasses of LValue and NonLValue into their own namespaces.Ted Kremenek2008-02-054-211/+224
| | | | | | This noticeably cleans up the naming of these classes. llvm-svn: 46770
* Added "SymIntConstraint", a utility class to represent intermediate values forTed Kremenek2008-02-052-11/+76
| | | | | | | transfer function evaluation that represent constraints between symbolic values and constant integers. llvm-svn: 46769
* Added "batch" processing versions of Nodify and SetValue. Created typedefsTed Kremenek2008-02-053-15/+43
| | | | | | for buffers for RValues and States. llvm-svn: 46759
* Added a "ConstantNotEq" map to ValueState (and added necessary typedefs and ↵Ted Kremenek2008-02-053-10/+36
| | | | | | factory objects to ValueStateManager). llvm-svn: 46758
* Added some comments.Ted Kremenek2008-02-051-2/+14
| | | | llvm-svn: 46756
* Renamed typedef "iterator" in ValueState to "vb_iterator" (for ↵Ted Kremenek2008-02-052-6/+6
| | | | | | "VariableBindings"). llvm-svn: 46755
* Reordered fields/methods in ValueState to make it more aesthetically pleasing.Ted Kremenek2008-02-051-11/+12
| | | | llvm-svn: 46754
* Overhauling of "ValueState" so that it represents its own functional dataTed Kremenek2008-02-053-55/+174
| | | | | | structure that can contain several maps, not just one. llvm-svn: 46744
* ValueManager now uses the BumpPtrAllocator owned by the ExplodedGraph.Ted Kremenek2008-02-053-4/+7
| | | | llvm-svn: 46740
* Simplified transfer functions for '++' and '--'Ted Kremenek2008-02-051-16/+4
| | | | llvm-svn: 46732
* Implemented initial transfer function support for '&&', '||', '?', andTed Kremenek2008-02-054-12/+171
| | | | | | __builtin_choose. llvm-svn: 46731
* Added file that should have been in my previous commit.Ted Kremenek2008-02-041-0/+116
| | | | llvm-svn: 46722
* Created ValueStateManager, a full-blown class to manage the statesTed Kremenek2008-02-042-140/+92
| | | | | | | | 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. llvm-svn: 46721
* Implemented transfer function for unary '~'.Ted Kremenek2008-02-043-0/+21
| | | | llvm-svn: 46708
* Implemented casts for ConcreteInt and ConcreteIntLValue.Ted Kremenek2008-02-013-14/+88
| | | | | | Implemented '==' and '!=' for ConcreteIntLValue. llvm-svn: 46630
* Added skeleton for new LValue class ConcereteIntLValue.Ted Kremenek2008-01-311-44/+83
| | | | llvm-svn: 46624
* Moved RValue code in GRConstants.cpp to RValue.[h,cpp].Ted Kremenek2008-01-314-726/+836
| | | | | | Moved ValueKey/ValueMap declaration to ValueState.h. llvm-svn: 46618
OpenPOWER on IntegriCloud