summaryrefslogtreecommitdiffstats
path: root/clang/Analysis/UninitializedValues.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-277/+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
* Added back logic in patch r46361 ↵Ted Kremenek2008-01-261-3/+3
| | | | | | | | | | | | (http://llvm.org/viewvc/llvm-project?rev=46361&view=rev) with the addition of some previously missing NULL pointer checks. Modified the UninitializedValues analysis to not expect that every Expr* at the block-level is a block-level expression (we probably need to change the name of such expressions to something truer to their meaning). llvm-svn: 46380
* Added VISIBILITY_HIDDEN to classes/structs in anonymous namespaces.Ted Kremenek2008-01-081-4/+10
| | | | 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
* For uninitialized values analysis, added special treatment for declarationsTed Kremenek2007-12-131-1/+16
| | | | | | | | | | | | | | | of array types. For things like: char x[10]; we should treat "x" as being initialized, because the variable "x" really refers to the memory block of the array. Clearly x[1] is uninitialized, but expressions like "(char*) x" really do refer to an initialized value. This simple dataflow analysis does not reason about the contents of arrays. This fixes: PR 1859 (http://llvm.org/bugs/show_bug.cgi?id=1859) llvm-svn: 44984
* Fixed bug in live-variable analysis and uninitialized-values analysis whereTed Kremenek2007-12-131-3/+13
| | | | | | | | | 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
* TargetInfo no longer includes a reference to SourceManager.Ted Kremenek2007-12-121-2/+2
| | | | | | | | | | | | | | | Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. llvm-svn: 44957
* Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek2007-12-111-1/+2
| | | | | | | | | | | | | | | | | | SourceManager is passed by reference, allowing the SourceManager to be associated with a specific translation unit, and not the entire execution of the driver. Modified all users of Diagnostics to comply with this new interface. Integrated SourceManager as a member variable of TargetInfo. TargetInfo will eventually be associated with a single translation unit (just like SourceManager). Made the SourceManager reference in ASTContext private. Provided accessor getSourceManager() for clients to use instead. Modified clients to comply with new interface. llvm-svn: 44878
* GCC has an extension where the left hand side of the ? : operator can be ↵Anders Carlsson2007-11-301-1/+7
| | | | | | omitted. Handle this in a few more places. llvm-svn: 44462
* Fixed bogus culling of uninitialized-values "taint" propagation during ↵Ted Kremenek2007-11-241-10/+6
| | | | | | | | | | | | assignments. We accidentally were throttling the propagation of uninitialized state across assignments (e.g. x = y). Thanks to Anders Carlsson for spotting this problem. Added test cases to test suite to provide regression testing for the uninitialized values analysis. llvm-svn: 44306
* Updated CFGStmtVisitor and CFGRecStmtVisitor to have a notion ofTed Kremenek2007-11-201-0/+2
| | | | | | | | | | | | | | | | "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
* Add a new Rewriter::getRangeSize method.Chris Lattner2007-10-161-1/+1
| | | | | | | | Rename SourceRange::Begin()/End() to getBegin()/getEnd() for consistency with other code. Start building the rewriter towards handling @encode. llvm-svn: 43047
* Migrated LiveVariables and UninitializedVariables to now use theTed Kremenek2007-10-011-6/+4
| | | | | | tracked BlkExpr information now maintained by the CFG class. llvm-svn: 42498
* Fixed UninitializedValues to properly propagate uninitialized "taint"Ted Kremenek2007-09-281-4/+14
| | | | | | in assignment operations of the form +=, -=, *=, etc. llvm-svn: 42449
* 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-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
* Updated header file inlcude to new location ofTed Kremenek2007-09-201-1/+1
| | | | | | Analysis/Visitors/*Visitors.h files. llvm-svn: 42175
* More refactoring: decl and expr regisitration now uses CFGRecStmtDeclVisitor.Ted Kremenek2007-09-191-22/+7
| | | | llvm-svn: 42145
* 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-181-9/+2
| | | | | | | | | 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
* Modified DataFlowValues and DataflowSolver to associate dataflow valueTed Kremenek2007-09-181-4/+0
| | | | | | | | | | 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-171-7/+23
| | | | | | | | | | | | | | 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/+303
llvm-svn: 42056
OpenPOWER on IntegriCloud