summaryrefslogtreecommitdiffstats
path: root/clang/Analysis/ValueState.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-595/+0
| | | | | | | | | | lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
* Fixed 80 col. violations.Ted Kremenek2008-03-151-2/+4
| | | | llvm-svn: 48400
* Disable creation of "ContentsOf" symbols. It was fundamentally broken on manyTed Kremenek2008-03-151-2/+14
| | | | | | | levels; eventually we will need a plug-in model (similar to GRTransferFuncs) to represent symbolic memory. llvm-svn: 48399
* Expanded ValueState pretty-printing to use an optional "CheckerStatePrinter"Ted Kremenek2008-03-111-5/+13
| | | | | | object to pretty-print the component of a state that is specific to a checker. llvm-svn: 48237
* Added main skeleton for CFRetain transfer function logic.Ted Kremenek2008-03-111-0/+8
| | | | llvm-svn: 48214
* Bug fix: Don't call RemoveDeadBindings more than once (can kill newly ↵Ted Kremenek2008-03-091-20/+6
| | | | | | generated values to Block-Level Expressions). llvm-svn: 48079
* Renamed ValueManager to BasicValueFactory.Ted Kremenek2008-03-071-5/+5
| | | | llvm-svn: 48025
* fix typosGabor Greif2008-03-061-1/+1
| | | | llvm-svn: 47995
* remove the source location arguments to various target query methods.Chris Lattner2008-03-051-5/+2
| | | | llvm-svn: 47954
* Implemented "print" method for ValueState.Ted Kremenek2008-03-041-10/+16
| | | | llvm-svn: 47894
* Merged ValueState and ValueStateImpl into just ValueState, with ↵Ted Kremenek2008-02-281-44/+42
| | | | | | GRExprEngine::StateTy just becoming ValueState*. llvm-svn: 47714
* Renamed "Uninitialized" -> "Undefined" in path-sensitive value tracking engine.Ted Kremenek2008-02-281-3/+3
| | | | llvm-svn: 47713
* When analyzing a function, eagerly create symbolic values for allTed Kremenek2008-02-271-1/+5
| | | | | | globals/parameters at the beginning of the analysis. llvm-svn: 47664
* Header file cleanups: reduce number of includes; move ValueState.h into ↵Ted Kremenek2008-02-271-1/+1
| | | | | | include directory tree. llvm-svn: 47661
* Fix bug when processing '?' operator: invalidate the old "Uninitialized" ↵Ted Kremenek2008-02-261-4/+19
| | | | | | value of the block-level expression for ?. llvm-svn: 47645
* Removed hack with toggling the signedness flag of the APSInt storedTed Kremenek2008-02-261-9/+2
| | | | | | | | | in an EnumConstantDecl. This was made possible because of a recent fix in the parser: http://llvm.org/viewvc/llvm-project?rev=47581&view=rev llvm-svn: 47624
* Small fixes to shore up overhauling of transfer function logic for '&&' and '||.Ted Kremenek2008-02-261-2/+6
| | | | llvm-svn: 47620
* optimization: no longer create ExplodedNodes for IntegerLiteral andTed Kremenek2008-02-261-3/+27
| | | | | | CharacterLiteral expressions. llvm-svn: 47617
* Major cleanup of the transfer function logic for '&&', '||', and '?'. WeTed Kremenek2008-02-261-18/+16
| | | | | | | | now store in the state essentially which branch we took. This removes a bunch of bogus assumptions (and likely bugs), reduces the complexity of the implementation, and facilitates more optimizations. llvm-svn: 47613
* Added lazy "symbolication" of parameter variables and global variables.Ted Kremenek2008-02-261-1/+9
| | | | | | Added recording of divide-by-zero and divide-by-uninitialized nodes. llvm-svn: 47586
* Fixed bug in RemoveDeadBindings when performing the mark-and-sweep over theTed Kremenek2008-02-251-4/+2
| | | | | | | symbolic store: VarDecl's inserted into the sweep may not always bind to anything; handle this special case just like bindings to uninitialized values. llvm-svn: 47550
* Added hack to transfer function logic to handle the case where a DeclRefExprTed Kremenek2008-02-251-1/+9
| | | | | | | | wrapping an EnumConstantDecl evaluates to an integer type that has a different signedness than the APSInt stored in the EnumConstantDecl. Will file a Bugzilla report. llvm-svn: 47548
* Return "Unknown" when using the value of a function pointer whose valueTed Kremenek2008-02-211-1/+5
| | | | | | is symbolic. llvm-svn: 47463
* RemoveDeadBindings should now check for UninitalizedVal, as it is a nowTed Kremenek2008-02-211-2/+9
| | | | | | an error to cast it to LVal. llvm-svn: 47450
* Major cleanup of path-sensitive analysis engine and the current analysisTed Kremenek2008-02-211-109/+107
| | | | | | | | | | | | | | | | based on constant. prop. and limited symbolics. - Renamed class: RValue -> RVal, LValue -> LVal, etc. - Minor method renamings and interface cleanups. - Tightened the RVal "type system" so that UninitializedVal and UnknownVal cannot be cast to LVal or NonLVal. This forces these corner cases values to be explicitly handled early before being dispatched to plug-in transfer function logic. - Major cleanup in the transfer function logic for binary and unary operators. Still fixing some regressions, but we now explicitly handle Uninitialized and Unknown values in a more rigorous way. llvm-svn: 47441
* Placed transfer function logic for dereferences in its own method, while atTed Kremenek2008-02-201-6/+13
| | | | | | the same time clearing up some logic of how the unary '*' operator is processed. llvm-svn: 47356
* Added transfer function support for casting to "void".Ted Kremenek2008-02-191-0/+7
| | | | llvm-svn: 47333
* Added back explicit state/node creation when visiting IntegerLiterals andTed Kremenek2008-02-191-1/+2
| | | | | | | | CharacterLiterals. This may not be a permanent solution; it doesn't cost that much, however, to create a few additional states, and solves a whole bunch of edge cases when handling ?, ||, and &&. llvm-svn: 47299
* Added boilerplate transfer function support for CallExprs.Ted Kremenek2008-02-191-4/+18
| | | | llvm-svn: 47298
* --grsimple now reports the number of nodes in the ExplodedGraph forTed Kremenek2008-02-191-1/+3
| | | | | | | | | an analyzed function. GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in the ExplodedGraph). llvm-svn: 47293
* Added more assertions and checks in transfer function logic to check forTed Kremenek2008-02-181-0/+5
| | | | | | UninitializedVals and UnknownVals. llvm-svn: 47288
* Simplified transfer function logic for ++/-- operators.Ted Kremenek2008-02-151-4/+22
| | | | | | | | | Added more boilerplate transfer function support for pointer arithmetic. Added more pretty-printing support for symbolic constraints. Added transfer function support for handling enum values. Minor pointer types cleanup in ExplodedGraphImpl. llvm-svn: 47183
* Added "symbol iterators" for RValues, allowing easy iteration over the symbolsTed Kremenek2008-02-141-5/+27
| | | | | | | | referenced by an RValue, instead of having to query the type of the RValue. Modified ValueState::RemoveDeadBindings to also prune dead symbols. llvm-svn: 47142
* Added transfer function/value track logic for taking the address of a label.Ted Kremenek2008-02-121-0/+3
| | | | llvm-svn: 47030
* Renamed local variable.Ted Kremenek2008-02-121-11/+19
| | | | | | Added transfer function support for CharacterLiteral. llvm-svn: 47014
* Consolidated use of BumpPtrAllocator shared by various ImmutableSet/ImmutableMapTed Kremenek2008-02-111-2/+1
| | | | | | | | | 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-111-82/+162
| | | | | | | | 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-081-44/+69
| | | | llvm-svn: 46892
* Changed "GetValue" methods to take anTed Kremenek2008-02-081-7/+7
| | | | | | | Expr* instead of a Stmt*, since we only store bindings for Expr*. llvm-svn: 46891
* Moved implementation of "RemoveDeadBindings" from the mainTed Kremenek2008-02-081-0/+71
| | | | | | GRConstants logic to ValueStateManager. llvm-svn: 46888
* More variable renamings.Ted Kremenek2008-02-081-8/+8
| | | | llvm-svn: 46875
* Renamed InvalidValue to UnknownVal.Ted Kremenek2008-02-081-7/+7
| | | | | | Renamed UninitializedValue to UninitializedVal. llvm-svn: 46874
* Added recording of "implicit" NULL dereferences of symbolic pointers.Ted Kremenek2008-02-071-1/+15
| | | | llvm-svn: 46843
* Added several guards in transfer functions for "InvalidValues".Ted Kremenek2008-02-071-0/+3
| | | | | | | | | | | | | | 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
* Added transfer function logic for ReturnStmts.Ted Kremenek2008-02-071-0/+4
| | | | | | Fixed insidious bug in handling dereferences. llvm-svn: 46835
* 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-061-1/+50
| | | | | | | | | != 0). This action will add constraints to the possible values of a symbol. Still needs to be debugged. llvm-svn: 46789
* Moved subclasses of LValue and NonLValue into their own namespaces.Ted Kremenek2008-02-051-7/+7
| | | | | | This noticeably cleans up the naming of these classes. llvm-svn: 46770
* Added a "ConstantNotEq" map to ValueState (and added necessary typedefs and ↵Ted Kremenek2008-02-051-1/+2
| | | | | | factory objects to ValueStateManager). llvm-svn: 46758
* Overhauling of "ValueState" so that it represents its own functional dataTed Kremenek2008-02-051-7/+68
| | | | | | structure that can contain several maps, not just one. llvm-svn: 46744
OpenPOWER on IntegriCloud