summaryrefslogtreecommitdiffstats
path: root/clang/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed several bugs in the propagation of "uninitialized value"Ted Kremenek2007-09-281-54/+44
| | | | | | | | | taintness across expressions. Made "smart-culling" of taint propagation (for error reporting) correctly handle conditional expressions and a few other edge cases. llvm-svn: 42421
* Created new "ExprDeclBitVector" type bundle for dataflow analyses that need ↵Ted Kremenek2007-09-271-39/+29
| | | | | | | | | | | | | boolean values associated with ScopedDecls and CFGBlock-level Exprs. This is the common boilerplate needed by UninitializedValues and LiveVariables. Refactored UninitializedValues to use ExprDeclBitVector. Shortened the string diagnostic for UninitializedValues. llvm-svn: 42408
* Moved "DataflowSolver.h" to the "include/" subtree. Adjusted clientTed Kremenek2007-09-253-269/+2
| | | | | | | | | | 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
* Comment formatting changes. No real content changes.Ted Kremenek2007-09-251-14/+14
| | | | llvm-svn: 42305
* Minor comment changes.Ted Kremenek2007-09-251-6/+10
| | | | llvm-svn: 42304
* Removed "EverKilled" class in DeadStores checker; it is no longer used.Ted Kremenek2007-09-251-12/+0
| | | | llvm-svn: 42301
* Further refactored DataflowSolver. Now most code for the solver is sharedTed Kremenek2007-09-253-522/+242
| | | | | | | | | | | | | | | | | | | 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-202-3/+3
| | | | | | Analysis/Visitors/*Visitors.h files. llvm-svn: 42175
* Updated VC++ project files.Hartmut Kaiser2007-09-201-4/+4
| | | | | | Disambiguated a variable. llvm-svn: 42161
* More refactoring: decl and expr regisitration now uses CFGRecStmtDeclVisitor.Ted Kremenek2007-09-191-22/+7
| | | | llvm-svn: 42145
* DataflowSolver now acccepts an "_Equal" template parameter that allows the userTed Kremenek2007-09-181-2/+4
| | | | | | | to specify how two dataflow values should be compared for equality. The default is to use std::equal_to. llvm-svn: 42115
* Changed solver to use "==" operator when comparing dataflow valuesTed Kremenek2007-09-181-1/+1
| | | | | | | rather than a special "equal" method defined in the class for the value. llvm-svn: 42113
* Minor performance fix in transfer function logic. Previously weTed Kremenek2007-09-181-1/+1
| | | | | | | called VisitStmt, but VisitChildren is more direct and creates less boilerplate logic. llvm-svn: 42110
* More refactoring and code reduction.Ted Kremenek2007-09-181-72/+52
| | | | llvm-svn: 42109
* Add overloaded versions of DataflowSolver::runOnBlock to simplifyTed Kremenek2007-09-182-9/+11
| | | | | | | | | invocation of the solver. UninitializedValues checker now uses CFG::runOnAllBlocks to query the computed dataflow values (tighter code). llvm-svn: 42107
* Added member template CFG::VisitBlockStmts to provide a succinct wayTed Kremenek2007-09-181-30/+10
| | | | | | | | of visiting all block-level statements in a CFG. Tightened implementation of UninitializedValues. llvm-svn: 42106
* Moved TransferFunction object within DataflowSolver to be a instanceTed Kremenek2007-09-181-18/+10
| | | | | | variable instead of a temporary. llvm-svn: 42102
* Modified DataFlowValues and DataflowSolver to associate dataflow valueTed Kremenek2007-09-182-68/+88
| | | | | | | | | | with CFG *edges* instead of blocks. This will fascilitate dataflow analyses that are sensitive to block terminators, and also simplifies some reasoning. Updated UninitializedValues to comply to this new interface. llvm-svn: 42099
* Bug fix to merging of data flow values (merge incorrectly made valuesTed Kremenek2007-09-172-20/+55
| | | | | | | | | | | | | | too "conservative"). Several revisions to UninitializedValues checker after testing. We now appear to be working correctly (probably some bugs still, but main functionality appears to be there). Implemented careful emitting of warnings so that we wouldn't get a cascade of warnings for simply not defining a single variable and using it everywhere. This way the warnings point closer to the root cause rather than "symptoms" from using values derived from uninitialized variables. llvm-svn: 42067
* Renamed file due to mispelling.Ted Kremenek2007-09-171-0/+0
| | | | llvm-svn: 42056
* UninitialuzedValues now only tracks BlockVarDecls; obviating false positives ↵Ted Kremenek2007-09-172-26/+61
| | | | | | | | with globals and function parameters. llvm-svn: 42055
* More progress on UnitializedValues checker. We now have preliminary supportTed Kremenek2007-09-171-22/+85
| | | | | | for reporting errors and running the checker. llvm-svn: 42046
* Split tracking of unitialized values for Decls and CFGBlock-level expressions.Ted Kremenek2007-09-171-16/+114
| | | | llvm-svn: 42041
* Removed "ObserverTy" from core DataflowValues types. The observerTed Kremenek2007-09-172-23/+27
| | | | | | | | | | | | | | | | | | | | | | | mechanism can be implemented simply by affixing the Observer to an analysis meta data, so it doesn't need to be a required type. This also permits analyses not to implement an Observer if it doesn't make sense. Changed "DataflowValues::MetaDataTy" to "DataflowValues::AnalysisDataTy" to reflect that the type enscapsulated the data associated with analyzing a given CFG. Changed CFGStmtVisitor::BlockStmt_VisitImplicitControlFlowStmt(Stmt*) to ...VisitImplicitControlFlowExpr(Expr*). The type narrowing is more precise and more useful to clients. Added CFGStmtVisitor::BlockStmt_VisitExpr to reflect the visitation of expressions at the block statement level. This captures all implicit control-flow statements as well as other expressions that are hoisted to the block level (such as conditions for terminators and function calls). This is especially useful for dataflow analysis. llvm-svn: 42034
* switch the various CFG-based stuff over to using ASTConsumer interface,Chris Lattner2007-09-151-16/+13
| | | | | | | this eliminates their dependence on the preprocessor and eliminates some duplicated code. llvm-svn: 41993
* fix commentChris Lattner2007-09-151-1/+1
| | | | llvm-svn: 41988
* Prototype implementation of new template-based dataflow solver.Ted Kremenek2007-09-142-0/+330
| | | | | | | Preliminary implementation of UninitializedValues, which is based on new solver (doesn't work yet, but compiles). llvm-svn: 41970
* Move Decl::NextDeclarator (w/ setters/getters) down to ScopedDecl/FieldDecl.Steve Naroff2007-09-131-5/+5
| | | | | | Decl is now svelte:-) llvm-svn: 41935
* make the sourcemgr available through ASTContext.Chris Lattner2007-09-131-1/+3
| | | | llvm-svn: 41906
* 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
* For looking at "dead stores" in declarations, we now check to seeTed Kremenek2007-09-111-7/+21
| | | | | | | | | | | | if the assigned value is a constant expression, e.g.: int x = 0; We then check to see if "x" is ever reassigned later. If so, we don't emit a warning. This is because programmers frequently use defensive programming to make sure a variable has a defined value. llvm-svn: 41853
* Fixed potential NULL dereference when iterating over a chain of Decls.Ted Kremenek2007-09-111-1/+1
| | | | llvm-svn: 41848
* get rid of ugly "warning: no newline at end of file"Gabor Greif2007-09-112-2/+2
| | | | | | warnings that some compilers diagnose llvm-svn: 41847
* Fixed LiveVariables to no longer track the liveness of function pointersTed Kremenek2007-09-102-27/+70
| | | | | | | | | 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-102-27/+29
| | | | | | "Audit" to "Observer" and "Observe" llvm-svn: 41794
* Added more checking in "dead stores" for values that are initializedTed Kremenek2007-09-062-1/+17
| | | | | | | | | | 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
* Forgot to check in the actual "dead stores" checker in the last commit!Ted Kremenek2007-09-061-0/+70
| | | | llvm-svn: 41755
* 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-062-0/+304
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