summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/UninitializedValues.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-4/+4
| | | | | | ambiguous context. llvm-svn: 116567
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-2/+2
| | | | | | to the new constants. llvm-svn: 112047
* [CFG]Ted Kremenek2010-03-021-2/+6
| | | | | | | | | | | | | | | | | | | After discussion with Zhongxing, don't force the initializer of DeclStmts to be block-level expressions. This led to some interesting fallout: [UninitializedValues] Always visit the initializer of DeclStmts (do not assume they are block-level expressions). [BasicStore] With initializers of DeclStmts no longer block-level expressions, this causes self-referencing initializers (e.g. 'int x = x') to no longer cause the initialized variable to be live before the DeclStmt. While this is correct, it caused BasicStore::RemoveDeadBindings() to prune off the values of these variables from the initial store (where they are set to uninitialized). The fix is to back-port some (and only some) of the lazy-binding logic from RegionStore to BasicStore. Now the default values of local variables are determined lazily as opposed to explicitly initialized. llvm-svn: 97591
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | (1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. llvm-svn: 94406
* lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespaceKovarththanan Rajaratnam2009-11-281-4/+3
| | | | llvm-svn: 90028
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-42/+42
| | | | llvm-svn: 81346
* rename some methods.Chris Lattner2009-03-281-1/+1
| | | | llvm-svn: 67923
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Flow-sensitive uninitialized values analysis: properly handle the 'element' ↵Ted Kremenek2008-11-141-3/+10
| | | | | | expression of ObjCForCollectionStmt (can be anything). llvm-svn: 59312
* Rename header file.Ted Kremenek2008-11-141-2/+2
| | | | | | Update include files. llvm-svn: 59284
* Update CFGStmtVisitor to recognize that ObjCForCollectionStmts are special ↵Ted Kremenek2008-11-121-2/+3
| | | | | | block-level "expressions". llvm-svn: 59176
* Flow-sensitive uninitialized values analysis:Ted Kremenek2008-11-111-4/+27
| | | | | | | - Added support for ObjCForCollectionStmt - Fixed bug where expression values would be always set to uninitialized when loops were involved llvm-svn: 59076
* Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl2008-11-111-3/+0
| | | | | | expressions, both of values and types. llvm-svn: 59057
* It's spelt "uninitialized".Nick Lewycky2008-08-161-4/+5
| | | | llvm-svn: 54848
* Added decl_iterator to DeclStmt to provide an abstract interface to iterate ↵Ted Kremenek2008-08-051-2/+2
| | | | | | | | over the ScopedDecls of a DeclStmt. Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead. Will update other clients after additional testing. llvm-svn: 54368
* Fix MSVC compiler error: "initialization of 'VD' is skipped by 'case' label"Argyrios Kyrtzidis2008-04-171-1/+2
| | | | llvm-svn: 49853
* Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a ↵Ted Kremenek2008-04-161-1/+1
| | | | | | | | | | | 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>. llvm-svn: 49818
* Simplify some code.Ted Kremenek2008-04-161-31/+28
| | | | llvm-svn: 49763
* Change "VisitBlockVarDecl" to "VisitVarDecl". UninitializedValues now worksTed Kremenek2008-04-151-1/+1
| | | | | | as before r49748 (where BlockVarDecl was removed). llvm-svn: 49749
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-14/+21
| | | | | | | | VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl(). This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it). llvm-svn: 49748
* Fix bug in terminator processing for uninitialized-values: simply ignore the ↵Ted Kremenek2008-04-151-10/+9
| | | | | | | | | | 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. llvm-svn: 49734
* Added initial support into the flow-sensitive dataflow solver to visit the ↵Ted Kremenek2008-04-151-0/+2
| | | | | | | | | | | | | 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). llvm-svn: 49709
* Changed merge operation for uninitialized values analysis to "intersect" ↵Ted Kremenek2008-03-221-1/+1
| | | | | | | | (previous union). The effect is that if a variable is uninitialized along a branch (but initialized along another), at merge points it is considered uninitialized. Previously we had the opposite behavior. The new behavior is more conservative, and more in line with gcc's behavior. llvm-svn: 48689
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+277
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
OpenPOWER on IntegriCloud