summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/LiveVariables.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Constify the result of CFGStmt::getStmt().Ted Kremenek2011-08-231-1/+1
| | | | llvm-svn: 138408
* Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer ↵Ted Kremenek2011-08-121-3/+3
| | | | | | and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at. llvm-svn: 137537
* [analyzer] Simplify logic for ExprEngine::VisitUnaryExprOrTypeTraitExpr to ↵Ted Kremenek2011-08-061-10/+33
| | | | | | | | avoid recursion to subexpression. This exposed bugs in the live variables analysis, and a latent analyzer bug in the SymbolReaper. llvm-svn: 137006
* Make helper functions static.Benjamin Kramer2011-08-021-2/+3
| | | | llvm-svn: 136679
* [analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to ↵Ted Kremenek2011-07-281-307/+401
| | | | | | | | | | | | be linearized only when used by the static analyzer. This required a rewrite of LiveVariables, and exposed a ton of subtle bugs. The motivation of this large change is to drastically simplify the logic in ExprEngine going forward. Some fallout is that the output of some BugReporterVisitors is not as accurate as before; those will need to be fixed over time. There is also some possible performance regression as RemoveDeadBindings will be called frequently; this can also be improved over time. llvm-svn: 136419
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-1/+1
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* [analyzer] PR8962 again. Ban ParenExprs (and friends) from block-level ↵Jordy Rose2011-06-101-13/+3
| | | | | | | | expressions (by calling IgnoreParens before adding expressions to blocks). Undo 132769 (LiveVariables' local IgnoreParens), since it's no longer necessary. Also, have Environment stop looking through NoOp casts; it didn't match the behavior of LiveVariables. And once that's gone, the whole cast block of that switch is unnecessary. llvm-svn: 132840
* [analyzer] Ignore parentheses around block-level expressions when computing ↵Jordy Rose2011-06-091-3/+13
| | | | | | liveness. Fixes the other half of PR8962. llvm-svn: 132769
* Don't report dead stores on unreachable code paths. Fixes ↵Ted Kremenek2011-02-111-4/+8
| | | | | | <rdar://problem/8405222>. llvm-svn: 125415
* Add alternate version of LiveVariables analysis that does not kill liveness ↵Tom Care2010-08-271-6/+8
| | | | | | | | | at assignments. This 'relaxed' liveness is useful in path sensitive analysis for situations where the resulting extended liveness allows us to find some bugs. - Added killAtAssign flag to LiveVariables - Added relaxed LiveVariables to AnalysisContext with an accessor llvm-svn: 112306
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-5/+5
| | | | | | to the new constants. llvm-svn: 112047
* Assignments to reference variables shouldn't kill the variable.Jordy Rose2010-06-041-9/+13
| | | | llvm-svn: 105452
* 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
OpenPOWER on IntegriCloud