summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/LiveVariables.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix an algorithmic bug in LiveVariables pointed out by Zhongxing.Ted Kremenek2010-03-031-6/+9
| | | | | | | If an initializer in a DeclStmt references the declared variable, that extends the liveness of that variable. llvm-svn: 97624
* Register all parameters even if they didn't occur in the function body.Zhongxing Xu2010-03-021-0/+6
| | | | | | | We may query their liveness because they are added to store when passing argument values. llvm-svn: 97562
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | (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
* Simplify code by using an equivalent template class.Zhongxing Xu2009-12-301-11/+2
| | | | llvm-svn: 92305
* Enhance dataflow analyses to recognize branch statements in the CFG used as ↵Ted Kremenek2009-12-241-1/+13
| | | | | | hooks for the initialization of condition variables. llvm-svn: 92119
* lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespaceKovarththanan Rajaratnam2009-11-281-3/+2
| | | | llvm-svn: 90028
* Enhance LiveVariables to understand that blocks can extend the liveness of a ↵Ted Kremenek2009-11-261-3/+17
| | | | | | | | | | | | | | | variable by "capturing" them in a BlockExpr. This required two changes: 1) Added 'getReferencedgetReferencedBlockVars()' to AnalysisContext so that clients can iterate over the "captured" variables in a block. 2) Modified LiveVariables to take an AnalysisContext& in its constructor and to call getReferencedgetReferencedBlockVars() when it processes a BlockExpr*. llvm-svn: 89924
* Fix clang's use of DenseMap iterators after r86636 fixed their constness.Jeffrey Yasskin2009-11-101-1/+1
| | | | | | Patch by Victor Zverovich! llvm-svn: 86638
* Use SaveAndRestore to simplify logic in LiveVariables::runOnAllBlocks(). ↵Ted Kremenek2009-11-071-3/+3
| | | | | | Patch by Kovarththanan Rajaratnam! llvm-svn: 86343
* add some const qualifiers, patch by Kovarththanan Rajaratnam!Chris Lattner2009-11-061-2/+2
| | | | llvm-svn: 86260
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Use raw_ostream instead of C stdio.Daniel Dunbar2009-10-171-9/+6
| | | | llvm-svn: 84340
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-60/+60
| | | | llvm-svn: 81346
* Move the source-level CFG from libAST to libAnalysis.Ted Kremenek2009-07-161-1/+1
| | | | llvm-svn: 76092
* Instead of r74522, use another approach to fix xfail_regionstore_wine_crash.c.Zhongxing Xu2009-06-301-1/+0
| | | | | | | Mark the super region of the binding of block level expr in the Environment as live. llvm-svn: 74525
* Block level expr should be visited. Otherwise variables in init expr ofZhongxing Xu2009-06-301-1/+3
| | | | | | | | | | DeclStmt would be dead before the DeclStmt. For example: int x = 0; int y = x; 'x' would be dead before 'int y = x'. llvm-svn: 74522
* Remove hack from LiveVariables analysis where variables whose address are takenTed Kremenek2009-04-071-18/+0
| | | | | | | | | | | | are considered 'live'. This hack isn't needed anymore because we have a separation in the path-sensitive analyzer between variable names and bindings; the analyzer can continue to reason about the storage of a variable after its name is no longer directly referenced. Now the live variables analysis literally means "is this name live". Along this line, update the dead stores checker to explicitly look for variables whose values have escaped. llvm-svn: 68504
* rename some methods.Chris Lattner2009-03-281-1/+1
| | | | llvm-svn: 67923
* Fix horrible non-termination bug in LiveVariables. The issue was thatTed Kremenek2009-01-301-2/+2
| | | | | | | | | | | the liveness state of block-level expressions could oscillate because of two issues: - The initial value before a merge was not always set to "Top" - The set of live block-level expressions is a union, not an intersection This fixes <rdar://problem/650084>. llvm-svn: 63421
* Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner2009-01-271-7/+3
| | | | | | | | | | | | | | | | | | | as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-4/+4
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* Fixed LiveVariables bug where we didn't consider block-level expressions ↵Ted Kremenek2008-12-091-2/+12
| | | | | | that functioned as the size of a VLA to be live. llvm-svn: 60730
* Minor tweaks to liveness analysis:Ted Kremenek2008-11-141-0/+7
| | | | | | | - Block-expression for 'ObjCForCollectionStmt' is not alive before it occurs - Recursively visit 'element' expression for ObjCForCollectionStmt to get liveness for referenced block-level expressions and variables. llvm-svn: 59316
* Handle the case where 'element' in ObjCforCollectionstmt is not a DeclStmt ↵Ted Kremenek2008-11-141-5/+8
| | | | | | or DeclRefExpr. llvm-svn: 59290
* Rename header file.Ted Kremenek2008-11-141-2/+2
| | | | | | Update include files. llvm-svn: 59284
* Fix uninitialized variable.Ted Kremenek2008-11-131-1/+1
| | | | llvm-svn: 59222
* Update CFGStmtVisitor to recognize that ObjCForCollectionStmts are special ↵Ted Kremenek2008-11-121-2/+4
| | | | | | block-level "expressions". llvm-svn: 59176
* Use Stmt* instead of Expr* for block-level expression.Ted Kremenek2008-11-121-1/+1
| | | | llvm-svn: 59161
* Accesses to a collection within a fast enumeration 'for' statement ↵Ted Kremenek2008-11-111-9/+15
| | | | | | constitute a 'use'. llvm-svn: 59075
* Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl2008-11-111-1/+0
| | | | | | expressions, both of values and types. llvm-svn: 59057
* Add transfer function support for ObjCForCollectionStmt to LiveVariables.Ted Kremenek2008-11-111-1/+17
| | | | llvm-svn: 59053
* Cosmetic patch from João Paulo Rechi VitaDouglas Gregor2008-10-211-1/+0
| | | | llvm-svn: 57910
* Move VLA processing logic from LiveVariables to CFG construction. This way ↵Ted Kremenek2008-09-261-20/+0
| | | | | | all dataflow analyses "see" the VLA size expressions. llvm-svn: 56655
* Examine VLA size expressions when computing liveness information.Ted Kremenek2008-09-261-4/+26
| | | | | | Fixes <rdar://problem/6248086> llvm-svn: 56645
* Added decl_iterator to DeclStmt to provide an abstract interface to iterate ↵Ted Kremenek2008-08-051-2/+3
| | | | | | | | 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 a bug in the dead stores checker reported in the following email:Ted Kremenek2008-07-031-3/+11
| | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-July/002157.html Essentially the observer mechanism in LiveVariables was observing block-level expressions multiple times, leading to a case where the dead store checker could see a value as dead when it was really live. llvm-svn: 53115
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-171-0/+5
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a ↵Ted Kremenek2008-04-161-48/+5
| | | | | | | | | | | 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
* LiveVariables now updates the liveness state of block-level expressions thatTed Kremenek2008-04-161-12/+49
| | | | | | are referenced by CFGBlock terminators. llvm-svn: 49798
* Fix bug in terminator processing for uninitialized-values: simply ignore the ↵Ted Kremenek2008-04-151-7/+64
| | | | | | | | | | 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-1/+19
| | | | | | | | | | | | | 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
* ++/-- makes a variable live since it is used; thus the liveness state isTed Kremenek2008-04-151-3/+3
| | | | | | "Alive" as opposed to staying the same. llvm-svn: 49707
* Bug fix in LiveVariables: Operators ++/-- may kill a value, but the variableTed Kremenek2008-04-151-6/+5
| | | | | | is still live. llvm-svn: 49705
* LiveVariables analysis now uses intersect for the merge of block-level ↵Ted Kremenek2008-03-201-2/+11
| | | | | | | | expression liveness information. The rationale is that a block-level expression cannot be live in a parent block unless it is live in all of the successor blocks. llvm-svn: 48618
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+246
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