aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LiveVariables.cpp
AgeCommit message (Collapse)Author
2009-11-10Fix clang's use of DenseMap iterators after r86636 fixed their constness.Jeffrey Yasskin
Patch by Victor Zverovich! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07Use SaveAndRestore to simplify logic in LiveVariables::runOnAllBlocks(). ↵Ted Kremenek
Patch by Kovarththanan Rajaratnam! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06add some const qualifiers, patch by Kovarththanan Rajaratnam!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86260 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar
are updated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17Use raw_ostream instead of C stdio.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16Move the source-level CFG from libAST to libAnalysis.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30Instead of r74522, use another approach to fix xfail_regionstore_wine_crash.c.Zhongxing Xu
Mark the super region of the binding of block level expr in the Environment as live. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30Block level expr should be visited. Otherwise variables in init expr ofZhongxing Xu
DeclStmt would be dead before the DeclStmt. For example: int x = 0; int y = x; 'x' would be dead before 'int y = x'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Remove hack from LiveVariables analysis where variables whose address are takenTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28rename some methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30Fix horrible non-termination bug in LiveVariables. The issue was thatTed Kremenek
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16Change some terminology in SourceLocation: instead of referring to Chris Lattner
the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09Fixed LiveVariables bug where we didn't consider block-level expressions ↵Ted Kremenek
that functioned as the size of a VLA to be live. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14Minor tweaks to liveness analysis:Ted Kremenek
- 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14Handle the case where 'element' in ObjCforCollectionstmt is not a DeclStmt ↵Ted Kremenek
or DeclRefExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59290 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14Rename header file.Ted Kremenek
Update include files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59284 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-13Fix uninitialized variable.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59222 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12Update CFGStmtVisitor to recognize that ObjCForCollectionStmts are special ↵Ted Kremenek
block-level "expressions". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59176 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12Use Stmt* instead of Expr* for block-level expression.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59161 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11Accesses to a collection within a fast enumeration 'for' statement ↵Ted Kremenek
constitute a 'use'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl
expressions, both of values and types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11Add transfer function support for ObjCForCollectionStmt to LiveVariables.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59053 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Cosmetic patch from João Paulo Rechi VitaDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26Move VLA processing logic from LiveVariables to CFG construction. This way ↵Ted Kremenek
all dataflow analyses "see" the VLA size expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26Examine VLA size expressions when computing liveness information.Ted Kremenek
Fixes <rdar://problem/6248086> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05Added decl_iterator to DeclStmt to provide an abstract interface to iterate ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03Fix a bug in the dead stores checker reported in the following email:Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53115 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner
Patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a ↵Ted Kremenek
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16LiveVariables now updates the liveness state of block-level expressions thatTed Kremenek
are referenced by CFGBlock terminators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49798 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Fix bug in terminator processing for uninitialized-values: simply ignore the ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Added initial support into the flow-sensitive dataflow solver to visit the ↵Ted Kremenek
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15++/-- makes a variable live since it is used; thus the liveness state isTed Kremenek
"Alive" as opposed to staying the same. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49707 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15Bug fix in LiveVariables: Operators ++/-- may kill a value, but the variableTed Kremenek
is still live. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49705 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20LiveVariables analysis now uses intersect for the merge of block-level ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48618 91177308-0d34-0410-b5e6-96231b3b80d8
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