summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/LiveVariables.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Teach live variable analyzes that super uses self pointer.Anna Zaks2012-08-141-0/+8
| | | | llvm-svn: 161822
* [analyzer] Variables with destructors are live until the destructor is run.Jordan Rose2012-07-261-0/+6
| | | | | | | Test case in the next commit, which enables destructors under certain circumstances. llvm-svn: 160805
* Bail out the LiveVariables analysis when the CFG is very large, asTed Kremenek2012-07-021-0/+5
| | | | | | | | | we are encountering some scalability issues with memory usage. The appropriate long term fix is to make the analysis more scalable, but this will at least prevent the analyzer swapping when analyzing very large functions. llvm-svn: 159578
* Enhance AnalysisDeclContext::getReferencedBlockVars() to understand ↵Ted Kremenek2011-12-221-4/+5
| | | | | | | | PseudoObjExprs. It turns out that the information collected by this method is a super set of the captured variables in BlockDecl. llvm-svn: 147122
* Fix regression in LiveVariables when reasoning about variables captured by ↵Ted Kremenek2011-12-221-5/+4
| | | | | | blocks. llvm-svn: 147116
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* We don't add ExprWithCleanups to the CFG, and getSVal looksJohn McCall2011-11-091-0/+4
| | | | | | | through it, so we should look through it for the live-values analysis as well. llvm-svn: 144190
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Tweak LookThroughStmt() in LiveVariables to properly look through ↵Ted Kremenek2011-11-051-4/+9
| | | | | | alternativing ParenExprs and OpaqueValueExprs. Thanks to Anna and Argiris for iterating on this function. My original patch embarssingly didn't even pass the Clang tests. llvm-svn: 143797
* LookThroughStmt GM release.Argyrios Kyrtzidis2011-11-051-2/+2
| | | | llvm-svn: 143796
* LookThroughStmt v4.6.3Argyrios Kyrtzidis2011-11-051-1/+1
| | | | llvm-svn: 143795
* Simplify LookThroughStmt in LiveVariables.cppArgyrios Kyrtzidis2011-11-051-12/+4
| | | | llvm-svn: 143794
* Another correction to the LiveVariables commit (r143767, r143780).Anna Zaks2011-11-051-3/+7
| | | | | | Make test/Analysis/misc-ps.c test pass. llvm-svn: 143790
* Fix infinite loop in LiveVariables due to a misplaced 'break' (it would ↵Argyrios Kyrtzidis2011-11-051-12/+6
| | | | | | | | break out of switch statement, not the while loop). llvm-svn: 143780
* Teach LiveVariables to look through OpaqueValueExprs for extending Stmt ↵Ted Kremenek2011-11-051-10/+28
| | | | | | liveness. llvm-svn: 143767
* Rename AnalysisContext to AnalysisDeclContext. Not only is this name more ↵Ted Kremenek2011-10-241-5/+5
| | | | | | accurate, but it frees up the name AnalysisContext for other uses. llvm-svn: 142782
* Pull TopologicallySortedCFG out of LiveVariables into its own analysis: ↵Ted Kremenek2011-10-221-105/+7
| | | | | | PostOrderCFGView. llvm-svn: 142713
* Remove AnalysisContext::getLiveVariables(), and introduce a templatized ↵Ted Kremenek2011-10-071-0/+2
| | | | | | mechanism to lazily create analyses that are attached to AnalysisContext objects. llvm-svn: 141425
* [static analyzer] Fix crash in LiveVariables and Environment::getSVal() when ↵Ted Kremenek2011-10-061-3/+4
| | | | | | analyzing C++ pointer-to-member calls. Fixes <rdar://problem/10243398>. llvm-svn: 141312
* Fix another major performance regression in LiveVariables by not ↵Ted Kremenek2011-10-021-1/+6
| | | | | | canonicalizing the underlying ImmutableSets on every analyzed statement (just at merges). Fixes <rdar://problem/10087538>. llvm-svn: 140958
* Fix LiveVariables analysis bug with MaterializeTemporaryExpr and fix ↵Ted Kremenek2011-10-021-4/+0
| | | | | | handling in ExprEngine. Fixes <rdar://problem/10201666>. llvm-svn: 140956
* Fix massive LiveVariables regression (due to LiveVariables rewrite) by ↵Ted Kremenek2011-09-161-62/+222
| | | | | | | | | | | | | | | | addressing two performance problems: - Speed of "merge()", which merged data flow facts. This was doing a set canonicalization on every insertion, which was super slow. To fix this, we use ImmutableSetRef. - Visit CFGBlocks in reverse postorder. This is a huge speedup, as on some test cases the algorithm would take many iterations to converge. This contains a bunch of copy-paste from UninitializedValues.cpp and ThreadSafety.cpp. The idea was to get something working first, and then refactor the common logic for all three files into a separate analysis/library entry point. llvm-svn: 139968
* 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
OpenPOWER on IntegriCloud