summaryrefslogtreecommitdiffstats
path: root/clang/Analysis/LiveVariables.cpp
Commit message (Collapse)AuthorAgeFilesLines
* The LiveVariables analysis no longer requires a FunctionDecl&; this allows itTed Kremenek2008-03-131-9/+6
| | | | | | to be run on other declarations of blocks of code (e.g., Objective-C methods.) llvm-svn: 48339
* Fixed bogus assumption mistakenly introduced in r47955.Ted Kremenek2008-03-051-2/+1
| | | | llvm-svn: 47958
* Minor cleanups (mainly indentation).Ted Kremenek2008-03-051-1/+2
| | | | llvm-svn: 47955
* Minor bug fix in LiveVariables: don't "kill" decls referenced by a DeclStmtTed Kremenek2008-02-251-5/+5
| | | | | | that aren't VarDecls. llvm-svn: 47572
* Fixed horrid bug in LiveVariables analysis where we were only merging atTed Kremenek2008-02-221-1/+1
| | | | | | | confluence points the liveness information for variables (Decls) and NOT block-level expressions. llvm-svn: 47506
* Bug fix in liveness: Only compute liveness information for VarDecls.Ted Kremenek2008-02-221-6/+7
| | | | llvm-svn: 47464
* 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
* Modified LiveVariables to perform all of its base initialization in the ctor,Ted Kremenek2008-01-291-1/+9
| | | | | | | | | and now we require a FunctionDecl* object so that we can also keep track of all of the ParmDecls. Modified clients of LiveVariables to conform to the new interface. llvm-svn: 46490
* Fixed bug in 'LiveVariables' analysis where we incorrectly marked a variableTed Kremenek2008-01-181-2/+5
| | | | | | | dead at an assignment without taking into account if the variable was used in the RHS of the assignment. llvm-svn: 46153
* Modified the notion of "Block-level expressions" in CFGs to include Stmt*. ThisTed Kremenek2008-01-171-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 46143
* Added support to dataflow solver to (when requested) also record dataflowTed Kremenek2008-01-171-3/+4
| | | | | | | | | | | | | | 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. llvm-svn: 46137
* Removed FindDeclRef, and used Expr::IgnoreParens instead (code refactoring).Ted Kremenek2008-01-171-18/+5
| | | | llvm-svn: 46133
* Renamed ProgramEdge to ProgramPoint and changed subclasses of ProgramEdgeTed Kremenek2008-01-111-1/+1
| | | | | | | to have a much simpler, cleaner interpretation of what is a "location" in a function (as encoded by a CFG). llvm-svn: 45846
* Added VISIBILITY_HIDDEN to classes/structs in anonymous namespaces.Ted Kremenek2008-01-081-2/+5
| | | | llvm-svn: 45750
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | discussion of this change. llvm-svn: 45410
* Directory restructing of Analysis files.Ted Kremenek2007-12-211-1/+1
| | | | | | | | | | | Created include/clang/Analysis/Analyses directory. - Moved LiveVariables.h and UninitializedValues.h into this dir. Moved ExprDeclBitVector.h into Analysis/Support. Updated all clients who use these headers to reflect the new paths. llvm-svn: 45292
* Fixed bug in live-variable analysis and uninitialized-values analysis whereTed Kremenek2007-12-131-0/+1
| | | | | | | | | we incorrectly examine the expression within a sizeof() for use in computing dataflow values. This fixes: PR 1858 (http://llvm.org/bugs/show_bug.cgi?id=1858) llvm-svn: 44982
* Updated CFGStmtVisitor and CFGRecStmtVisitor to have a notion ofTed Kremenek2007-11-201-16/+3
| | | | | | | | | | | | | | | | "block-expressions" when visiting arbitrary expressions (via calls to "Visit()"). This results in a refactoring where a dataflow analysis no longer needs to always special case when handling block-expressions versus non-block expressions. Updated LiveVariables and UninitializedValues to conform to the slightly altered interface of these visitor classes. Thanks to Nuno Lopes for providing a test case that illustrated some fundamental problems in the current design of the CFGXXXStmtVisitor classes and how they were used. llvm-svn: 44246
* Fixed bug where LiveVariables was not properly propagating updates to livenessTed Kremenek2007-11-191-1/+1
| | | | | | | state that occurred in subexpressions of Block-Level expressions. Bug and fix provided by Nuno Lopes. llvm-svn: 44224
* move IdentifierTable.h from liblex to libbasic.Chris Lattner2007-10-071-1/+0
| | | | llvm-svn: 42730
* Migrated LiveVariables and UninitializedVariables to now use theTed Kremenek2007-10-011-22/+23
| | | | | | tracked BlkExpr information now maintained by the CFG class. llvm-svn: 42498
* Fixed bug where assignments to variables wrapped in parentheses would notTed Kremenek2007-09-281-14/+27
| | | | | | | | properly kill variables. e.g: (x) = 1; llvm-svn: 42450
* Significant cleanups and bug-fixes to LiveVariables. Uses new refactoredTed Kremenek2007-09-281-37/+61
| | | | | | ExprDeclBitVector class for defining dataflow state. llvm-svn: 42446
* Moved "DataflowSolver.h" to the "include/" subtree. Adjusted clientTed Kremenek2007-09-251-1/+1
| | | | | | | | | | 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. llvm-svn: 42320
* Further refactored DataflowSolver. Now most code for the solver is sharedTed Kremenek2007-09-251-372/+101
| | | | | | | | | | | | | | | | | | | between forward and backward analyses, with trait classes being used to implement the key differences in operations/functionality. Converted the LiveVariables analysis to use the generic DataflowSolver. This, along with removing some extra functionality that was not needed, reduced the code for LiveVariables by over half. Modified Driver code to handle the updated interface to LiveVariables. Modified the DeadStores checker to handle the update interface to LiveVariables. Updated DataflowValues (generic ADT to store dataflow values) to also store values for blocks. This is used by DeadStores. Updated some comments. llvm-svn: 42293
* Updated header file inlcude to new location ofTed Kremenek2007-09-201-2/+2
| | | | | | Analysis/Visitors/*Visitors.h files. llvm-svn: 42175
* Move Decl::NextDeclarator (w/ setters/getters) down to ScopedDecl/FieldDecl.Steve Naroff2007-09-131-5/+5
| | | | | | Decl is now svelte:-) llvm-svn: 41935
* Minor space tightening.Ted Kremenek2007-09-121-6/+2
| | | | | | Removed extraneous call to Observer->ObserveStmt when handling DeclRefExprs. llvm-svn: 41890
* Fixed recursion bug: should call Visit on child instead of VisitStmt.Ted Kremenek2007-09-121-1/+1
| | | | llvm-svn: 41888
* Migrated LiveVariables to use the new DataflowStmtVisitor interface. The codeTed Kremenek2007-09-121-52/+18
| | | | | | is much simpler now. llvm-svn: 41885
* get rid of ugly "warning: no newline at end of file"Gabor Greif2007-09-111-1/+1
| | | | | | warnings that some compilers diagnose llvm-svn: 41847
* Fixed LiveVariables to no longer track the liveness of function pointersTed Kremenek2007-09-101-15/+59
| | | | | | | | | that refer to direct function calls. Modified interface of LiveVariables to only track liveness of VarDecls. This cleans up a bunch of edge cases, and removed the bug just mentioned. llvm-svn: 41797
* Renaming of the LiveVariablesAuditor interface. Changed "Auditor" andTed Kremenek2007-09-101-22/+24
| | | | | | "Audit" to "Observer" and "Observe" llvm-svn: 41794
* Added more checking in "dead stores" for values that are initializedTed Kremenek2007-09-061-1/+4
| | | | | | | | | | but never used. Fix a bug in LiveVariables where uses on the LHS of self-assign operators (e.g +=, *=, etc) would not be properly recorded in the liveness state of the variable. llvm-svn: 41757
* Minor bug fixes to corner cases where LiveVariables would crash on some CFGsTed Kremenek2007-09-061-2/+11
| | | | | | that contained no declarations, or when a variable is declared but never used. llvm-svn: 41756
* Added "Dead Stores", a flow-sensitive checker that checks for storesTed Kremenek2007-09-061-1/+16
| | | | | | | | | | to variables that are no longer live. This analysis is built on top of CFGs and the LiveVariables analysis. changes to driver: added driver option "-check-dead-stores" to run the analysis llvm-svn: 41754
* LiveVariables:Ted Kremenek2007-09-061-43/+200
| | | | | | | | | | | | | | - Finished 99% of analysis logic. Probably a few bugs. - Added querying functions to query liveness. - Added better pretty printing of liveness. - Added better bookkeeping of per-variable liveness information. - Added LiveVariablesAuditor interface, which allows "lazy" querying of intra-basic block liveness information. Driver: - Minor cleanups involved in dumping liveness information. llvm-svn: 41753
* Added an early implementation of Live-Variables analysis built onTed Kremenek2007-09-061-0/+282
source-level CFGs. This code may change significantly in the near future as we explore different means to implement dataflow analyses. Added a driver option, -dump-live-variables, to view the output of live variable analysis. This output is very ALPHA; it will be improved shortly. llvm-svn: 41737
OpenPOWER on IntegriCloud