aboutsummaryrefslogtreecommitdiff
path: root/Analysis/GRExprEngine.cpp
AgeCommit message (Collapse)Author
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Handle StmtExprs whose last contained statement is not an expression.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48388 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Compute alignment in bytes, not bits.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Implement transfer function logic for alignof operator (types).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15Added transfer function support in GRExprEngine for __extension__.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14"panic" has 5 letters, not 4. Bug pointed out by Nuno Lopes!Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14Hack to hardwire in some panic functions that are not marked noreturn.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48374 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14Emit warnings for undefined control-flow.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Changed CallRetValSymbol to SymbolConjured to allow "conjured" symbols to be ↵Ted Kremenek
created for any expression, not just CallExprs. Added experimental support for conjuring symbols during assingments where the RHS is "unknown". This allows more value tracking for path-sensitivity. Fixed bug in "assumption" logic when processing symbolic constraints; we would improperly mark constraints we didn't support as infeasible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48306 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Improved ExplodedGraph::Trim to only show nodes reachable from a reverse BFSTed Kremenek
from the sources, and to try and generate only a single path from sources to roots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48286 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11Expanded graph-visualization to include optional pretty-printing of ↵Ted Kremenek
checker-specific state. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11Expanded graph visualization interface to include specifying a range ofTed Kremenek
nodes to use a trim sources. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10More edge-case handling with using liveness information to prune dead state ↵Ted Kremenek
values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10More cleanups with using the liveness analysis to removed dead symbols andTed Kremenek
variables from the symbolic state. Now we keep a mapping from the predecessor node of a statement and its cleaned state, and interpose an accessor "GetState()" to return the cleaned state when the node is the predecessor node, and the real state otherwise. This obviates problem of ever accidentally cleaning the state more than once (thus blowing away new bindings by mistake). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48124 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09When processing the transfer function for a statement, evaluateTed Kremenek
RemoveDeadBindings early because (1) it will always be called and (2) we can dispatch to a plug-in transfer function that can evaluate the effect of dead symbols (not yet added). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Refactored guards for "GRExprEngine::RemoveDeadBindings" directly into theTed Kremenek
method. This paves the way for other alterations to RemoveDeadBindings that are transparent to its callers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48113 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Bug fix in the transfer function for compound assignments: if the valueTed Kremenek
of the LHS expressions is Unknown, the value of the entire expression does not evaluate to the RHS (as is the case with normal assignments). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Fixed crash where SetBlkExpr would attempt to query the liveness data whenTed Kremenek
we weren't processing a statement within a basic block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Bug fix: Don't call RemoveDeadBindings more than once (can kill newly ↵Ted Kremenek
generated values to Block-Level Expressions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48079 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07Added --trim-path-graph to the driver to trim paths from the ExplodedGraphTed Kremenek
that are not related to error nodes. Fixed bug where we did not detect some NULL dereferences. Added "ExplodedGraph::Trim" to trim all nodes that cannot transitively reach a set of provided nodes. Fixed subtle bug in ExplodedNodeImpl where we could create predecessor iterators that included the mangled "sink" bit. The better fix is to integrate this bit into the void* for the wrapped State, not the NodeGroups representing a node's predecessors and successors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07Improved graph visualization of ExplodedGraphs to include source line and columnTed Kremenek
information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07Renamed ValueManager to BasicValueFactory.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07Refined divide-by-zero checking to distinguish between must and mayTed Kremenek
divide-by-zero errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48013 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Added transfer function support for __builtin_expect.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47971 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Small bug fix when handling CallExprs that generate sink nodes.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47970 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Fixed bug that could case unwanted bifurcation of states when evaluating calls.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Minor cleanups (mainly indentation).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47955 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05remove the source location arguments to various target query methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Plug-in transfer function "EvalCall" now takes as an argument the currentTed Kremenek
GRStmtNodeBuilder and is now responsible for adding its own nodes to the graph. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Moved implementation of GRExprEngine::Nodify into GRStmtNodeBuilder. This willTed Kremenek
allow us to pass the builder to plug-in transfer functions and allow those functions to create intermediate nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47919 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Added preliminary transfer function support for references.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47912 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04For the transfer function for CallExpr, invalidate all argumentsTed Kremenek
passed-by-reference to builtin functions until we have better builtin support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04For the transfer function of DeclStmt, for now initialize the values ofTed Kremenek
structs (local variables) to Unknown instead of Undefined. (added FIXME to initialize *members* of struct to undefined) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47901 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Add transfer function support for the default initialization of staticTed Kremenek
variables that are pointers or integers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47880 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Fixed insidious state propagation bug that would sometimes cause the stateTed Kremenek
to bifurcate at the wrong places and not propagate at others. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Enhanced pretty-printing of undefined-argument errors.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-03Added FIXME.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29Added extra check for calls to functions where we pass undefined valuesTed Kremenek
as arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47778 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29Add checks for function calls via a function pointer that is NULL, Undefined,Ted Kremenek
or otherwise a constant integer value that doesn't evaluate to an address. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47774 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29"Refinement" of hack to bound loop-traversals: visit any block at a maximum ↵Ted Kremenek
of 3 times along a given path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28Added checking for undefined results of '<<' and '>>' (shifting by too many ↵Ted Kremenek
bits, etc.) This current implementation only works when both operands are concrete values; later we will add support for symbolic values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28Merged ValueState and ValueStateImpl into just ValueState, with ↵Ted Kremenek
GRExprEngine::StateTy just becoming ValueState*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28Renamed "Uninitialized" -> "Undefined" in path-sensitive value tracking engine.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47713 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27End paths when calling a function marked "noreturn."Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47690 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Small tweaks to the transfer function for DeclStmt: do not mark external globalTed Kremenek
variables as uninitialized, and only "initialize" static function variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47683 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Small fix to VisitLVal: this method can be called on Block-Level expressions. Ted Kremenek
In such cases, handle them just like Visit(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27When analyzing a function, eagerly create symbolic values for allTed Kremenek
globals/parameters at the beginning of the analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Header file cleanups: reduce number of includes; move ValueState.h into ↵Ted Kremenek
include directory tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47661 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Similar bug fix to r47650; when processing CallExprs if we did not generate anTed Kremenek
ExplodedNode for the Callee subexpression we would not evaluate the CallExpr transfer function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Fixed bug in the core transfer function logic for CallExprs where we wouldTed Kremenek
sometimes skip evaluating all the arguments when some arguments would not create new ExplodedNodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47650 91177308-0d34-0410-b5e6-96231b3b80d8