aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/FlowSensitive/DataflowSolver.h
AgeCommit message (Collapse)Author
2012-12-04Sort #include lines for all files under include/...Chandler Carruth
This is a simpler sort, entirely automatic with the help of llvm/utils/sort_includes.py -- no manual edits here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer ↵Ted Kremenek
and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20now that we have a centralized place to do so, add some using declarations forChris Lattner
some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01In preparation for fixing PR 6884, rework CFGElement to have getAs<> return ↵Ted Kremenek
pointers instead of fresh CFGElements. - Also, consoldiate getDtorKind() and getKind() into one "kind". - Add empty getDestructorDecl() method to CFGImplicitDtor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126738 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11Don't report dead stores on unreachable code paths. Fixes ↵Ted Kremenek
<rdar://problem/8405222>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Fix the clang build after Zhongxing Xu's commit.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu
and discussions with Ted and Jordy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23Dataflow solver: Don't overrwite the initial value of a block with top ↵Ted Kremenek
unless new values are available. Patch by Simone Pellegrini! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31For reverse data flow analyses, enqueue the blocks in reverse order.Ted Kremenek
This more likely matches with the ideal order the blocks should be visited. This shaves another 1% off the -fsyntax-only time for compare.c (403.gcc). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31Tweak DataFlowSolver's worklist data structure to have an ordered worklistTed Kremenek
and a DenseSet for caching instead of using a single SmallPtrSet. This makes the behavior of the DataFlowSolver more deterministic, and reduces the -fsyntax-only time on compare.c (403.gcc) by 1%. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15Make a couple more headers standaloneDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12Use a BumpPtrAllocator to allocate all aspects of CFG, including CFGBlocks, ↵Ted Kremenek
successor and predecessor vectors, etc. Speedup: when doing 'clang-cc -analyze -dump-cfg' (without actual printing, just CFG building) on the amalgamated SQLite source (all of SQLite in one source file), runtime reduced by 9%. This fixes: <rdar://problem/7250745> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-15Extend the ProgramPoint to include the context information LocationContext,Zhongxing Xu
which is either a stack frame context of the function or a local scope context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20Update DataflowSolver to handle the case where a successor/predecessor blockTed Kremenek
could be NULL. This allows the solver to handle optimized CFGs where branches can be determined during CFG-construction to be infeasible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16Move the source-level CFG from libAST to libAnalysis.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30Fix horrible non-termination bug in LiveVariables. The issue was thatTed Kremenek
the liveness state of block-level expressions could oscillate because of two issues: - The initial value before a merge was not always set to "Top" - The set of live block-level expressions is a union, not an intersection This fixes <rdar://problem/650084>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63421 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23Fix PR 2819: Compute dataflow values for all CFG blocks by not relying on ↵Ted Kremenek
having the "Exit" block being reachable by all (or any) of the blocks in the CFG. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56492 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-16ProgramPoint now takes the space of two pointers instead of one. This change wasTed Kremenek
motivated because it became clear that the number of subclasses of ProgramPoint would expand and we ran out of bits to represent a pointer variant. As a plus of this change, BlockEdge program points can now be represented explicitly without using a cache of CFGBlock* pairs in CFG. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56245 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a ↵Ted Kremenek
block's terminator. Refactored LiveVariables to use getTerminatorCondition() in VisitTerminator(). Bug fix: CFG now computes Block-level expression numbers using information from block terminators. This fixes <rdar://problem/5868189>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Fix bug in terminator processing for uninitialized-values: simply ignore the ↵Ted Kremenek
terminator, don't reprocess it. LiveVariables analysis now does a flow-insensitive analysis to determine what variables have their address taken; these variables are now always treated as being live. The DataflowSolver now uses "SetTopValue()" when getting the initial value for the entry/exit block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Added initial support into the flow-sensitive dataflow solver to visit the ↵Ted Kremenek
Block-level expression in a block's terminator. This expression is visited within a block, but it is accessed by the terminator. This is important to observe because for live-variables analysis the block-level expression is live between the terminator and where the expression occurs in the block. So far this hasn't been an issue to not observe this because the block-level expression used in the terminator is always the last one in the block, and we have never queried the liveness information about this point (but before the terminator). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18Changed DataflowSolver to always associated recorded dataflow values withTed Kremenek
the position *before* a statement, regardless of whether we are doing a forward or backwards analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46151 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17Modified the notion of "Block-level expressions" in CFGs to include Stmt*. ThisTed Kremenek
is because GNU-style Statement-expressions cause the last statement in the statement-expression to act like an expression. We now have two notions: block-level statements and block-level expressions. The former are all Stmt* that appear in the list of statements in CFGBlocks. The latter is the subset of the former; these block-level statements are used as subexpressions somewhere in the AST. CFG::isBlockExpr() returns true for the latter, not the former (previously isBlockExpr() always returned true for non-Expr Stmt*). Modified the LiveVariables analysis to also track liveness state for block-level expressions (using the updated definition of block-level expressions). Modified the dataflow solver so that when it records values for block-level statements, it records the dataflow value *before* the transfer function for a Stmt* is evaluated (not after). This is more in sync in what clients will want. Modified CFGStmtVisitor to record the current block-level statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17Added support to dataflow solver to (when requested) also record dataflowTed Kremenek
values for the block-level expressions. Modified 'LiveVariables' to provide the option to clients to record liveness information for block-level expressions (using the above feature). Modified 'DeadStores' to conform to the new interface of 'LiveVariables'. Modified 'GRConstants' to compute liveness information for block-level expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11Renamed ProgramEdge.h to ProgramPoint.hTed Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45847 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdgeTed Kremenek
to have a much simpler, cleaner interpretation of what is a "location" in a function (as encoded by a CFG). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45846 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29Don't attribute in file headers anymore. See llvmdev for theChris Lattner
discussion of this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02Moved ProgramEdge out out include/.../Analysis/PathSensitive to ↵Ted Kremenek
include/.../Analysis, as it is now used by the FlowSensitive subsystem as well. Removed "Edge" nested class by CFG, as it is now subsumed by ProgramEdge. Adjusted DataflowSolver and DataflowValues to use ProgramEdges instead of CFG::Edge. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42534 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25Moved "DataflowSolver.h" to the "include/" subtree. Adjusted clientTed Kremenek
code that uses the solver to reflect the new location. Created "FlowSensitive" subdirectory in include/clang/Analysis to hold header files relating to flow-sensitive analyses. Moved "DataflowValues.h" into this subdirectory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42320 91177308-0d34-0410-b5e6-96231b3b80d8