aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Analysis/Analyses/LiveVariables.h6
-rw-r--r--include/clang/Analysis/PathSensitive/AnalysisContext.h14
2 files changed, 16 insertions, 4 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.
diff --git a/include/clang/Analysis/PathSensitive/AnalysisContext.h b/include/clang/Analysis/PathSensitive/AnalysisContext.h
index 9b58f745f0..8b1a329c03 100644
--- a/include/clang/Analysis/PathSensitive/AnalysisContext.h
+++ b/include/clang/Analysis/PathSensitive/AnalysisContext.h
@@ -19,6 +19,7 @@
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Allocator.h"
namespace clang {
@@ -38,17 +39,26 @@ class AnalysisContext {
CFG *cfg;
LiveVariables *liveness;
ParentMap *PM;
-
+ llvm::DenseMap<const BlockDecl*,void*> *ReferencedBlockVars;
+ llvm::BumpPtrAllocator A;
public:
- AnalysisContext(const Decl *d) : D(d), cfg(0), liveness(0), PM(0) {}
+ AnalysisContext(const Decl *d) : D(d), cfg(0), liveness(0), PM(0),
+ ReferencedBlockVars(0) {}
+
~AnalysisContext();
+ ASTContext &getASTContext() { return D->getASTContext(); }
const Decl *getDecl() { return D; }
Stmt *getBody();
CFG *getCFG();
ParentMap &getParentMap();
LiveVariables *getLiveVariables();
+ typedef const VarDecl * const * referenced_decls_iterator;
+
+ std::pair<referenced_decls_iterator, referenced_decls_iterator>
+ getReferencedBlockVars(const BlockDecl *BD);
+
/// Return the ImplicitParamDecl* associated with 'self' if this
/// AnalysisContext wraps an ObjCMethodDecl. Returns NULL otherwise.
const ImplicitParamDecl *getSelfDecl() const;