aboutsummaryrefslogtreecommitdiff
path: root/Analysis/UninitializedValues.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-01-26Added back logic in patch r46361 ↵Ted Kremenek
(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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08Added VISIBILITY_HIDDEN to classes/structs in anonymous namespaces.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45750 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-12-21Directory restructing of Analysis files.Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45292 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13For uninitialized values analysis, added special treatment for declarationsTed Kremenek
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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Fixed bug in live-variable analysis and uninitialized-values analysis whereTed Kremenek
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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44982 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12TargetInfo no longer includes a reference to SourceManager.Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30GCC has an extension where the left hand side of the ? : operator can be ↵Anders Carlsson
omitted. Handle this in a few more places. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44462 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24Fixed bogus culling of uninitialized-values "taint" propagation during ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Updated CFGStmtVisitor and CFGRecStmtVisitor to have a notion ofTed Kremenek
"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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44246 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16Add a new Rewriter::getRangeSize method.Chris Lattner
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for consistency with other code. Start building the rewriter towards handling @encode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01Migrated LiveVariables and UninitializedVariables to now use theTed Kremenek
tracked BlkExpr information now maintained by the CFG class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28Fixed UninitializedValues to properly propagate uninitialized "taint"Ted Kremenek
in assignment operations of the form +=, -=, *=, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28Fixed several bugs in the propagation of "uninitialized value"Ted Kremenek
taintness across expressions. Made "smart-culling" of taint propagation (for error reporting) correctly handle conditional expressions and a few other edge cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27Created new "ExprDeclBitVector" type bundle for dataflow analyses that need ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42408 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
2007-09-20Updated header file inlcude to new location ofTed Kremenek
Analysis/Visitors/*Visitors.h files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42175 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19More refactoring: decl and expr regisitration now uses CFGRecStmtDeclVisitor.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42145 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Minor performance fix in transfer function logic. Previously weTed Kremenek
called VisitStmt, but VisitChildren is more direct and creates less boilerplate logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18More refactoring and code reduction.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42109 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Add overloaded versions of DataflowSolver::runOnBlock to simplifyTed Kremenek
invocation of the solver. UninitializedValues checker now uses CFG::runOnAllBlocks to query the computed dataflow values (tighter code). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42107 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Added member template CFG::VisitBlockStmts to provide a succinct wayTed Kremenek
of visiting all block-level statements in a CFG. Tightened implementation of UninitializedValues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-18Modified DataFlowValues and DataflowSolver to associate dataflow valueTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42099 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17Bug fix to merging of data flow values (merge incorrectly made valuesTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42067 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17Renamed file due to mispelling.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42056 91177308-0d34-0410-b5e6-96231b3b80d8