aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/Analyses/LiveVariables.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-26 02:31:33 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-26 02:31:33 +0000
commitb1a7b65231e86f7da6aacbf00bcdc16c56350e65 (patch)
treea72b34bb5372c1f89a4841fac28fd2250132342f /include/clang/Analysis/Analyses/LiveVariables.h
parentf21bf9b87a5edefb3f10a96ac036f92f538b8d32 (diff)
Enhance LiveVariables to understand that blocks can extend the liveness of a 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*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89924 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/Analyses/LiveVariables.h')
-rw-r--r--include/clang/Analysis/Analyses/LiveVariables.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/clang/Analysis/Analyses/LiveVariables.h b/include/clang/Analysis/Analyses/LiveVariables.h
index 8674943960..0077a85051 100644
--- a/include/clang/Analysis/Analyses/LiveVariables.h
+++ b/include/clang/Analysis/Analyses/LiveVariables.h
@@ -23,6 +23,7 @@ namespace clang {
class Stmt;
class DeclRefExpr;
class SourceManager;
+class AnalysisContext;
struct LiveVariables_ValueTypes {
@@ -39,8 +40,9 @@ struct LiveVariables_ValueTypes {
struct AnalysisDataTy : public StmtDeclBitVector_Types::AnalysisDataTy {
ObserverTy* Observer;
ValTy AlwaysLive;
+ AnalysisContext *AC;
- AnalysisDataTy() : Observer(NULL) {}
+ AnalysisDataTy() : Observer(NULL), AC(NULL) {}
};
//===-----------------------------------------------------===//
@@ -66,7 +68,7 @@ class LiveVariables : public DataflowValues<LiveVariables_ValueTypes,
public:
typedef LiveVariables_ValueTypes::ObserverTy ObserverTy;
- LiveVariables(ASTContext& Ctx, CFG& cfg);
+ LiveVariables(AnalysisContext &AC);
/// IsLive - Return true if a variable is live at beginning of a
/// specified block.